• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

KIMAP Library

session_p.h

00001 /*
00002     Copyright (c) 2009 Kevin Ottens <ervin@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or modify it
00005     under the terms of the GNU Library General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or (at your
00007     option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful, but WITHOUT
00010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012     License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to the
00016     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301, USA.
00018 */
00019 
00020 #ifndef KIMAP_SESSION_P_H
00021 #define KIMAP_SESSION_P_H
00022 
00023 #include "session.h"
00024 #include "sessionuiproxy.h"
00025 
00026 #include <ktcpsocket.h>
00027 
00028 #include <QtCore/QObject>
00029 #include <QtCore/QQueue>
00030 #include <QtCore/QString>
00031 #include <QtCore/QTimer>
00032 
00033 class KJob;
00034 
00035 namespace KIMAP {
00036 
00037 class Job;
00038 struct Message;
00039 class SessionLogger;
00040 class SessionThread;
00041 
00042 class KIMAP_EXPORT SessionPrivate : public QObject
00043 {
00044   Q_OBJECT
00045 
00046   friend class Session;
00047 
00048   public:
00049     SessionPrivate( Session *session );
00050 
00051     void addJob(Job *job);
00052     QByteArray sendCommand( const QByteArray &command, const QByteArray &args = QByteArray() );
00053     void startSsl(const KTcpSocket::SslVersion &version);
00054     void sendData( const QByteArray &data );
00055 
00056     void handleSslError( const KSslErrorUiData &errorData );
00057 
00058     KTcpSocket::SslVersion negotiatedEncryption() const;
00059 
00060     void setSocketTimeout( int ms );
00061     int socketTimeout() const;
00062 
00063   Q_SIGNALS:
00064     void encryptionNegotiationResult(bool);
00065 
00066   private Q_SLOTS:
00067     void onEncryptionNegotiationResult(bool isEncrypted, KTcpSocket::SslVersion sslVersion);
00068     void onSocketTimeout();
00069 
00070   private:
00071     void startNext();
00072     void doStartNext();
00073     void jobDone( KJob *job );
00074     void jobDestroyed( QObject *job );
00075     void responseReceived( const KIMAP::Message &response );
00076 
00077     void socketConnected();
00078     void socketDisconnected();
00079     void socketError();
00080 
00081     void startSocketTimer();
00082     void stopSocketTimer();
00083     void restartSocketTimer();
00084 
00085     Session *const q;
00086 
00087     bool isSocketConnected;
00088     Session::State state;
00089 
00090     SessionLogger *logger;
00091     SessionThread *thread;
00092     SessionUiProxy::Ptr uiProxy;
00093 
00094     bool jobRunning;
00095     Job *currentJob;
00096     QQueue<Job*> queue;
00097 
00098     QByteArray authTag;
00099     QByteArray selectTag;
00100     QByteArray closeTag;
00101 
00102     QByteArray greeting;
00103     QByteArray currentMailBox;
00104     QByteArray upcomingMailBox;
00105     quint16 tagCount;
00106 
00107     KTcpSocket::SslVersion sslVersion;
00108 
00109     int socketTimerInterval;
00110     QTimer socketTimer;
00111 };
00112 
00113 }
00114 
00115 #endif

KIMAP Library

Skip menu "KIMAP Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal