• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.5 API Reference
  • KDE Home
  • 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     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 Thu Aug 2 2012 15:24:24 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIMAP Library

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

kdepimlibs-4.8.5 API Reference

Skip menu "kdepimlibs-4.8.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal