Back to index

lightdm  1.3.2
usersmodel.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2010-2011 David Edmundson.
00003  * Author: David Edmundson <kde@davidedmundson.co.uk>
00004  *
00005  * This library is free software; you can redistribute it and/or modify it under
00006  * the terms of the GNU Lesser General Public License as published by the Free
00007  * Software Foundation; either version 3 of the License, or (at your option) any
00008  * later version. See http://www.gnu.org/copyleft/lgpl.html the full text of the
00009  * license.
00010  */
00011 
00012 #ifndef QLIGHTDM_USER_H
00013 #define QLIGHTDM_USER_H
00014 
00015 #include <QtCore/QString>
00016 #include <QtCore/QSharedDataPointer>
00017 #include <QAbstractListModel>
00018 
00019 
00020 namespace QLightDM
00021 {
00022 class UsersModelPrivate;
00023 
00024 class Q_DECL_EXPORT UsersModel : public QAbstractListModel
00025 {
00026     Q_OBJECT
00027 public:
00028     explicit UsersModel(QObject *parent = 0);
00029     ~UsersModel();
00030 
00031     enum UserModelRoles {NameRole = Qt::UserRole,
00032                          RealNameRole,
00033                          LoggedInRole,
00034                          BackgroundRole,
00035                          SessionRole,
00036                          HasMessagesRole};
00037 
00038     int rowCount(const QModelIndex &parent) const;
00039     QVariant data(const QModelIndex &index, int role) const;
00040 
00041 protected:
00042 
00043 private:
00044     UsersModelPrivate * const d_ptr;
00045 
00046     Q_DECLARE_PRIVATE(UsersModel)
00047 
00048 };
00049 
00050 };
00051 
00052 #endif // QLIGHTDM_USER_H