2 * Copyright (C) 2013 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/>.
16 * Authors: Michael Terry <michael.terry@canonical.com>
19#ifndef UNITY_ACCOUNTSSERVICE_H
20#define UNITY_ACCOUNTSSERVICE_H
27class AccountsServiceDBusAdaptor;
30class AccountsService: public QObject
33 Q_ENUMS(PasswordDisplayHint)
34 Q_PROPERTY (QString user
38 Q_PROPERTY (bool demoEdges
41 NOTIFY demoEdgesChanged)
42 Q_PROPERTY (bool enableLauncherWhileLocked
43 READ enableLauncherWhileLocked
44 NOTIFY enableLauncherWhileLockedChanged)
45 Q_PROPERTY (bool enableIndicatorsWhileLocked
46 READ enableIndicatorsWhileLocked
47 NOTIFY enableIndicatorsWhileLockedChanged)
48 Q_PROPERTY (QString backgroundFile
50 NOTIFY backgroundFileChanged)
51 Q_PROPERTY (bool statsWelcomeScreen
52 READ statsWelcomeScreen
53 NOTIFY statsWelcomeScreenChanged)
54 Q_PROPERTY (PasswordDisplayHint passwordDisplayHint
55 READ passwordDisplayHint
56 NOTIFY passwordDisplayHintChanged)
57 Q_PROPERTY (uint failedLogins
60 NOTIFY failedLoginsChanged)
61 Q_PROPERTY(bool hereEnabled
64 NOTIFY hereEnabledChanged)
65 Q_PROPERTY(QString hereLicensePath
67 NOTIFY hereLicensePathChanged)
68 Q_PROPERTY(bool hereLicensePathValid // qml sees a null string as "", so we use proxy setting for that
69 READ hereLicensePathValid
70 NOTIFY hereLicensePathChanged)
73 enum PasswordDisplayHint {
78 explicit AccountsService(QObject *parent = 0, const QString & user = QString());
79 ~AccountsService() = default;
82 void setUser(const QString &user);
83 bool demoEdges() const;
84 void setDemoEdges(bool demoEdges);
85 bool enableLauncherWhileLocked() const;
86 bool enableIndicatorsWhileLocked() const;
87 QString backgroundFile() const;
88 bool statsWelcomeScreen() const;
89 PasswordDisplayHint passwordDisplayHint() const;
90 uint failedLogins() const;
91 void setFailedLogins(uint failedLogins);
92 bool hereEnabled() const;
93 void setHereEnabled(bool enabled);
94 QString hereLicensePath() const;
95 bool hereLicensePathValid() const;
99 void demoEdgesChanged();
100 void enableLauncherWhileLockedChanged();
101 void enableIndicatorsWhileLockedChanged();
102 void backgroundFileChanged();
103 void statsWelcomeScreenChanged();
104 void passwordDisplayHintChanged();
105 void failedLoginsChanged();
106 void hereEnabledChanged();
107 void hereLicensePathChanged();
110 void onPropertiesChanged(const QString &user, const QString &interface, const QStringList &changed);
111 void onMaybeChanged(const QString &user);
114 typedef QVariant (*ProxyConverter)(const QVariant &);
116 void refresh(bool async);
117 void registerProperty(const QString &interface, const QString &property, const QString &signal);
118 void registerProxy(const QString &interface, const QString &property, QDBusInterface *iface, const QString &method, ProxyConverter converter = nullptr);
120 void updateAllProperties(const QString &interface, bool async);
121 void updateProperty(const QString &interface, const QString &property);
122 void updateCache(const QString &interface, const QString &property, const QVariant &value);
124 void setProperty(const QString &interface, const QString &property, const QVariant &value);
125 QVariant getProperty(const QString &interface, const QString &property) const;
127 void emitChangedForProperty(const QString &interface, const QString &property);
129 struct PropertyInfo {
132 QDBusInterface *proxyInterface{};
133 QString proxyMethod{};
134 ProxyConverter proxyConverter{};
136 typedef QHash< QString, QHash<QString, PropertyInfo> > PropertyHash;
137 PropertyHash m_properties;
138 AccountsServiceDBusAdaptor *m_service;
139 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