on f782fac help sign in
unity8/plugins/AccountsService/AccountsService.h
86 lines 2.6 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_PROPERTY (QString user
31 READ user
32 WRITE setUser
33 NOTIFY userChanged)
34 Q_PROPERTY (bool demoEdges
35 READ demoEdges
36 WRITE setDemoEdges
37 NOTIFY demoEdgesChanged)
38 Q_PROPERTY (bool demoEdgesForCurrentUser
39 READ demoEdgesForCurrentUser
40 WRITE setDemoEdgesForCurrentUser
41 NOTIFY demoEdgesForCurrentUserChanged)
42 Q_PROPERTY (QString backgroundFile
43 READ backgroundFile
44 NOTIFY backgroundFileChanged)
45 Q_PROPERTY (bool statsWelcomeScreen
46 READ statsWelcomeScreen
47 NOTIFY statsWelcomeScreenChanged)
49public:
50 explicit AccountsService(QObject *parent = 0);
52 QString user() const;
53 void setUser(const QString &user);
54 bool demoEdges() const;
55 void setDemoEdges(bool demoEdges);
56 bool demoEdgesForCurrentUser() const;
57 void setDemoEdgesForCurrentUser(bool demoEdgesForCurrentUser);
58 QString backgroundFile() const;
59 bool statsWelcomeScreen() const;
61Q_SIGNALS:
62 void userChanged();
63 void demoEdgesChanged();
64 void demoEdgesForCurrentUserChanged();
65 void backgroundFileChanged();
66 void statsWelcomeScreenChanged();
68private Q_SLOTS:
69 void propertiesChanged(const QString &user, const QString &interface, const QStringList &changed);
70 void maybeChanged(const QString &user);
72private:
73 void updateDemoEdges();
74 void updateDemoEdgesForCurrentUser();
75 void updateBackgroundFile();
76 void updateStatsWelcomeScreen();
78 AccountsServiceDBusAdaptor *m_service;
79 QString m_user;
80 bool m_demoEdges;
81 bool m_demoEdgesForCurrentUser;
82 QString m_backgroundFile;
83 bool m_statsWelcomeScreen;
84};
86#endif