| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
#ifndef MAILSERVICEADAPTOR_H |
| 13 |
#define MAILSERVICEADAPTOR_H |
| 14 |
|
| 15 |
#include <QtCore/QObject> |
| 16 |
#include <QtDBus/QtDBus> |
| 17 |
QT_BEGIN_NAMESPACE |
| 18 |
class QByteArray; |
| 19 |
template<class T> class QList; |
| 20 |
template<class Key, class Value> class QMap; |
| 21 |
class QString; |
| 22 |
class QStringList; |
| 23 |
class QVariant; |
| 24 |
QT_END_NAMESPACE |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
class MailServiceAdaptor: public QDBusAbstractAdaptor |
| 30 |
{ |
| 31 |
Q_OBJECT |
| 32 |
Q_CLASSINFO("D-Bus Interface", "org.dekkoproject.MailService") |
| 33 |
Q_CLASSINFO("D-Bus Introspection", "" |
| 34 |
" <interface name=\"org.dekkoproject.MailService\">\n" |
| 35 |
" <property access=\"read\" type=\"b\" name=\"hasUndoableAction\"/>\n" |
| 36 |
" <property access=\"read\" type=\"s\" name=\"undoDescription\"/>\n" |
| 37 |
" <signal name=\"undoCountChanged\"/>\n" |
| 38 |
" <signal name=\"updatesRolledBack\"/>\n" |
| 39 |
" <signal name=\"queueChanged\"/>\n" |
| 40 |
" <signal name=\"messageRestored\">\n" |
| 41 |
" <arg direction=\"out\" type=\"t\" name=\"msgId\"/>\n" |
| 42 |
" </signal>\n" |
| 43 |
" <signal name=\"messagePartNowAvailable\">\n" |
| 44 |
" <arg direction=\"out\" type=\"t\" name=\"msgId\"/>\n" |
| 45 |
" <arg direction=\"out\" type=\"s\" name=\"partLocation\"/>\n" |
| 46 |
" </signal>\n" |
| 47 |
" <signal name=\"messagePartFetchFailed\">\n" |
| 48 |
" <arg direction=\"out\" type=\"t\" name=\"msgId\"/>\n" |
| 49 |
" <arg direction=\"out\" type=\"s\" name=\"partLocation\"/>\n" |
| 50 |
" </signal>\n" |
| 51 |
" <signal name=\"messagesNowAvailable\">\n" |
| 52 |
" <arg direction=\"out\" type=\"(iiii)\" name=\"msgIds\"/>\n" |
| 53 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 54 |
" </signal>\n" |
| 55 |
" <signal name=\"messageFetchFailed\">\n" |
| 56 |
" <arg direction=\"out\" type=\"(iiii)\" name=\"msgIds\"/>\n" |
| 57 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 58 |
" </signal>\n" |
| 59 |
" <signal name=\"messagesSent\">\n" |
| 60 |
" <arg direction=\"out\" type=\"(iiii)\" name=\"msgIds\"/>\n" |
| 61 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 62 |
" </signal>\n" |
| 63 |
" <signal name=\"messageSendingFailed\">\n" |
| 64 |
" <arg direction=\"out\" type=\"(iiii)\" name=\"msgIds\"/>\n" |
| 65 |
" <arg direction=\"out\" type=\"i\" name=\"error\"/>\n" |
| 66 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 67 |
" </signal>\n" |
| 68 |
" <signal name=\"accountSynced\">\n" |
| 69 |
" <arg direction=\"out\" type=\"t\" name=\"id\"/>\n" |
| 70 |
" </signal>\n" |
| 71 |
" <signal name=\"foldersSynced\">\n" |
| 72 |
" <arg direction=\"out\" type=\"t\" name=\"accountId\"/>\n" |
| 73 |
" <arg direction=\"out\" type=\"(iiii)\" name=\"folderIds\"/>\n" |
| 74 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In1\"/>\n" |
| 75 |
" </signal>\n" |
| 76 |
" <signal name=\"foldersSyncFailed\">\n" |
| 77 |
" <arg direction=\"out\" type=\"t\" name=\"accountId\"/>\n" |
| 78 |
" <arg direction=\"out\" type=\"(iiii)\" name=\"folderIds\"/>\n" |
| 79 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In1\"/>\n" |
| 80 |
" </signal>\n" |
| 81 |
" <signal name=\"syncAccountFailed\">\n" |
| 82 |
" <arg direction=\"out\" type=\"t\" name=\"id\"/>\n" |
| 83 |
" </signal>\n" |
| 84 |
" <signal name=\"clientError\">\n" |
| 85 |
" <arg direction=\"out\" type=\"t\" name=\"accountId\"/>\n" |
| 86 |
" <arg direction=\"out\" type=\"i\" name=\"error\"/>\n" |
| 87 |
" <arg direction=\"out\" type=\"s\" name=\"errorString\"/>\n" |
| 88 |
" </signal>\n" |
| 89 |
" <signal name=\"standardFoldersCreated\">\n" |
| 90 |
" <arg direction=\"out\" type=\"t\" name=\"accountId\"/>\n" |
| 91 |
" <arg direction=\"out\" type=\"b\" name=\"created\"/>\n" |
| 92 |
" </signal>\n" |
| 93 |
" <signal name=\"actionFailed\">\n" |
| 94 |
" <arg direction=\"out\" type=\"t\" name=\"id\"/>\n" |
| 95 |
" <arg direction=\"out\" type=\"i\" name=\"statusCode\"/>\n" |
| 96 |
" <arg direction=\"out\" type=\"s\" name=\"statusText\"/>\n" |
| 97 |
" </signal>\n" |
| 98 |
" <method name=\"restoreMessage\">\n" |
| 99 |
" <arg direction=\"in\" type=\"t\" name=\"id\"/>\n" |
| 100 |
" </method>\n" |
| 101 |
" <method name=\"deleteMessages\">\n" |
| 102 |
" <arg direction=\"in\" type=\"(iiii)\" name=\"ids\"/>\n" |
| 103 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 104 |
" </method>\n" |
| 105 |
" <method name=\"markMessagesImportant\">\n" |
| 106 |
" <arg direction=\"in\" type=\"(iiii)\" name=\"msgIds\"/>\n" |
| 107 |
" <arg direction=\"in\" type=\"b\" name=\"important\"/>\n" |
| 108 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 109 |
" </method>\n" |
| 110 |
" <method name=\"markMessagesRead\">\n" |
| 111 |
" <arg direction=\"in\" type=\"(iiii)\" name=\"msgIds\"/>\n" |
| 112 |
" <arg direction=\"in\" type=\"b\" name=\"read\"/>\n" |
| 113 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 114 |
" </method>\n" |
| 115 |
" <method name=\"markMessagesTodo\">\n" |
| 116 |
" <arg direction=\"in\" type=\"(iiii)\" name=\"msgIds\"/>\n" |
| 117 |
" <arg direction=\"in\" type=\"b\" name=\"read\"/>\n" |
| 118 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 119 |
" </method>\n" |
| 120 |
" <method name=\"markMessagesDone\">\n" |
| 121 |
" <arg direction=\"in\" type=\"(iiii)\" name=\"msgIds\"/>\n" |
| 122 |
" <arg direction=\"in\" type=\"b\" name=\"done\"/>\n" |
| 123 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 124 |
" </method>\n" |
| 125 |
" <method name=\"markMessagesReplied\">\n" |
| 126 |
" <arg direction=\"in\" type=\"(iiii)\" name=\"msgIds\"/>\n" |
| 127 |
" <arg direction=\"in\" type=\"b\" name=\"all\"/>\n" |
| 128 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 129 |
" </method>\n" |
| 130 |
" <method name=\"markMessageForwarded\">\n" |
| 131 |
" <arg direction=\"in\" type=\"(iiii)\" name=\"msgIds\"/>\n" |
| 132 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 133 |
" </method>\n" |
| 134 |
" <method name=\"syncFolders\">\n" |
| 135 |
" <arg direction=\"in\" type=\"t\" name=\"accountId\"/>\n" |
| 136 |
" <arg direction=\"in\" type=\"(iiii)\" name=\"folders\"/>\n" |
| 137 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In1\"/>\n" |
| 138 |
" </method>\n" |
| 139 |
" <method name=\"createStandardFolders\">\n" |
| 140 |
" <arg direction=\"in\" type=\"t\" name=\"accountId\"/>\n" |
| 141 |
" </method>\n" |
| 142 |
" <method name=\"moveToFolder\">\n" |
| 143 |
" <arg direction=\"in\" type=\"(iiii)\" name=\"msgIds\"/>\n" |
| 144 |
" <arg direction=\"in\" type=\"t\" name=\"folderId\"/>\n" |
| 145 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 146 |
" </method>\n" |
| 147 |
" <method name=\"moveToStandardFolder\">\n" |
| 148 |
" <arg direction=\"in\" type=\"(iiii)\" name=\"msgIds\"/>\n" |
| 149 |
" <arg direction=\"in\" type=\"i\" name=\"folderType\"/>\n" |
| 150 |
" <arg direction=\"in\" type=\"b\" name=\"userTriggered\"/>\n" |
| 151 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 152 |
" </method>\n" |
| 153 |
" <method name=\"markFolderRead\">\n" |
| 154 |
" <arg direction=\"in\" type=\"t\" name=\"folderId\"/>\n" |
| 155 |
" </method>\n" |
| 156 |
" <method name=\"downloadMessagePart\">\n" |
| 157 |
" <arg direction=\"in\" type=\"t\" name=\"msgId\"/>\n" |
| 158 |
" <arg direction=\"in\" type=\"s\" name=\"partLocation\"/>\n" |
| 159 |
" </method>\n" |
| 160 |
" <method name=\"downloadMessages\">\n" |
| 161 |
" <arg direction=\"in\" type=\"(iiii)\" name=\"msgIds\"/>\n" |
| 162 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 163 |
" </method>\n" |
| 164 |
" <method name=\"sendMessage\">\n" |
| 165 |
" <arg direction=\"in\" type=\"t\" name=\"msgId\"/>\n" |
| 166 |
" </method>\n" |
| 167 |
" <method name=\"sendPendingMessages\"/>\n" |
| 168 |
" <method name=\"synchronizeAccount\">\n" |
| 169 |
" <arg direction=\"in\" type=\"t\" name=\"accountId\"/>\n" |
| 170 |
" </method>\n" |
| 171 |
" <method name=\"undoActions\"/>\n" |
| 172 |
" <method name=\"sendAnyQueuedMail\"/>\n" |
| 173 |
" <method name=\"emptyTrash\">\n" |
| 174 |
" <arg direction=\"in\" type=\"(iiii)\" name=\"accountIds\"/>\n" |
| 175 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 176 |
" </method>\n" |
| 177 |
" <method name=\"removeMessage\">\n" |
| 178 |
" <arg direction=\"in\" type=\"t\" name=\"msgId\"/>\n" |
| 179 |
" <arg direction=\"in\" type=\"i\" name=\"option\"/>\n" |
| 180 |
" </method>\n" |
| 181 |
" <method name=\"queryMessages\">\n" |
| 182 |
" <arg direction=\"in\" type=\"ay\" name=\"msgKey\"/>\n" |
| 183 |
" <arg direction=\"in\" type=\"ay\" name=\"sortKey\"/>\n" |
| 184 |
" <arg direction=\"in\" type=\"i\" name=\"limit\"/>\n" |
| 185 |
" <arg direction=\"out\" type=\"(iiii)\" name=\"messages\"/>\n" |
| 186 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n" |
| 187 |
" </method>\n" |
| 188 |
" <method name=\"queryFolders\">\n" |
| 189 |
" <arg direction=\"in\" type=\"ay\" name=\"folderKey\"/>\n" |
| 190 |
" <arg direction=\"in\" type=\"ay\" name=\"sortKey\"/>\n" |
| 191 |
" <arg direction=\"in\" type=\"i\" name=\"limit\"/>\n" |
| 192 |
" <arg direction=\"out\" type=\"(iiii)\" name=\"folders\"/>\n" |
| 193 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n" |
| 194 |
" </method>\n" |
| 195 |
" <method name=\"totalCount\">\n" |
| 196 |
" <arg direction=\"in\" type=\"ay\" name=\"msgKey\"/>\n" |
| 197 |
" <arg direction=\"out\" type=\"i\" name=\"count\"/>\n" |
| 198 |
" </method>\n" |
| 199 |
" <method name=\"pruneCache\">\n" |
| 200 |
" <arg direction=\"in\" type=\"(iiii)\" name=\"msgIds\"/>\n" |
| 201 |
" <annotation value=\"QList<quint64>\" name=\"org.qtproject.QtDBus.QtTypeName.In0\"/>\n" |
| 202 |
" </method>\n" |
| 203 |
" </interface>\n" |
| 204 |
"") |
| 205 |
public: |
| 206 |
MailServiceAdaptor(QObject *parent); |
| 207 |
virtual ~MailServiceAdaptor(); |
| 208 |
|
| 209 |
public: |
| 210 |
Q_PROPERTY(bool hasUndoableAction READ hasUndoableAction) |
| 211 |
bool hasUndoableAction() const; |
| 212 |
|
| 213 |
Q_PROPERTY(QString undoDescription READ undoDescription) |
| 214 |
QString undoDescription() const; |
| 215 |
|
| 216 |
public Q_SLOTS: |
| 217 |
void createStandardFolders(qulonglong accountId); |
| 218 |
void deleteMessages(const QList<quint64> &ids); |
| 219 |
void downloadMessagePart(qulonglong msgId, const QString &partLocation); |
| 220 |
void downloadMessages(const QList<quint64> &msgIds); |
| 221 |
void emptyTrash(const QList<quint64> &accountIds); |
| 222 |
void markFolderRead(qulonglong folderId); |
| 223 |
void markMessageForwarded(const QList<quint64> &msgIds); |
| 224 |
void markMessagesDone(const QList<quint64> &msgIds, bool done); |
| 225 |
void markMessagesImportant(const QList<quint64> &msgIds, bool important); |
| 226 |
void markMessagesRead(const QList<quint64> &msgIds, bool read); |
| 227 |
void markMessagesReplied(const QList<quint64> &msgIds, bool all); |
| 228 |
void markMessagesTodo(const QList<quint64> &msgIds, bool read); |
| 229 |
void moveToFolder(const QList<quint64> &msgIds, qulonglong folderId); |
| 230 |
void moveToStandardFolder(const QList<quint64> &msgIds, int folderType, bool userTriggered); |
| 231 |
void pruneCache(const QList<quint64> &msgIds); |
| 232 |
QList<quint64> queryFolders(const QByteArray &folderKey, const QByteArray &sortKey, int limit); |
| 233 |
QList<quint64> queryMessages(const QByteArray &msgKey, const QByteArray &sortKey, int limit); |
| 234 |
void removeMessage(qulonglong msgId, int option); |
| 235 |
void restoreMessage(qulonglong id); |
| 236 |
void sendAnyQueuedMail(); |
| 237 |
void sendMessage(qulonglong msgId); |
| 238 |
void sendPendingMessages(); |
| 239 |
void syncFolders(qulonglong accountId, const QList<quint64> &folders); |
| 240 |
void synchronizeAccount(qulonglong accountId); |
| 241 |
int totalCount(const QByteArray &msgKey); |
| 242 |
void undoActions(); |
| 243 |
Q_SIGNALS: |
| 244 |
void accountSynced(qulonglong id); |
| 245 |
void actionFailed(qulonglong id, int statusCode, const QString &statusText); |
| 246 |
void clientError(qulonglong accountId, int error, const QString &errorString); |
| 247 |
void messageFetchFailed(const QList<quint64> &msgIds); |
| 248 |
void messagePartFetchFailed(qulonglong msgId, const QString &partLocation); |
| 249 |
void messagePartNowAvailable(qulonglong msgId, const QString &partLocation); |
| 250 |
void messageRestored(qulonglong msgId); |
| 251 |
void messageSendingFailed(const QList<quint64> &msgIds, int error); |
| 252 |
void messagesNowAvailable(const QList<quint64> &msgIds); |
| 253 |
void messagesSent(const QList<quint64> &msgIds); |
| 254 |
void queueChanged(); |
| 255 |
void standardFoldersCreated(qulonglong accountId, bool created); |
| 256 |
void syncAccountFailed(qulonglong id); |
| 257 |
void undoCountChanged(); |
| 258 |
void updatesRolledBack(); |
| 259 |
void foldersSynced(const qulonglong accountId, const QList<quint64> &folderIds); |
| 260 |
void foldersSyncFailed(const qulonglong accountId, const QList<quint64> &folderIds); |
| 261 |
}; |
| 262 |
|
| 263 |
#endif |