| 1 | /* |
| 2 | * This file is part of lomiri-online-accounts-service |
| 3 | * |
| 4 | * Copyright (C) 2012 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 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 SIGNON_UI_INDICATOR_SERVICE_H |
| 22 | #define SIGNON_UI_INDICATOR_SERVICE_H |
| 23 | |
| 24 | #include <QObject> |
| 25 | #include <QSet> |
| 26 | #include <QVariantMap> |
| 27 | |
| 28 | namespace SignOnUi { |
| 29 | |
| 30 | #define WEBCREDENTIALS_OBJECT_PATH \ |
| 31 | QStringLiteral("/com/canonical/indicators/webcredentials") |
| 32 | #define WEBCREDENTIALS_INTERFACE \ |
| 33 | QStringLiteral("com.canonical.indicators.webcredentials") |
| 34 | #define WEBCREDENTIALS_BUS_NAME WEBCREDENTIALS_INTERFACE |
| 35 | |
| 36 | class IndicatorServicePrivate; |
| 37 | |
| 38 | class IndicatorService: public QObject |
| 39 | { |
| 40 | Q_OBJECT |
| 41 | Q_PROPERTY(bool isIdle READ isIdle NOTIFY isIdleChanged) |
| 42 | |
| 43 | public: |
| 44 | |
| 45 | explicit IndicatorService(QObject *parent = 0); |
| 46 | ~IndicatorService(); |
| 47 | |
| 48 | static IndicatorService *instance(); |
| 49 | |
| 50 | QObject *serviceObject() const; |
| 51 | |
| 52 | void ClearErrorStatus(); |
| 53 | bool ReauthenticateAccount(uint accountId, |
| 54 | const QVariantMap &extraParameters); |
| 55 | void RemoveFailures(const QSet<uint> &accountIds); |
| 56 | void ReportFailure(uint accountId, const QVariantMap ¬ification); |
| 57 | |
| 58 | QSet<uint> failures() const; |
| 59 | bool errorStatus() const; |
| 60 | bool isIdle() const; |
| 61 | |
| 62 | Q_SIGNALS: |
| 63 | void isIdleChanged(); |
| 64 | |
| 65 | private: |
| 66 | IndicatorServicePrivate *d_ptr; |
| 67 | Q_DECLARE_PRIVATE(IndicatorService) |
| 68 | }; |
| 69 | |
| 70 | } // namespace |
| 71 | |
| 72 | Q_DECLARE_METATYPE(QSet<uint>) |
| 73 | |
| 74 | #endif // SIGNON_UI_INDICATOR_SERVICE_H |