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_PROPERTY (QString user
36 Q_PROPERTY (bool demoEdges
39 NOTIFY demoEdgesChanged)
40 Q_PROPERTY (QStringList demoEdgesCompleted
41 READ demoEdgesCompleted
42 NOTIFY demoEdgesCompletedChanged)
43 Q_PROPERTY (bool enableFingerprintIdentification
44 READ enableFingerprintIdentification
45 NOTIFY enableFingerprintIdentificationChanged)
46 Q_PROPERTY (bool enableLauncherWhileLocked
47 READ enableLauncherWhileLocked
48 NOTIFY enableLauncherWhileLockedChanged)
49 Q_PROPERTY (bool enableIndicatorsWhileLocked
50 READ enableIndicatorsWhileLocked
51 NOTIFY enableIndicatorsWhileLockedChanged)
52 Q_PROPERTY (QString backgroundFile
54 NOTIFY backgroundFileChanged)
55 Q_PROPERTY (bool statsWelcomeScreen
56 READ statsWelcomeScreen
57 NOTIFY statsWelcomeScreenChanged)
58 Q_PROPERTY (PasswordDisplayHint passwordDisplayHint
59 READ passwordDisplayHint
60 NOTIFY passwordDisplayHintChanged)
61 Q_PROPERTY (uint failedLogins
64 NOTIFY failedLoginsChanged)
65 Q_PROPERTY (uint failedFingerprintLogins
66 READ failedFingerprintLogins
67 WRITE setFailedFingerprintLogins
68 NOTIFY failedFingerprintLoginsChanged)
69 Q_PROPERTY(bool hereEnabled
72 NOTIFY hereEnabledChanged)
73 Q_PROPERTY(QString hereLicensePath
75 NOTIFY hereLicensePathChanged)
76 Q_PROPERTY(bool hereLicensePathValid // qml sees a null string as "", so we use proxy setting for that
77 READ hereLicensePathValid
78 NOTIFY hereLicensePathChanged)
79 Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged)
80 Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged)
81 Q_PROPERTY(QStringList keymaps READ keymaps WRITE setKeymaps NOTIFY keymapsChanged)
84 enum PasswordDisplayHint {
88 Q_ENUM(PasswordDisplayHint)
90 explicit AccountsService(QObject *parent = 0, const QString & user = QString());
91 ~AccountsService() = default;
94 void setUser(const QString &user);
95 bool demoEdges() const;
96 void setDemoEdges(bool demoEdges);
97 QStringList demoEdgesCompleted() const;
98 Q_INVOKABLE void markDemoEdgeCompleted(const QString &edge);
99 bool enableFingerprintIdentification() const;
100 bool enableLauncherWhileLocked() const;
101 bool enableIndicatorsWhileLocked() const;
102 QString backgroundFile() const;
103 bool statsWelcomeScreen() const;
104 PasswordDisplayHint passwordDisplayHint() const;
105 uint failedLogins() const;
106 void setFailedLogins(uint failedLogins);
107 uint failedFingerprintLogins() const;
108 void setFailedFingerprintLogins(uint failedFingerprintLogins);
109 bool hereEnabled() const;
110 void setHereEnabled(bool enabled);
111 QString hereLicensePath() const;
112 bool hereLicensePathValid() const;
113 QString realName() const;
114 void setRealName(const QString &realName);
115 QString email() const;
116 void setEmail(const QString &email);
117 QStringList keymaps() const;
118 void setKeymaps(const QStringList &keymaps);
122 void demoEdgesChanged();
123 void demoEdgesCompletedChanged();
124 void enableFingerprintIdentificationChanged();
125 void enableLauncherWhileLockedChanged();
126 void enableIndicatorsWhileLockedChanged();
127 void backgroundFileChanged();
128 void statsWelcomeScreenChanged();
129 void passwordDisplayHintChanged();
130 void failedLoginsChanged();
131 void failedFingerprintLoginsChanged();
132 void hereEnabledChanged();
133 void hereLicensePathChanged();
134 void realNameChanged();
136 void keymapsChanged();
139 void onPropertiesChanged(const QString &user, const QString &interface, const QStringList &changed);
140 void onMaybeChanged(const QString &user);
143 typedef QVariant (*ProxyConverter)(const QVariant &);
145 void refresh(bool async);
146 void registerProperty(const QString &interface, const QString &property, const QString &signal);
147 void registerProxy(const QString &interface, const QString &property, QDBusInterface *iface, const QString &method, ProxyConverter converter = nullptr);
149 void updateAllProperties(const QString &interface, bool async);
150 void updateProperty(const QString &interface, const QString &property);
151 void updateCache(const QString &interface, const QString &property, const QVariant &value);
153 void setProperty(const QString &interface, const QString &property, const QVariant &value);
154 QVariant getProperty(const QString &interface, const QString &property) const;
156 void emitChangedForProperty(const QString &interface, const QString &property);
158 struct PropertyInfo {
161 QDBusInterface *proxyInterface{};
162 QString proxyMethod{};
163 ProxyConverter proxyConverter{};
165 typedef QHash< QString, QHash<QString, PropertyInfo> > PropertyHash;
166 PropertyHash m_properties;
167 AccountsServiceDBusAdaptor *m_service;
168 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