~mhr3/unity8/fix-1297246

« back to all changes in this revision

Viewing changes to tests/mocks/LightDM/UsersModel.h

  • Committer: Michał Sawicz
  • Date: 2013-06-05 22:03:08 UTC
  • Revision ID: michal.sawicz@canonical.com-20130605220308-yny8fv3futtr04fg
Inital unity8 commit.

Previous history can be found at https://code.launchpad.net/~unity-team/unity/phablet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2013 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
 *
 
17
 * Author: David Edmundson <kde@davidedmundson.co.uk>
 
18
 */
 
19
 
 
20
#ifndef UNITY_MOCK_USERSMODEL_H
 
21
#define UNITY_MOCK_USERSMODEL_H
 
22
 
 
23
#include <QtCore/QString>
 
24
#include <QtCore/QSharedDataPointer>
 
25
#include <QAbstractListModel>
 
26
 
 
27
 
 
28
namespace QLightDM
 
29
{
 
30
class UsersModelPrivate;
 
31
 
 
32
class Q_DECL_EXPORT UsersModel : public QAbstractListModel
 
33
{
 
34
    Q_OBJECT
 
35
 
 
36
    Q_ENUMS(UserModelRoles)
 
37
 
 
38
public:
 
39
    explicit UsersModel(QObject *parent = 0);
 
40
    virtual ~UsersModel();
 
41
 
 
42
    enum UserModelRoles {NameRole = Qt::UserRole,
 
43
                         RealNameRole,
 
44
                         LoggedInRole,
 
45
                         BackgroundRole,
 
46
                         SessionRole,
 
47
                         HasMessagesRole,
 
48
                         ImagePathRole,
 
49
                         BackgroundPathRole
 
50
    };
 
51
 
 
52
    int rowCount(const QModelIndex &parent) const;
 
53
    QVariant data(const QModelIndex &index, int role) const;
 
54
 
 
55
private:
 
56
    UsersModelPrivate * const d_ptr;
 
57
    Q_DECLARE_PRIVATE(UsersModel)
 
58
};
 
59
 
 
60
}
 
61
 
 
62
#endif // UNITY_MOCK_USERSMODEL_H