Diffstat (limited to 'noncore/unsupported/mail2/libmail/imapbase.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mail2/libmail/imapbase.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/noncore/unsupported/mail2/libmail/imapbase.h b/noncore/unsupported/mail2/libmail/imapbase.h new file mode 100644 index 0000000..e4a0b97 --- a/dev/null +++ b/noncore/unsupported/mail2/libmail/imapbase.h | |||
@@ -0,0 +1,52 @@ | |||
1 | #ifndef IMAPBASE_H | ||
2 | #define IMAPBASE_H | ||
3 | |||
4 | #include <qobject.h> | ||
5 | |||
6 | #include "configfile.h" | ||
7 | |||
8 | class QSocket; | ||
9 | |||
10 | class IMAPBase : public QObject | ||
11 | { | ||
12 | Q_OBJECT | ||
13 | |||
14 | public: | ||
15 | IMAPBase(const Account &account); | ||
16 | |||
17 | enum Error { IMAPErrConnectionRefused, IMAPErrHostNotFound, | ||
18 | IMAPErrSocketRead, IMAPErrUnknownError, | ||
19 | IMAPErrLoginFailed }; | ||
20 | |||
21 | void sendCommand(const QString &command); | ||
22 | void disconnect(); | ||
23 | |||
24 | signals: | ||
25 | void dataReceived(const QString &data); | ||
26 | void lookingUpHost(); | ||
27 | void hostFound(); | ||
28 | void connected(); | ||
29 | void disconnected(); | ||
30 | void error(int err); | ||
31 | |||
32 | protected: | ||
33 | void makeConnect(); | ||
34 | |||
35 | protected slots: | ||
36 | void writeCommands(); | ||
37 | void slotError(int error); | ||
38 | void slotHostFound(); | ||
39 | void slotConnected(); | ||
40 | void slotDisconnected(); | ||
41 | void slotDataAvailiable(); | ||
42 | |||
43 | private: | ||
44 | Account _account; | ||
45 | QString _data; | ||
46 | QSocket *_socket; | ||
47 | QStringList _commandQueue; | ||
48 | bool _connected, _writingAllowed; | ||
49 | |||
50 | }; | ||
51 | |||
52 | #endif | ||