]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - liblightdm-qt/QLightDM/usersmodel.h
d803c41c943adce85df04343148d865a1def5378
[sojka/lightdm.git] / liblightdm-qt / QLightDM / usersmodel.h
1 /*
2  * Copyright (C) 2010-2011 David Edmundson.
3  * Author: David Edmundson <kde@davidedmundson.co.uk>
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License as published by the Free
7  * Software Foundation; either version 2 or version 3 of the License.
8  * See http://www.gnu.org/copyleft/lgpl.html the full text of the license.
9  */
10
11 #ifndef QLIGHTDM_USER_H
12 #define QLIGHTDM_USER_H
13
14 #include <QtCore/QString>
15 #include <QtCore/QSharedDataPointer>
16 #include <QAbstractListModel>
17
18
19 namespace QLightDM
20 {
21 class UsersModelPrivate;
22
23 class Q_DECL_EXPORT UsersModel : public QAbstractListModel
24 {
25     Q_OBJECT
26
27     Q_ENUMS(UserModelRoles)
28
29 public:
30     explicit UsersModel(QObject *parent = 0);
31     ~UsersModel();
32
33     enum UserModelRoles {NameRole = Qt::UserRole,
34                          RealNameRole,
35                          LoggedInRole,
36                          BackgroundRole,
37                          SessionRole,
38                          HasMessagesRole,
39                          ImagePathRole,
40                          BackgroundPathRole
41     };
42
43     int rowCount(const QModelIndex &parent) const;
44     QVariant data(const QModelIndex &index, int role) const;
45
46 protected:
47
48 private:
49     UsersModelPrivate * const d_ptr;
50
51     Q_DECLARE_PRIVATE(UsersModel)
52
53 };
54
55 }
56
57 #endif // QLIGHTDM_USER_H