2
* Copyright (C) 2013 Canonical, Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Author: Pete Woods <pete.woods@canonical.com>
19
#ifndef LIGHTDM_INFOGRAPHICMODEL_H
20
#define LIGHTDM_INFOGRAPHICMODEL_H
22
#include <QtCore/QString>
23
#include <QtGui/qcolor.h>
24
#include <QAbstractListModel>
28
class InfographicColorThemePrivate;
30
class Q_DECL_EXPORT InfographicColorTheme: public QObject
34
Q_PROPERTY(QColor start READ start NOTIFY startChanged FINAL)
35
Q_PROPERTY(QColor main READ main NOTIFY mainChanged FINAL)
36
Q_PROPERTY(QColor end READ end NOTIFY endChanged FINAL)
39
explicit InfographicColorTheme(QObject *parent = 0);
41
explicit InfographicColorTheme(QColor &first, QColor &main, QColor &end,
44
InfographicColorTheme & operator=(const InfographicColorTheme & other);
46
~InfographicColorTheme();
55
void startChanged(const QColor &color);
57
void mainChanged(const QColor &color);
59
void endChanged(const QColor &color);
62
InfographicColorThemePrivate * const d_ptr;
64
Q_DECLARE_PRIVATE(InfographicColorTheme)
68
class InfographicModelPrivate;
70
class Q_DECL_EXPORT InfographicModel: public QObject
74
Q_PROPERTY(QString label READ label NOTIFY labelChanged FINAL)
75
Q_PROPERTY(QString username READ username WRITE setUsername NOTIFY usernameChanged FINAL)
76
Q_PROPERTY(QLightDM::InfographicColorTheme* firstColor READ firstColor NOTIFY firstColorChanged FINAL)
77
Q_PROPERTY(QLightDM::InfographicColorTheme* secondColor READ secondColor NOTIFY secondColorChanged FINAL)
78
Q_PROPERTY(QAbstractItemModel *firstMonth READ firstMonth NOTIFY firstMonthChanged FINAL)
79
Q_PROPERTY(QAbstractItemModel *secondMonth READ secondMonth NOTIFY secondMonthChanged FINAL)
80
Q_PROPERTY(int currentDay READ currentDay NOTIFY currentDayChanged FINAL)
83
static InfographicModel *getInstance();
85
explicit InfographicModel(QObject *parent = 0);
88
QString label() const;
90
QString username() const;
92
void setUsername(const QString &username);
94
InfographicColorTheme * firstColor() const;
96
QAbstractItemModel *firstMonth() const;
98
int currentDay() const;
100
InfographicColorTheme * secondColor() const;
102
QAbstractItemModel *secondMonth() const;
105
void labelChanged(const QString &label);
107
void usernameChanged(const QString &username);
109
void firstColorChanged(InfographicColorTheme *color);
111
void firstMonthChanged(QAbstractItemModel *firstMonth);
113
void currentDayChanged(int length);
115
void secondColorChanged(InfographicColorTheme *color);
117
void secondMonthChanged(QAbstractItemModel *secondMonth);
119
void nextDataSource();
121
void readyForDataChange();
123
void dataAboutToAppear();
127
void dataAboutToChange();
131
void dataAboutToDisappear();
133
void dataDisappeared();
136
void nextDataSourceSlot();
138
void readyForDataChangeSlot();
141
InfographicModelPrivate * const d_ptr;
143
Q_DISABLE_COPY(InfographicModel)
144
Q_DECLARE_PRIVATE(InfographicModel)
150
#endif // LIGHTDM_INFOGRAPHICMODEL_H