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