diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-21 20:39:11 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-09-15 16:14:19 +0200 |
commit | 07d9eaaa97dfa63bb3ff9767c6b2e152ad8a04e0 (patch) | |
tree | ea8d32e3a213ec9562ceccb66fb24ca6b37621df /examples/imapresource/imapserverproxy.h | |
parent | 5f127fa687079c7180142e371c86bd6dacfb845e (diff) | |
download | sink-07d9eaaa97dfa63bb3ff9767c6b2e152ad8a04e0.tar.gz sink-07d9eaaa97dfa63bb3ff9767c6b2e152ad8a04e0.zip |
Prepare incremental syncing.
Diffstat (limited to 'examples/imapresource/imapserverproxy.h')
-rw-r--r-- | examples/imapresource/imapserverproxy.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/examples/imapresource/imapserverproxy.h b/examples/imapresource/imapserverproxy.h index f3e1794..9baa52c 100644 --- a/examples/imapresource/imapserverproxy.h +++ b/examples/imapresource/imapserverproxy.h | |||
@@ -75,6 +75,12 @@ struct Folder { | |||
75 | bool noselect; | 75 | bool noselect; |
76 | }; | 76 | }; |
77 | 77 | ||
78 | struct SelectResult { | ||
79 | qint64 uidValidity; | ||
80 | qint64 uidNext; | ||
81 | quint64 highestModSequence; | ||
82 | }; | ||
83 | |||
78 | class ImapServerProxy { | 84 | class ImapServerProxy { |
79 | KIMAP::Session *mSession; | 85 | KIMAP::Session *mSession; |
80 | QStringList mCapabilities; | 86 | QStringList mCapabilities; |
@@ -91,7 +97,7 @@ public: | |||
91 | 97 | ||
92 | //Standard IMAP calls | 98 | //Standard IMAP calls |
93 | KAsync::Job<void> login(const QString &username, const QString &password); | 99 | KAsync::Job<void> login(const QString &username, const QString &password); |
94 | KAsync::Job<void> select(const QString &mailbox); | 100 | KAsync::Job<SelectResult> select(const QString &mailbox); |
95 | KAsync::Job<qint64> append(const QString &mailbox, const QByteArray &content, const QList<QByteArray> &flags = QList<QByteArray>(), const QDateTime &internalDate = QDateTime()); | 101 | KAsync::Job<qint64> append(const QString &mailbox, const QByteArray &content, const QList<QByteArray> &flags = QList<QByteArray>(), const QDateTime &internalDate = QDateTime()); |
96 | KAsync::Job<void> store(const KIMAP::ImapSet &set, const QList<QByteArray> &flags); | 102 | KAsync::Job<void> store(const KIMAP::ImapSet &set, const QList<QByteArray> &flags); |
97 | KAsync::Job<void> storeFlags(const KIMAP::ImapSet &set, const QList<QByteArray> &flags); | 103 | KAsync::Job<void> storeFlags(const KIMAP::ImapSet &set, const QList<QByteArray> &flags); |
@@ -103,6 +109,7 @@ public: | |||
103 | KAsync::Job<void> expunge(); | 109 | KAsync::Job<void> expunge(); |
104 | KAsync::Job<void> expunge(const KIMAP::ImapSet &set); | 110 | KAsync::Job<void> expunge(const KIMAP::ImapSet &set); |
105 | KAsync::Job<void> copy(const KIMAP::ImapSet &set, const QString &newMailbox); | 111 | KAsync::Job<void> copy(const KIMAP::ImapSet &set, const QString &newMailbox); |
112 | KAsync::Job<QVector<qint64>> search(const KIMAP::ImapSet &set); | ||
106 | 113 | ||
107 | typedef std::function<void(const QString &, | 114 | typedef std::function<void(const QString &, |
108 | const QMap<qint64,qint64> &, | 115 | const QMap<qint64,qint64> &, |
@@ -115,6 +122,8 @@ public: | |||
115 | KAsync::Job<void> fetch(const KIMAP::ImapSet &set, KIMAP::FetchJob::FetchScope scope, const std::function<void(const QVector<Message> &)> &callback); | 122 | KAsync::Job<void> fetch(const KIMAP::ImapSet &set, KIMAP::FetchJob::FetchScope scope, const std::function<void(const QVector<Message> &)> &callback); |
116 | KAsync::Job<void> list(KIMAP::ListJob::Option option, const std::function<void(const QList<KIMAP::MailBoxDescriptor> &mailboxes,const QList<QList<QByteArray> > &flags)> &callback); | 123 | KAsync::Job<void> list(KIMAP::ListJob::Option option, const std::function<void(const QList<KIMAP::MailBoxDescriptor> &mailboxes,const QList<QList<QByteArray> > &flags)> &callback); |
117 | 124 | ||
125 | QStringList getCapabilities() const; | ||
126 | |||
118 | //Composed calls that do login etc. | 127 | //Composed calls that do login etc. |
119 | KAsync::Job<QList<qint64>> fetchHeaders(const QString &mailbox); | 128 | KAsync::Job<QList<qint64>> fetchHeaders(const QString &mailbox); |
120 | KAsync::Job<void> remove(const QString &mailbox, const KIMAP::ImapSet &set); | 129 | KAsync::Job<void> remove(const QString &mailbox, const KIMAP::ImapSet &set); |
@@ -122,11 +131,14 @@ public: | |||
122 | KAsync::Job<void> move(const QString &mailbox, const KIMAP::ImapSet &set, const QString &newMailbox); | 131 | KAsync::Job<void> move(const QString &mailbox, const KIMAP::ImapSet &set, const QString &newMailbox); |
123 | KAsync::Job<QString> createSubfolder(const QString &parentMailbox, const QString &folderName); | 132 | KAsync::Job<QString> createSubfolder(const QString &parentMailbox, const QString &folderName); |
124 | KAsync::Job<QString> renameSubfolder(const QString &mailbox, const QString &newName); | 133 | KAsync::Job<QString> renameSubfolder(const QString &mailbox, const QString &newName); |
134 | KAsync::Job<QVector<qint64>> fetchUids(const QString &mailbox); | ||
125 | 135 | ||
126 | QString mailboxFromFolder(const Folder &) const; | 136 | QString mailboxFromFolder(const Folder &) const; |
127 | 137 | ||
128 | KAsync::Job<void> fetchFolders(std::function<void(const QVector<Folder> &)> callback); | 138 | KAsync::Job<void> fetchFolders(std::function<void(const QVector<Folder> &)> callback); |
129 | KAsync::Job<void> fetchMessages(const Folder &folder, std::function<void(const QVector<Message> &)> callback, std::function<void(int, int)> progress = std::function<void(int, int)>()); | 139 | KAsync::Job<void> fetchMessages(const Folder &folder, std::function<void(const QVector<Message> &)> callback, std::function<void(int, int)> progress = std::function<void(int, int)>()); |
140 | KAsync::Job<void> fetchMessages(const Folder &folder, qint64 uidNext, std::function<void(const QVector<Message> &)> callback, std::function<void(int, int)> progress = std::function<void(int, int)>()); | ||
141 | KAsync::Job<QVector<qint64>> fetchUids(const Folder &folder); | ||
130 | 142 | ||
131 | private: | 143 | private: |
132 | KAsync::Job<void> ping(); | 144 | KAsync::Job<void> ping(); |