2 * Copyright (C) 2013, 2015 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 enableLauncherWhileLocked
45 READ enableLauncherWhileLocked
46 NOTIFY enableLauncherWhileLockedChanged)
47 Q_PROPERTY (bool enableIndicatorsWhileLocked
48 READ enableIndicatorsWhileLocked
49 NOTIFY enableIndicatorsWhileLockedChanged)
50 Q_PROPERTY (QString backgroundFile
52 NOTIFY backgroundFileChanged)
53 Q_PROPERTY (bool statsWelcomeScreen
54 READ statsWelcomeScreen
55 NOTIFY statsWelcomeScreenChanged)
56 Q_PROPERTY (PasswordDisplayHint passwordDisplayHint
57 READ passwordDisplayHint
58 NOTIFY passwordDisplayHintChanged)
59 Q_PROPERTY (uint failedLogins
62 NOTIFY failedLoginsChanged)
63 Q_PROPERTY(bool hereEnabled
66 NOTIFY hereEnabledChanged)
67 Q_PROPERTY(QString hereLicensePath
69 NOTIFY hereLicensePathChanged)
70 Q_PROPERTY(bool hereLicensePathValid // qml sees a null string as "", so we use proxy setting for that
71 READ hereLicensePathValid
72 NOTIFY hereLicensePathChanged)
73 Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged)
74 Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged)
75 Q_PROPERTY(QStringList keymaps
77 NOTIFY keymapsChanged)
80 enum PasswordDisplayHint {
85 explicit AccountsService(QObject *parent = 0, const QString & user = QString());
86 ~AccountsService() = default;
89 void setUser(const QString &user);
90 bool demoEdges() const;
91 void setDemoEdges(bool demoEdges);
92 QStringList demoEdgesCompleted() const;
93 Q_INVOKABLE void markDemoEdgeCompleted(const QString &edge);
94 bool enableLauncherWhileLocked() const;
95 bool enableIndicatorsWhileLocked() const;
96 QString backgroundFile() const;
97 bool statsWelcomeScreen() const;
98 PasswordDisplayHint passwordDisplayHint() const;
99 uint failedLogins() const;
100 void setFailedLogins(uint failedLogins);
101 bool hereEnabled() const;
102 void setHereEnabled(bool enabled);
103 QString hereLicensePath() const;
104 bool hereLicensePathValid() const;
105 QString realName() const;
106 void setRealName(const QString &realName);
107 QString email() const;
108 void setEmail(const QString &email);
109 QStringList keymaps() const;
113 void demoEdgesChanged();
114 void demoEdgesCompletedChanged();
115 void enableLauncherWhileLockedChanged();
116 void enableIndicatorsWhileLockedChanged();
117 void backgroundFileChanged();
118 void statsWelcomeScreenChanged();
119 void passwordDisplayHintChanged();
120 void failedLoginsChanged();
121 void hereEnabledChanged();
122 void hereLicensePathChanged();
123 void realNameChanged();
125 void keymapsChanged();
128 void onPropertiesChanged(const QString &user, const QString &interface, const QStringList &changed);
129 void onMaybeChanged(const QString &user);
132 typedef QVariant (*ProxyConverter)(const QVariant &);
134 void refresh(bool async);
135 void registerProperty(const QString &interface, const QString &property, const QString &signal);
136 void registerProxy(const QString &interface, const QString &property, QDBusInterface *iface, const QString &method, ProxyConverter converter = nullptr);
138 void updateAllProperties(const QString &interface, bool async);
139 void updateProperty(const QString &interface, const QString &property);
140 void updateCache(const QString &interface, const QString &property, const QVariant &value);
142 void setProperty(const QString &interface, const QString &property, const QVariant &value);
143 QVariant getProperty(const QString &interface, const QString &property) const;
145 void emitChangedForProperty(const QString &interface, const QString &property);
147 struct PropertyInfo {
150 QDBusInterface *proxyInterface{};
151 QString proxyMethod{};
152 ProxyConverter proxyConverter{};
154 typedef QHash< QString, QHash<QString, PropertyInfo> > PropertyHash;
155 PropertyHash m_properties;
156 AccountsServiceDBusAdaptor *m_service;
157 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