on a58769f help sign in
unity8/plugins/AccountsService/AccountsService.h
99 lines 3.0 kB history raw
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
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.
7 *
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.
12 *
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/>.
15 *
16 * Authors: Michael Terry <michael.terry@canonical.com>
17 */
19#ifndef UNITY_ACCOUNTSSERVICE_H
20#define UNITY_ACCOUNTSSERVICE_H
22#include <QObject>
23#include <QString>
25class AccountsServiceDBusAdaptor;
27class AccountsService: public QObject
29 Q_OBJECT
30 Q_ENUMS(PasswordDisplayHint)
31 Q_PROPERTY (QString user
32 READ user
33 WRITE setUser
34 NOTIFY userChanged)
35 Q_PROPERTY (bool demoEdges
36 READ demoEdges
37 WRITE setDemoEdges
38 NOTIFY demoEdgesChanged)
39 Q_PROPERTY (QString backgroundFile
40 READ backgroundFile
41 NOTIFY backgroundFileChanged)
42 Q_PROPERTY (bool statsWelcomeScreen
43 READ statsWelcomeScreen
44 NOTIFY statsWelcomeScreenChanged)
45 Q_PROPERTY (PasswordDisplayHint passwordDisplayHint
46 READ passwordDisplayHint
47 NOTIFY passwordDisplayHintChanged)
48 Q_PROPERTY (uint failedLogins
49 READ failedLogins
50 WRITE setFailedLogins
51 NOTIFY failedLoginsChanged)
53public:
54 enum PasswordDisplayHint {
55 Keyboard,
56 Numeric,
57 };
59 explicit AccountsService(QObject *parent = 0);
61 QString user() const;
62 void setUser(const QString &user);
63 bool demoEdges() const;
64 void setDemoEdges(bool demoEdges);
65 QString backgroundFile() const;
66 bool statsWelcomeScreen() const;
67 PasswordDisplayHint passwordDisplayHint() const;
68 uint failedLogins() const;
69 void setFailedLogins(uint failedLogins);
71Q_SIGNALS:
72 void userChanged();
73 void demoEdgesChanged();
74 void backgroundFileChanged();
75 void statsWelcomeScreenChanged();
76 void passwordDisplayHintChanged();
77 void failedLoginsChanged();
79private Q_SLOTS:
80 void propertiesChanged(const QString &user, const QString &interface, const QStringList &changed);
81 void maybeChanged(const QString &user);
83private:
84 void updateDemoEdges();
85 void updateBackgroundFile();
86 void updateStatsWelcomeScreen();
87 void updatePasswordDisplayHint();
88 void updateFailedLogins();
90 AccountsServiceDBusAdaptor *m_service;
91 QString m_user;
92 bool m_demoEdges;
93 QString m_backgroundFile;
94 bool m_statsWelcomeScreen;
95 PasswordDisplayHint m_passwordDisplayHint;
96 uint m_failedLogins;
97};
99#endif