Debian Codegraph @

src/imports/PerformanceMetrics/plugin/upmgraphmodel.h

raw
1 /*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
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 Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Florian Boucault <[email protected]>
17 */
18
19 #ifndef UPMGRAPHMODEL_H
20 #define UPMGRAPHMODEL_H
21
22 #include <QtCore/QObject>
23 #include <QtGui/QImage>
24
25 class UPMGraphModel : public QObject
26 {
27 Q_OBJECT
28
29 Q_PROPERTY(QImage image READ image NOTIFY imageChanged)
30 Q_PROPERTY(int shift READ shift NOTIFY shiftChanged)
31 Q_PROPERTY(int samples READ samples WRITE setSamples NOTIFY samplesChanged)
32 Q_PROPERTY(int currentValue READ currentValue NOTIFY currentValueChanged)
33
34 public:
35 explicit UPMGraphModel(QObject *parent = 0);
36
37 void appendValue(int width, int value);
38
39 // getters
40 QImage image() const;
41 int shift() const;
42 int samples() const;
43 int currentValue() const;
44
45 // setters
46 void setSamples(int samples);
47
48 Q_SIGNALS:
49 void imageChanged();
50 void shiftChanged();
51 void samplesChanged();
52 void currentValueChanged();
53
54 private:
55 QImage m_image;
56 int m_shift;
57 int m_samples;
58 int m_currentValue;
59 };
60
61 #endif // UPMGRAPHMODEL_H