Lomiri
Loading...
Searching...
No Matches
UsersModelPrivate.h
1/*
2 * Copyright (C) 2013-2016 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 * Author: Michael Terry <michael.terry@canonical.com>
17 */
18
19#ifndef LOMIRI_MOCK_USERSMODEL_PRIVATE_H
20#define LOMIRI_MOCK_USERSMODEL_PRIVATE_H
21
22#include <QByteArray>
23#include <QHash>
24#include <QList>
25#include <QObject>
26#include <QString>
27
28#include <sys/types.h>
29
30class AccountsServiceDBusAdaptor;
31
32namespace QLightDM
33{
34class UsersModel;
35
36class Entry
37{
38public:
39 QString username;
40 QString real_name;
41 QString background;
42 QString layouts;
43 bool is_active;
44 bool has_messages;
45 QString session;
46 QString infographic;
47 uid_t uid;
48};
49
50class UsersModelPrivate : public QObject
51{
52 Q_OBJECT
53
54public:
55 explicit UsersModelPrivate(UsersModel *parent = 0);
56 virtual ~UsersModelPrivate() = default;
57
58 QList<Entry> entries;
59
60Q_SIGNALS:
61 void dataChanged(int);
62
63protected:
64 UsersModel * const q_ptr;
65
66private:
67 Q_DECLARE_PUBLIC(UsersModel)
68
69 void updateName(bool async);
70
71 AccountsServiceDBusAdaptor *m_service;
72 QHash<int, QByteArray> m_roles;
73};
74
75}
76
77#endif // LOMIRI_MOCK_USERSMODEL_PRIVATE_H