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 INFOGRAPHICMODEL_PRIVATE_H
20
#define INFOGRAPHICMODEL_PRIVATE_H
22
#include <QtCore/QSharedPointer>
24
#include "InfographicModel.h"
25
#include "plugins/Utils/qvariantlistmodel.h"
29
class InfographicDataPrivate;
31
class Q_DECL_EXPORT InfographicData: public QObject
34
explicit InfographicData(QObject *parent);
36
InfographicData(const QString &label,
37
const InfographicColorTheme &firstColor,
38
const QVariantList &firstMonth,
39
const InfographicColorTheme &secondColor,
40
const QVariantList &secondMonth, QObject* parent);
45
InfographicDataPrivate * const d_ptr;
48
const QString & label() const;
49
const InfographicColorTheme & firstColor() const;
50
const QVariantList & firstMonth() const;
51
const InfographicColorTheme & secondColor() const;
52
const QVariantList & secondMonth() const;
56
Q_DECLARE_PRIVATE(InfographicData)
59
class InfographicModelPrivate: QObject
63
explicit InfographicModelPrivate(InfographicModel *parent);
65
~InfographicModelPrivate();
68
typedef QSharedPointer<InfographicData> InfographicDataPtr;
69
typedef QMultiMap<QString, InfographicDataPtr> FakeDataMap;
71
InfographicModel * const q_ptr;
73
InfographicColorTheme m_firstColor;
74
QVariantListModel m_firstMonth;
75
InfographicColorTheme m_secondColor;
76
QVariantListModel m_secondMonth;
79
FakeDataMap::const_iterator m_dataIndex;
80
InfographicDataPtr m_newData;
81
FakeDataMap m_fakeData;
83
void setUsername(const QString &username);
88
void generateFakeData();
92
void finishSetFakeData();
95
Q_DECLARE_PUBLIC(InfographicModel)
99
#endif // INFOGRAPHICMODEL_PRIVATE_H