• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KIMAP Library

  • kimap
session_p.h
1 /*
2  Copyright (c) 2009 Kevin Ottens <ervin@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef KIMAP_SESSION_P_H
21 #define KIMAP_SESSION_P_H
22 
23 #include "session.h"
24 #include "sessionuiproxy.h"
25 
26 #include <ktcpsocket.h>
27 
28 #include <QtCore/QObject>
29 #include <QtCore/QQueue>
30 #include <QtCore/QString>
31 #include <QtCore/QTimer>
32 
33 class KJob;
34 
35 namespace KIMAP {
36 
37 class Job;
38 struct Message;
39 class SessionLogger;
40 class SessionThread;
41 
42 class KIMAP_EXPORT SessionPrivate : public QObject
43 {
44  Q_OBJECT
45 
46  friend class Session;
47 
48  public:
49  SessionPrivate( Session *session );
50  virtual ~SessionPrivate();
51 
52  void addJob(Job *job);
53  QByteArray sendCommand( const QByteArray &command, const QByteArray &args = QByteArray() );
54  void startSsl(const KTcpSocket::SslVersion &version);
55  void sendData( const QByteArray &data );
56 
57  void handleSslError( const KSslErrorUiData &errorData );
58 
59  KTcpSocket::SslVersion negotiatedEncryption() const;
60 
61  void setSocketTimeout( int ms );
62  int socketTimeout() const;
63 
64  Q_SIGNALS:
65  void encryptionNegotiationResult(bool);
66 
67  private Q_SLOTS:
68  void onEncryptionNegotiationResult(bool isEncrypted, KTcpSocket::SslVersion sslVersion);
69  void onSocketTimeout();
70 
71  private:
72  void startNext();
73  void doStartNext();
74  void jobDone( KJob *job );
75  void jobDestroyed( QObject *job );
76  void clearJobQueue();
77  void responseReceived( const KIMAP::Message &response );
78  void setState(Session::State state);
79 
80  void socketConnected();
81  void socketDisconnected();
82  void socketError();
83  void socketActivity();
84 
85  void startSocketTimer();
86  void stopSocketTimer();
87  void restartSocketTimer();
88 
89  Session *const q;
90 
91  bool isSocketConnected;
92  Session::State state;
93 
94  SessionLogger *logger;
95  SessionThread *thread;
96  SessionUiProxy::Ptr uiProxy;
97 
98  bool jobRunning;
99  Job *currentJob;
100  QQueue<Job*> queue;
101 
102  QByteArray authTag;
103  QByteArray selectTag;
104  QByteArray closeTag;
105 
106  QString userName;
107  QByteArray greeting;
108  QByteArray currentMailBox;
109  QByteArray upcomingMailBox;
110  quint16 tagCount;
111 
112  KTcpSocket::SslVersion sslVersion;
113 
114  int socketTimerInterval;
115  QTimer socketTimer;
116 };
117 
118 }
119 
120 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:25:17 by doxygen 1.8.3.1 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.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • 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