Lomiri
Loading...
Searching...
No Matches
UsersModel.h
1/*
2 * Copyright (C) 2013 Canonical Ltd.
3 * Copyright (C) 2010-2011 David Edmundson.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Author: David Edmundson <kde@davidedmundson.co.uk>
18 */
19
20#ifndef LOMIRI_MOCK_USERSMODEL_H
21#define LOMIRI_MOCK_USERSMODEL_H
22
23#include <QtCore/QString>
24#include <QtCore/QSharedDataPointer>
25#include <QAbstractListModel>
26
27/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28 * CHANGES MADE HERE MUST BE REFLECTED ON THE MOCK LIB
29 * COUNTERPART IN tests/mocks/Lightdm/liblightdm
30 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
31
32namespace QLightDM
33{
34class UsersModelPrivate;
35
36class Q_DECL_EXPORT UsersModel : public QAbstractListModel
37{
38 Q_OBJECT
39
40public:
41 explicit UsersModel(QObject *parent = 0);
42 virtual ~UsersModel() = default;
43
44 enum UserModelRoles {NameRole = Qt::UserRole,
45 RealNameRole,
46 LoggedInRole,
47 BackgroundRole,
48 SessionRole,
49 HasMessagesRole,
50 ImagePathRole,
51 BackgroundPathRole,
52 UidRole
53 };
54 Q_ENUM(UserModelRoles)
55
56 int rowCount(const QModelIndex &parent) const override;
57 QVariant data(const QModelIndex &index, int role) const override;
58
59private:
60 UsersModelPrivate * const d_ptr;
61 Q_DECLARE_PRIVATE(UsersModel)
62};
63
64}
65
66#endif // LOMIRI_MOCK_USERSMODEL_H