| 1 | /* |
| 2 | * This file is part of OnlineAccountsDaemon |
| 3 | * |
| 4 | * Copyright (C) 2015 Canonical Ltd. |
| 5 | * |
| 6 | * Contact: Alberto Mardegan <[email protected]> |
| 7 | * |
| 8 | * This program is free software: you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU Lesser General Public License version 3, as |
| 10 | * published 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 Lesser General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Lesser General Public License |
| 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #ifndef ONLINE_ACCOUNTS_DAEMON_ACCESS_REQUEST_H |
| 22 | #define ONLINE_ACCOUNTS_DAEMON_ACCESS_REQUEST_H |
| 23 | |
| 24 | #include <QObject> |
| 25 | #include <QString> |
| 26 | #include <QVariantMap> |
| 27 | #include <sys/types.h> |
| 28 | #include "async_operation.h" |
| 29 | |
| 30 | namespace Accounts { |
| 31 | class AuthData; |
| 32 | } |
| 33 | |
| 34 | namespace OnlineAccountsDaemon { |
| 35 | |
| 36 | class AccountInfo; |
| 37 | |
| 38 | class AccessRequestPrivate; |
| 39 | class AccessRequest: public AsyncOperation |
| 40 | { |
| 41 | Q_OBJECT |
| 42 | |
| 43 | public: |
| 44 | explicit AccessRequest(const CallContext &context, |
| 45 | QObject *parent = 0); |
| 46 | ~AccessRequest(); |
| 47 | |
| 48 | void requestAccess(const QString &applicationId, |
| 49 | const QString &serviceId, |
| 50 | const QVariantMap ¶meters, |
| 51 | pid_t clientPid); |
| 52 | |
| 53 | void setAccountInfo(const AccountInfo &accountInfo, |
| 54 | const Accounts::AuthData &authData); |
| 55 | |
| 56 | Q_SIGNALS: |
| 57 | void loadRequest(uint accountId, const QString &serviceId); |
| 58 | |
| 59 | private: |
| 60 | Q_DECLARE_PRIVATE(AccessRequest) |
| 61 | AccessRequestPrivate *d_ptr; |
| 62 | }; |
| 63 | |
| 64 | } // namespace |
| 65 | |
| 66 | #endif // ONLINE_ACCOUNTS_DAEMON_ACCESS_REQUEST_H |