Back to index

lightdm  1.3.2
sessionsmodel.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_SESSIONS_MODEL_H
00013 #define QLIGHTDM_SESSIONS_MODEL_H
00014 
00015 #include <QtCore/QAbstractListModel>
00016 
00017 class SessionsModelPrivate;
00018 
00019 namespace QLightDM {
00020     class Q_DECL_EXPORT SessionsModel : public QAbstractListModel
00021     {
00022         Q_OBJECT
00023     public:
00024         enum SessionModelRoles {
00025             //name is exposed as Qt::DisplayRole
00026             //comment is exposed as Qt::TooltipRole
00027             KeyRole = Qt::UserRole,
00028             IdRole = KeyRole 
00029         };
00030 
00031         explicit SessionsModel(QObject *parent = 0);
00032         virtual ~SessionsModel();
00033 
00034         int rowCount(const QModelIndex &parent) const;
00035         QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const;
00036 
00037     protected:
00038         SessionsModelPrivate *d_ptr;
00039         
00040     private:
00041         Q_DECLARE_PRIVATE(SessionsModel)
00042     };
00043 };
00044 
00045 #endif // QLIGHTDM_SESSION_H