Debian Codegraph @

online-accounts/lib/qt/LomiriOnlineAccounts/account.h

raw symbols SCIP
1 /*
2 * This file is part of libOnlineAccounts
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_ACCOUNT_H
22 #define ONLINE_ACCOUNTS_ACCOUNT_H
23
24 #include <QObject>
25 #include <QVariant>
26
27 #include "global.h"
28 #include "pending_call.h"
29 #include "service.h"
30
31 namespace OnlineAccounts {
32
33 class AuthenticationData;
34 class Manager;
35
36 class AccountPrivate;
37 class ONLINE_ACCOUNTS_EXPORT Account: public QObject
38 {
39 Q_OBJECT
40
41 public:
42 ~Account();
43
44 /* Returns false if account deleted or disabled */
45 bool isValid() const;
46
47 Service service() const;
48
49 AccountId id() const;
50 QString displayName() const;
51 QString serviceId() const;
52 AuthenticationMethod authenticationMethod() const;
53
54 QStringList keys() const;
55 QVariant setting(const QString &key) const;
56
57 PendingCall authenticate(const AuthenticationData &authData);
58
59 Q_SIGNALS:
60 void changed();
61 void disabled();
62
63 protected:
64 explicit Account(AccountPrivate *priv, QObject *parent);
65
66 private:
67 friend class Manager;
68 friend class ManagerPrivate;
69 Q_DECLARE_PRIVATE(Account)
70 AccountPrivate *d_ptr;
71 };
72
73 } // namespace
74
75 #endif // ONLINE_ACCOUNTS_ACCOUNT_H