File: ColorTheme.h

package info (click to toggle)
libusermetrics 1.3.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,324 kB
  • sloc: cpp: 7,182; xml: 131; sh: 106; ansic: 60; makefile: 26
file content (112 lines) | stat: -rw-r--r-- 2,344 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
 * Copyright (C) 2013 Canonical, Ltd.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of version 3 of the GNU Lesser General Public License as published
 * by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Author: Pete Woods <pete.woods@canonical.com>
 */

#ifndef USERMETRICSOUTPUT_COLORTHEME_H_
#define USERMETRICSOUTPUT_COLORTHEME_H_

#include <QtCore/QObject>
#include <QtGui/QColor>

/**
 * @{
 **/

namespace UserMetricsOutput {

/**
 * @brief ColorTheme for a particular user metric
 *
 * Each ColorTheme has a start, middle (main) and
 * end QColor.
 **/
class Q_DECL_EXPORT ColorTheme: public QObject {
Q_OBJECT

/**
 * @brief First / start QColor in the ColorTheme.
 */
Q_PROPERTY(QColor start READ start NOTIFY startChanged FINAL)

/**
 * @brief Middle / main QColor in the ColorTheme.
 */
Q_PROPERTY(QColor main READ main NOTIFY mainChanged FINAL)

/**
 * @brief Last / end QColor in the ColorTheme.
 */
Q_PROPERTY(QColor end READ end NOTIFY endChanged FINAL)

protected:
	/**
	 * @brief Unusable constructor - class is pure-virtual.
	 *
	 * @param parent
	 */
	explicit ColorTheme(QObject *parent = 0);

public:
	/**
	 * @brief Destructor
	 */
	virtual ~ColorTheme();

	/**
	 * @brief First / start QColor in the ColorTheme.
	 */
	virtual QColor start() const = 0;

	/**
	 * @brief Middle / main QColor in the ColorTheme.
	 */
	virtual QColor main() const = 0;

	/**
	 * @brief Last / end QColor in the ColorTheme.
	 */
	virtual QColor end() const = 0;

Q_SIGNALS:
	/**
	 * @brief The first / start QColor has changed.
	 *
	 * @param color
	 */
	void startChanged(const QColor &color);

	/**
	 * @brief The middle / main QColor has changed.
	 *
	 * @param color
	 */
	void mainChanged(const QColor &color);

	/**
	 * @brief The first / end QColor has changed.
	 *
	 * @param color
	 */
	void endChanged(const QColor &color);

};

}

/*@}*/

#endif // USERMETRICSOUTPUT_COLORTHEME_H_