| 1 | /* |
| 2 | * Copyright (C) 2013 Canonical Ltd. |
| 3 | * |
| 4 | * Contact: Alberto Mardegan <[email protected]> |
| 5 | * |
| 6 | * This file is part of liblomiri-online-accounts-plugin |
| 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_APPLICATION_MANAGER_H |
| 22 | #define OAU_APPLICATION_MANAGER_H |
| 23 | |
| 24 | #include "global.h" |
| 25 | |
| 26 | #include <Accounts/Application> |
| 27 | #include <QObject> |
| 28 | #include <QStringList> |
| 29 | #include <QVariantMap> |
| 30 | |
| 31 | class ApplicationManagerTest; |
| 32 | |
| 33 | namespace OnlineAccountsUi { |
| 34 | |
| 35 | class ApplicationManagerPrivate; |
| 36 | class OAP_EXPORT ApplicationManager: public QObject |
| 37 | { |
| 38 | Q_OBJECT |
| 39 | |
| 40 | public: |
| 41 | static ApplicationManager *instance(); |
| 42 | |
| 43 | Q_INVOKABLE QVariantMap applicationInfo(const QString &applicationId, |
| 44 | const QString &profile); |
| 45 | QVariantMap providerInfo(const QString &providerId) const; |
| 46 | |
| 47 | Q_INVOKABLE QStringList usefulProviders() const; |
| 48 | |
| 49 | Q_INVOKABLE QStringList addApplicationToAcl(const QStringList &acl, |
| 50 | const QString &appId) const; |
| 51 | Q_INVOKABLE QStringList removeApplicationFromAcl(const QStringList &acl, |
| 52 | const QString &appId) const; |
| 53 | Accounts::Application applicationFromProfile(const QString &profile); |
| 54 | |
| 55 | protected: |
| 56 | explicit ApplicationManager(QObject *parent = 0); |
| 57 | ~ApplicationManager(); |
| 58 | |
| 59 | private: |
| 60 | static ApplicationManager *m_instance; |
| 61 | ApplicationManagerPrivate *d_ptr; |
| 62 | Q_DECLARE_PRIVATE(ApplicationManager) |
| 63 | friend class ::ApplicationManagerTest; |
| 64 | }; |
| 65 | |
| 66 | } // namespace |
| 67 | |
| 68 | #endif // OAU_APPLICATION_MANAGER_H |