2 * Copyright (C) 2013-2016 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17#ifndef UNITY_ACCOUNTSSERVICE_H
18#define UNITY_ACCOUNTSSERVICE_H
26class AccountsServiceDBusAdaptor;
29class AccountsService: public QObject
32 Q_ENUMS(PasswordDisplayHint)
33 Q_PROPERTY (QString user
37 Q_PROPERTY (bool demoEdges
40 NOTIFY demoEdgesChanged)
41 Q_PROPERTY (QStringList demoEdgesCompleted
42 READ demoEdgesCompleted
43 NOTIFY demoEdgesCompletedChanged)
44 Q_PROPERTY (bool enableFingerprintIdentification
45 READ enableFingerprintIdentification
46 NOTIFY enableFingerprintIdentificationChanged)
47 Q_PROPERTY (bool enableLauncherWhileLocked
48 READ enableLauncherWhileLocked
49 NOTIFY enableLauncherWhileLockedChanged)
50 Q_PROPERTY (bool enableIndicatorsWhileLocked
51 READ enableIndicatorsWhileLocked
52 NOTIFY enableIndicatorsWhileLockedChanged)
53 Q_PROPERTY (QString backgroundFile
55 NOTIFY backgroundFileChanged)
56 Q_PROPERTY (bool statsWelcomeScreen
57 READ statsWelcomeScreen
58 NOTIFY statsWelcomeScreenChanged)
59 Q_PROPERTY (PasswordDisplayHint passwordDisplayHint
60 READ passwordDisplayHint
61 NOTIFY passwordDisplayHintChanged)
62 Q_PROPERTY (uint failedLogins
65 NOTIFY failedLoginsChanged)
66 Q_PROPERTY (uint failedFingerprintLogins
67 READ failedFingerprintLogins
68 WRITE setFailedFingerprintLogins
69 NOTIFY failedFingerprintLoginsChanged)
70 Q_PROPERTY(bool hereEnabled
73 NOTIFY hereEnabledChanged)
74 Q_PROPERTY(QString hereLicensePath
76 NOTIFY hereLicensePathChanged)
77 Q_PROPERTY(bool hereLicensePathValid // qml sees a null string as "", so we use proxy setting for that
78 READ hereLicensePathValid
79 NOTIFY hereLicensePathChanged)
80 Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged)
81 Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged)
82 Q_PROPERTY(QStringList keymaps
84 NOTIFY keymapsChanged)
87 enum PasswordDisplayHint {
92 explicit AccountsService(QObject *parent = 0, const QString & user = QString());
93 ~AccountsService() = default;
96 void setUser(const QString &user);
97 bool demoEdges() const;
98 void setDemoEdges(bool demoEdges);
99 QStringList demoEdgesCompleted() const;
100 Q_INVOKABLE void markDemoEdgeCompleted(const QString &edge);
101 bool enableFingerprintIdentification() const;
102 bool enableLauncherWhileLocked() const;
103 bool enableIndicatorsWhileLocked() const;
104 QString backgroundFile() const;
105 bool statsWelcomeScreen() const;
106 PasswordDisplayHint passwordDisplayHint() const;
107 uint failedLogins() const;
108 void setFailedLogins(uint failedLogins);
109 uint failedFingerprintLogins() const;
110 void setFailedFingerprintLogins(uint failedFingerprintLogins);
111 bool hereEnabled() const;
112 void setHereEnabled(bool enabled);
113 QString hereLicensePath() const;
114 bool hereLicensePathValid() const;
115 QString realName() const;
116 void setRealName(const QString &realName);
117 QString email() const;
118 void setEmail(const QString &email);
119 QStringList keymaps() const;
123 void demoEdgesChanged();
124 void demoEdgesCompletedChanged();
125 void enableFingerprintIdentificationChanged();
126 void enableLauncherWhileLockedChanged();
127 void enableIndicatorsWhileLockedChanged();
128 void backgroundFileChanged();
129 void statsWelcomeScreenChanged();
130 void passwordDisplayHintChanged();
131 void failedLoginsChanged();
132 void failedFingerprintLoginsChanged();
133 void hereEnabledChanged();
134 void hereLicensePathChanged();
135 void realNameChanged();
137 void keymapsChanged();
140 void onPropertiesChanged(const QString &user, const QString &interface, const QStringList &changed);
141 void onMaybeChanged(const QString &user);
144 typedef QVariant (*ProxyConverter)(const QVariant &);
146 void refresh(bool async);
147 void registerProperty(const QString &interface, const QString &property, const QString &signal);
148 void registerProxy(const QString &interface, const QString &property, QDBusInterface *iface, const QString &method, ProxyConverter converter = nullptr);
150 void updateAllProperties(const QString &interface, bool async);
151 void updateProperty(const QString &interface, const QString &property);
152 void updateCache(const QString &interface, const QString &property, const QVariant &value);
154 void setProperty(const QString &interface, const QString &property, const QVariant &value);
155 QVariant getProperty(const QString &interface, const QString &property) const;
157 void emitChangedForProperty(const QString &interface, const QString &property);
159 struct PropertyInfo {
162 QDBusInterface *proxyInterface{};
163 QString proxyMethod{};
164 ProxyConverter proxyConverter{};
166 typedef QHash< QString, QHash<QString, PropertyInfo> > PropertyHash;
167 PropertyHash m_properties;
168 AccountsServiceDBusAdaptor *m_service;
169 QDBusInterface *m_unityInput;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list