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

KIMAP Library

  • kimap
sessionthread_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_SESSIONTHREAD_P_H
21 #define KIMAP_SESSIONTHREAD_P_H
22 
23 #include <QtCore/QMutex>
24 #include <QtCore/QQueue>
25 #include <QtCore/QThread>
26 
27 #include <ktcpsocket.h>
28 
29 typedef KTcpSocket SessionSocket;
30 
31 namespace KIMAP {
32 
33 class ImapStreamParser;
34 struct Message;
35 class Session;
36 
37 class SessionThread : public QThread
38 {
39  Q_OBJECT
40 
41  public:
42  explicit SessionThread( const QString &hostName, quint16 port, Session *parent );
43  ~SessionThread();
44 
45  inline QString hostName() { return m_hostName; }
46  inline quint16 port() { return m_port; }
47 
48  void sendData( const QByteArray &payload );
49  void run();
50 
51  public slots:
52  void closeSocket();
53  void reconnect();
54  void startSsl(const KTcpSocket::SslVersion &version);
55 
56  signals:
57  void responseReceived(const KIMAP::Message &response);
58  void encryptionNegotiationResult(bool, KTcpSocket::SslVersion);
59  void sslError(const KSslErrorUiData&);
60 
61  private slots:
62  void readMessage();
63  void writeDataQueue();
64  void sslConnected();
65  void sslErrorHandlerResponse(bool result);
66  void doCloseSocket();
67  void socketError();
68  void socketDisconnected();
69 
70  private:
71  QString m_hostName;
72  quint16 m_port;
73 
74  Session *m_session;
75  SessionSocket *m_socket;
76  ImapStreamParser *m_stream;
77 
78  QQueue<QByteArray> m_dataQueue;
79 
80  QMutex m_mutex;
81 
82  bool m_encryptedMode;
83  KTcpSocket::SslVersions triedSslVersions;
84  bool doSslFallback;
85  bool m_alreadyHandlingErrors;
86 };
87 
88 }
89 
90 #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