| 1 | /* |
| 2 | * Copyright (C) 2013 Canonical Ltd. |
| 3 | * |
| 4 | * Contact: Alberto Mardegan <[email protected]> |
| 5 | * |
| 6 | * This file is part of lomiri-online-accounts-service |
| 7 | * |
| 8 | * This program is free software: you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public License version 3, as published |
| 10 | * by the Free Software Foundation. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranties of |
| 14 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
| 15 | * PURPOSE. See the GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License along |
| 18 | * with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #ifndef OAU_REQUEST_H |
| 22 | #define OAU_REQUEST_H |
| 23 | |
| 24 | #include <QDBusConnection> |
| 25 | #include <QDBusMessage> |
| 26 | #include <QObject> |
| 27 | #include <QVariantMap> |
| 28 | |
| 29 | namespace OnlineAccountsUi { |
| 30 | |
| 31 | class RequestPrivate; |
| 32 | class Request: public QObject |
| 33 | { |
| 34 | Q_OBJECT |
| 35 | |
| 36 | public: |
| 37 | explicit Request(const QDBusConnection &connection, |
| 38 | const QDBusMessage &message, |
| 39 | const QVariantMap ¶meters, |
| 40 | QObject *parent = 0); |
| 41 | ~Request(); |
| 42 | |
| 43 | static Request *find(const QVariantMap &match); |
| 44 | |
| 45 | quint64 windowId() const; |
| 46 | pid_t clientPid() const; |
| 47 | void setInProgress(bool inProgress); |
| 48 | bool isInProgress() const; |
| 49 | const QVariantMap ¶meters() const; |
| 50 | QString clientApparmorProfile() const; |
| 51 | QString interface() const; |
| 52 | QString providerId() const; |
| 53 | |
| 54 | void setDelay(int delay); |
| 55 | int delay() const; |
| 56 | |
| 57 | public Q_SLOTS: |
| 58 | void cancel(); |
| 59 | |
| 60 | Q_SIGNALS: |
| 61 | void completed(); |
| 62 | |
| 63 | public Q_SLOTS: |
| 64 | void fail(const QString &name, const QString &message); |
| 65 | void setCanceled(); |
| 66 | void setResult(const QVariantMap &result); |
| 67 | |
| 68 | private: |
| 69 | RequestPrivate *d_ptr; |
| 70 | Q_DECLARE_PRIVATE(Request) |
| 71 | }; |
| 72 | |
| 73 | } // namespace |
| 74 | |
| 75 | #endif // OAU_REQUEST_H |