diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-09-14 16:16:42 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-09-15 16:14:19 +0200 |
commit | 6d5be4fb7b8cbc450e2780905eaac9a18b486c5c (patch) | |
tree | 3e0f42e15889c271a41f4d6225a44b21c066b16a /examples/imapresource/imapserverproxy.h | |
parent | ca9c54670cc2d26386c80a2aeed2c999313ec362 (diff) | |
download | sink-6d5be4fb7b8cbc450e2780905eaac9a18b486c5c.tar.gz sink-6d5be4fb7b8cbc450e2780905eaac9a18b486c5c.zip |
New synchronization algorithm that only fetches the last 14 days.
Diffstat (limited to 'examples/imapresource/imapserverproxy.h')
-rw-r--r-- | examples/imapresource/imapserverproxy.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/examples/imapresource/imapserverproxy.h b/examples/imapresource/imapserverproxy.h index 452b479..8b39f23 100644 --- a/examples/imapresource/imapserverproxy.h +++ b/examples/imapresource/imapserverproxy.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <KIMAP2/ListJob> | 25 | #include <KIMAP2/ListJob> |
26 | #include <KIMAP2/Session> | 26 | #include <KIMAP2/Session> |
27 | #include <KIMAP2/FetchJob> | 27 | #include <KIMAP2/FetchJob> |
28 | #include <KIMAP2/SearchJob> | ||
28 | 29 | ||
29 | namespace Imap { | 30 | namespace Imap { |
30 | 31 | ||
@@ -110,30 +111,33 @@ public: | |||
110 | KAsync::Job<void> expunge(const KIMAP2::ImapSet &set); | 111 | KAsync::Job<void> expunge(const KIMAP2::ImapSet &set); |
111 | KAsync::Job<void> copy(const KIMAP2::ImapSet &set, const QString &newMailbox); | 112 | KAsync::Job<void> copy(const KIMAP2::ImapSet &set, const QString &newMailbox); |
112 | KAsync::Job<QVector<qint64>> search(const KIMAP2::ImapSet &set); | 113 | KAsync::Job<QVector<qint64>> search(const KIMAP2::ImapSet &set); |
114 | KAsync::Job<QVector<qint64>> search(const KIMAP2::Term &term); | ||
113 | 115 | ||
114 | typedef std::function<void(const KIMAP2::FetchJob::Result &)> FetchCallback; | 116 | typedef std::function<void(const KIMAP2::FetchJob::Result &)> FetchCallback; |
115 | 117 | ||
116 | KAsync::Job<void> fetch(const KIMAP2::ImapSet &set, KIMAP2::FetchJob::FetchScope scope, FetchCallback callback); | 118 | KAsync::Job<void> fetch(const KIMAP2::ImapSet &set, KIMAP2::FetchJob::FetchScope scope, FetchCallback callback); |
117 | KAsync::Job<void> fetch(const KIMAP2::ImapSet &set, KIMAP2::FetchJob::FetchScope scope, const std::function<void(const QVector<Message> &)> &callback); | 119 | KAsync::Job<void> fetch(const KIMAP2::ImapSet &set, KIMAP2::FetchJob::FetchScope scope, const std::function<void(const Message &)> &callback); |
118 | KAsync::Job<void> list(KIMAP2::ListJob::Option option, const std::function<void(const KIMAP2::MailBoxDescriptor &mailboxes,const QList<QByteArray> &flags)> &callback); | 120 | KAsync::Job<void> list(KIMAP2::ListJob::Option option, const std::function<void(const KIMAP2::MailBoxDescriptor &mailboxes,const QList<QByteArray> &flags)> &callback); |
119 | 121 | ||
120 | QStringList getCapabilities() const; | 122 | QStringList getCapabilities() const; |
121 | 123 | ||
122 | //Composed calls that do login etc. | 124 | //Composed calls that do login etc. |
123 | KAsync::Job<QList<qint64>> fetchHeaders(const QString &mailbox, qint64 minUid = 1); | 125 | KAsync::Job<QVector<qint64>> fetchHeaders(const QString &mailbox, qint64 minUid = 1); |
124 | KAsync::Job<void> remove(const QString &mailbox, const KIMAP2::ImapSet &set); | 126 | KAsync::Job<void> remove(const QString &mailbox, const KIMAP2::ImapSet &set); |
125 | KAsync::Job<void> remove(const QString &mailbox, const QByteArray &imapSet); | 127 | KAsync::Job<void> remove(const QString &mailbox, const QByteArray &imapSet); |
126 | KAsync::Job<void> move(const QString &mailbox, const KIMAP2::ImapSet &set, const QString &newMailbox); | 128 | KAsync::Job<void> move(const QString &mailbox, const KIMAP2::ImapSet &set, const QString &newMailbox); |
127 | KAsync::Job<QString> createSubfolder(const QString &parentMailbox, const QString &folderName); | 129 | KAsync::Job<QString> createSubfolder(const QString &parentMailbox, const QString &folderName); |
128 | KAsync::Job<QString> renameSubfolder(const QString &mailbox, const QString &newName); | 130 | KAsync::Job<QString> renameSubfolder(const QString &mailbox, const QString &newName); |
129 | KAsync::Job<QVector<qint64>> fetchUids(const QString &mailbox); | 131 | KAsync::Job<QVector<qint64>> fetchUids(const QString &mailbox); |
132 | KAsync::Job<QVector<qint64>> fetchUidsSince(const QString &mailbox, const QDate &since); | ||
130 | 133 | ||
131 | QString mailboxFromFolder(const Folder &) const; | 134 | QString mailboxFromFolder(const Folder &) const; |
132 | 135 | ||
133 | KAsync::Job<void> fetchFolders(std::function<void(const Folder &)> callback); | 136 | KAsync::Job<void> fetchFolders(std::function<void(const Folder &)> callback); |
134 | 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)>()); | 137 | KAsync::Job<void> fetchMessages(const Folder &folder, std::function<void(const Message &)> callback, std::function<void(int, int)> progress = std::function<void(int, int)>()); |
135 | 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)>()); | 138 | KAsync::Job<void> fetchMessages(const Folder &folder, qint64 uidNext, std::function<void(const Message &)> callback, std::function<void(int, int)> progress = std::function<void(int, int)>()); |
136 | KAsync::Job<SelectResult> fetchFlags(const Folder &folder, const KIMAP2::ImapSet &set, qint64 changedsince, std::function<void(const QVector<Message> &)> callback); | 139 | KAsync::Job<void> fetchMessages(const Folder &folder, const QVector<qint64> &uidsToFetch, std::function<void(const Message &)> callback, std::function<void(int, int)> progress); |
140 | KAsync::Job<SelectResult> fetchFlags(const Folder &folder, const KIMAP2::ImapSet &set, qint64 changedsince, std::function<void(const Message &)> callback); | ||
137 | KAsync::Job<QVector<qint64>> fetchUids(const Folder &folder); | 141 | KAsync::Job<QVector<qint64>> fetchUids(const Folder &folder); |
138 | 142 | ||
139 | private: | 143 | private: |