~ubuntu-branches/ubuntu/vivid/lightdm-kde/vivid

« back to all changes in this revision

Viewing changes to greeter/screensmodel.h

  • Committer: Package Import Robot
  • Author(s): Michal Zajac
  • Date: 2012-07-22 19:44:44 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20120722194444-aaueaylu3ddnqcth
Tags: 0.2.1-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
This file is part of LightDM-KDE.
 
3
 
 
4
Copyright 2012 David Edmundson <kde@davidedmundson.co.uk>
 
5
 
 
6
LightDM-KDE is free software: you can redistribute it and/or modify
 
7
it under the terms of the GNU General Public License as published by
 
8
the Free Software Foundation, either version 3 of the License, or
 
9
(at your option) any later version.
 
10
 
 
11
LightDM-KDE is distributed in the hope that it will be useful,
 
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
GNU General Public License for more details.
 
15
 
 
16
You should have received a copy of the GNU General Public License
 
17
along with LightDM-KDE.  If not, see <http://www.gnu.org/licenses/>.
 
18
*/
 
19
 
 
20
#ifndef SCREENSMODEL_H
 
21
#define SCREENSMODEL_H
 
22
 
 
23
#include <QAbstractListModel>
 
24
#include <QList>
 
25
#include <QRect>
 
26
 
 
27
class ScreensModel : public QAbstractListModel
 
28
{
 
29
    Q_OBJECT
 
30
public:
 
31
    explicit ScreensModel(QObject *parent = 0);
 
32
    int rowCount(const QModelIndex &parent=QModelIndex()) const;
 
33
    QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const;
 
34
 
 
35
private slots:
 
36
    void onScreenResized(int screen);
 
37
    void onScreenCountChanged(int newCount);
 
38
 
 
39
private:
 
40
    void loadScreens();
 
41
    QList<QRect> m_screens;
 
42
};
 
43
 
 
44
#endif // SCREENSMODEL_H