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 virtual ~SessionPrivate(); 00051 00052 void addJob(Job *job); 00053 QByteArray sendCommand( const QByteArray &command, const QByteArray &args = QByteArray() ); 00054 void startSsl(const KTcpSocket::SslVersion &version); 00055 void sendData( const QByteArray &data ); 00056 00057 void handleSslError( const KSslErrorUiData &errorData ); 00058 00059 KTcpSocket::SslVersion negotiatedEncryption() const; 00060 00061 void setSocketTimeout( int ms ); 00062 int socketTimeout() const; 00063 00064 Q_SIGNALS: 00065 void encryptionNegotiationResult(bool); 00066 00067 private Q_SLOTS: 00068 void onEncryptionNegotiationResult(bool isEncrypted, KTcpSocket::SslVersion sslVersion); 00069 void onSocketTimeout(); 00070 00071 private: 00072 void startNext(); 00073 void doStartNext(); 00074 void jobDone( KJob *job ); 00075 void jobDestroyed( QObject *job ); 00076 void clearJobQueue(); 00077 void responseReceived( const KIMAP::Message &response ); 00078 void setState(Session::State state); 00079 00080 void socketConnected(); 00081 void socketDisconnected(); 00082 void socketError(); 00083 void socketActivity(); 00084 00085 void startSocketTimer(); 00086 void stopSocketTimer(); 00087 void restartSocketTimer(); 00088 00089 Session *const q; 00090 00091 bool isSocketConnected; 00092 Session::State state; 00093 00094 SessionLogger *logger; 00095 SessionThread *thread; 00096 SessionUiProxy::Ptr uiProxy; 00097 00098 bool jobRunning; 00099 Job *currentJob; 00100 QQueue<Job*> queue; 00101 00102 QByteArray authTag; 00103 QByteArray selectTag; 00104 QByteArray closeTag; 00105 00106 QString userName; 00107 QByteArray greeting; 00108 QByteArray currentMailBox; 00109 QByteArray upcomingMailBox; 00110 quint16 tagCount; 00111 00112 KTcpSocket::SslVersion sslVersion; 00113 00114 int socketTimerInterval; 00115 QTimer socketTimer; 00116 }; 00117 00118 } 00119 00120 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Apr 30 2012 21:48:32 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Apr 30 2012 21:48:32 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.