| 1 | /* |
| 2 | * Copyright (C) 2013 Canonical Ltd. |
| 3 | * |
| 4 | * Contact: Alberto Mardegan <[email protected]> |
| 5 | * |
| 6 | * This file is part of OnlineAccountsClient. |
| 7 | * |
| 8 | * OnlineAccountsClient is free software: you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU Lesser General Public License as |
| 10 | * published by the Free Software Foundation, either version 3 of the |
| 11 | * License, or (at your option) any later version. |
| 12 | * |
| 13 | * OnlineAccountsClient is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU Lesser General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU Lesser General Public License |
| 19 | * along with OnlineAccountsClient. If not, see |
| 20 | * <http://www.gnu.org/licenses/>. |
| 21 | */ |
| 22 | |
| 23 | #ifndef ONLINE_ACCOUNTS_CLIENT_SETUP_H |
| 24 | #define ONLINE_ACCOUNTS_CLIENT_SETUP_H |
| 25 | |
| 26 | #include "global.h" |
| 27 | #include <QObject> |
| 28 | #include <QVariantMap> |
| 29 | #include <sys/types.h> |
| 30 | #include <unistd.h> |
| 31 | |
| 32 | namespace OnlineAccountsClient { |
| 33 | |
| 34 | class SetupPrivate; |
| 35 | class OAC_EXPORT Setup: public QObject |
| 36 | { |
| 37 | Q_OBJECT |
| 38 | Q_PROPERTY(QString applicationId READ applicationId \ |
| 39 | WRITE setApplicationId NOTIFY applicationIdChanged) |
| 40 | Q_PROPERTY(QString serviceId READ serviceId \ |
| 41 | WRITE setServiceId NOTIFY serviceIdChanged REVISION 2) |
| 42 | Q_PROPERTY(QString serviceTypeId READ serviceTypeId \ |
| 43 | WRITE setServiceTypeId NOTIFY serviceTypeIdChanged) |
| 44 | Q_PROPERTY(QString providerId READ providerId \ |
| 45 | WRITE setProviderId NOTIFY providerIdChanged) |
| 46 | |
| 47 | public: |
| 48 | Setup(QObject *parent = 0); |
| 49 | ~Setup(); |
| 50 | |
| 51 | void setApplicationId(const QString &applicationId); |
| 52 | QString applicationId() const; |
| 53 | |
| 54 | void setServiceId(const QString &serviceId); |
| 55 | QString serviceId() const; |
| 56 | |
| 57 | void setServiceTypeId(const QString &serviceTypeId); |
| 58 | QString serviceTypeId() const; |
| 59 | |
| 60 | void setProviderId(const QString &providerId); |
| 61 | QString providerId() const; |
| 62 | |
| 63 | // Intentionally not exposed to QML; see the source code for the reason |
| 64 | void setClientPid(pid_t clientPid); |
| 65 | |
| 66 | Q_INVOKABLE void exec(); |
| 67 | |
| 68 | Q_SIGNALS: |
| 69 | void applicationIdChanged(); |
| 70 | Q_REVISION(2) void serviceIdChanged(); |
| 71 | void serviceTypeIdChanged(); |
| 72 | void providerIdChanged(); |
| 73 | void finished(QVariantMap reply); |
| 74 | |
| 75 | private: |
| 76 | SetupPrivate *d_ptr; |
| 77 | Q_DECLARE_PRIVATE(Setup) |
| 78 | }; |
| 79 | |
| 80 | }; // namespace |
| 81 | |
| 82 | #endif // ONLINE_ACCOUNTS_CLIENT_SETUP_H |