KIMAP

session.h
1 /*
2  SPDX-FileCopyrightText: 2009 Kevin Ottens <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KIMAP_SESSION_H
8 #define KIMAP_SESSION_H
9 
10 #include "kimap_export.h"
11 
12 #include <QObject>
13 
14 #include "sessionuiproxy.h"
15 
16 namespace KIMAP
17 {
18 
19 class SessionPrivate;
20 class JobPrivate;
21 struct Response;
22 
23 class KIMAP_EXPORT Session : public QObject
24 {
25  Q_OBJECT
26 
27  friend class JobPrivate;
28 
29 public:
30  enum State { Disconnected = 0, NotAuthenticated, Authenticated, Selected };
31  Q_ENUM(State)
32  Session(const QString &hostName, quint16 port, QObject *parent = nullptr);
33  ~Session();
34 
35  Q_REQUIRED_RESULT QString hostName() const;
36  Q_REQUIRED_RESULT quint16 port() const;
37  Q_REQUIRED_RESULT State state() const;
38 
45  Q_REQUIRED_RESULT QString userName() const;
46 
47  Q_REQUIRED_RESULT QByteArray serverGreeting() const;
48 
53  void setUiProxy(const SessionUiProxy::Ptr &proxy);
54 
60  KIMAP_DEPRECATED void setUiProxy(SessionUiProxy *proxy);
61 
67  void setTimeout(int timeout);
68 
73  Q_REQUIRED_RESULT int timeout() const;
74 
79  Q_REQUIRED_RESULT QString selectedMailBox() const;
80 
91  void setUseNetworkProxy(bool useProxy);
92 
93  Q_REQUIRED_RESULT int jobQueueSize() const;
94 
95  void close();
96 
97 Q_SIGNALS:
98  void jobQueueSizeChanged(int queueSize);
99 
105  void connectionLost();
106 
118  void connectionFailed();
119 
130  void stateChanged(KIMAP::Session::State newState, KIMAP::Session::State oldState);
131 
132 private:
133  friend class SessionPrivate;
134  SessionPrivate *const d;
135 };
136 
137 }
138 
139 #endif
Definition: acl.cpp:12
State
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Oct 24 2020 23:16:51 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.