on d07cfbe help sign in
unity8/tests/mocks/liblightdm/MockUsersModel.h
61 lines 1.7 kB history raw
1/*
2 * Copyright (C) 2013-2016 Canonical, Ltd.
3 * Copyright (C) 2010-2011 David Edmundson.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
18#pragma once
20#include <QAbstractListModel>
21#include <QList>
22#include <QString>
24namespace QLightDM
26class UsersModelPrivate;
28class Q_DECL_EXPORT UsersModel : public QAbstractListModel
30 Q_OBJECT
32public:
33 explicit UsersModel(QObject *parent = 0);
34 virtual ~UsersModel();
36 enum UserModelRoles {NameRole = Qt::UserRole,
37 RealNameRole,
38 LoggedInRole,
39 BackgroundRole,
40 SessionRole,
41 HasMessagesRole,
42 ImagePathRole,
43 BackgroundPathRole,
44 UidRole
45 };
46 Q_ENUM(UserModelRoles)
48 int rowCount(const QModelIndex &parent) const override;
49 QVariant data(const QModelIndex &index, int role) const override;
51 void setCurrentSessionName(const QString &sessionName, const QString &username);
53private Q_SLOTS:
54 void resetEntries();
56private:
57 UsersModelPrivate * const d_ptr;
58 Q_DECLARE_PRIVATE(UsersModel)
59};