| 1 | /* |
| 2 | * Copyright (C) 2014 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 MOCK_REQUEST_H |
| 22 | #define MOCK_REQUEST_H |
| 23 | |
| 24 | #include "request.h" |
| 25 | |
| 26 | #include <QObject> |
| 27 | #include <QString> |
| 28 | #include <QVariantMap> |
| 29 | |
| 30 | namespace OnlineAccountsUi { |
| 31 | |
| 32 | class RequestPrivate: public QObject |
| 33 | { |
| 34 | Q_OBJECT |
| 35 | Q_DECLARE_PUBLIC(Request) |
| 36 | |
| 37 | public: |
| 38 | RequestPrivate(const QDBusConnection &connection, |
| 39 | const QDBusMessage &message, |
| 40 | const QVariantMap ¶meters, |
| 41 | Request *request); |
| 42 | ~RequestPrivate(); |
| 43 | static RequestPrivate *mocked(Request *r) { return r->d_ptr; } |
| 44 | |
| 45 | void setClientApparmorProfile(const QString &profile); |
| 46 | void setProviderId(const QString &provider); |
| 47 | |
| 48 | Q_SIGNALS: |
| 49 | void cancelCalled(); |
| 50 | void failCalled(QString name, QString message); |
| 51 | void setResultCalled(QVariantMap result); |
| 52 | |
| 53 | private: |
| 54 | QDBusConnection m_connection; |
| 55 | QDBusMessage m_message; |
| 56 | QVariantMap m_parameters; |
| 57 | QString m_clientApparmorProfile; |
| 58 | QString m_providerId; |
| 59 | bool m_inProgress; |
| 60 | int m_delay; |
| 61 | mutable Request *q_ptr; |
| 62 | }; |
| 63 | |
| 64 | } // namespace |
| 65 | |
| 66 | #endif // MOCK_REQUEST_H |