2 * Copyright (C) 2010-2011 David Edmundson.
3 * Author: David Edmundson <kde@davidedmundson.co.uk>
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.
11 #ifndef QLIGHTDM_SESSIONS_MODEL_H
12 #define QLIGHTDM_SESSIONS_MODEL_H
14 #include <QtCore/QAbstractListModel>
16 class SessionsModelPrivate;
19 class Q_DECL_EXPORT SessionsModel : public QAbstractListModel
23 Q_ENUMS(SessionModelRoles SessionType)
26 enum SessionModelRoles {
27 //name is exposed as Qt::DisplayRole
28 //comment is exposed as Qt::TooltipRole
29 KeyRole = Qt::UserRole,
30 IdRole = KeyRole /** Deprecated */
38 explicit SessionsModel(QObject *parent = 0); /** Deprecated. Loads local sessions*/
39 explicit SessionsModel(SessionsModel::SessionType, QObject *parent = 0);
40 virtual ~SessionsModel();
42 int rowCount(const QModelIndex &parent) const;
43 QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const;
46 SessionsModelPrivate *d_ptr;
49 Q_DECLARE_PRIVATE(SessionsModel)
53 #endif // QLIGHTDM_SESSION_H