summaryrefslogtreecommitdiff
path: root/liblightdm-qt/QLightDM/sessionsmodel.h
blob: c93f8e8ed6424f29f69822465197e249b0af0f9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef QLIGTHDM_SESSIONSMODEL_H
#define QLIGTHDM_SESSIONSMODEL_H

#include <QtCore/QAbstractListModel>

class SessionsModelPrivate;

namespace QLightDM {
    class Q_DECL_EXPORT SessionsModel : public QAbstractListModel
    {
        Q_OBJECT
    public:
        enum SessionModelRoles {IdRole = Qt::UserRole};

        explicit SessionsModel(QObject *parent = 0);
        virtual ~SessionsModel();
        
        int rowCount(const QModelIndex &parent) const;
        QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const;

    private:
        SessionsModelPrivate *d;
        void buildList(); //maybe make this a public slot, which apps can call only if they give a care about the session.
    };
};

#endif // LDMSESSIONSMODEL_H