~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to plasma/generic/applets/system-monitor/plotter.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   Copyright (C) 2010 Petri Damsten <damu@iki.fi>
 
3
 *
 
4
 *   This program is free software; you can redistribute it and/or modify
 
5
 *   it under the terms of the GNU Library General Public License version 2 as
 
6
 *   published by the Free Software Foundation
 
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 General Public License for more details
 
12
 *
 
13
 *   You should have received a copy of the GNU Library General Public
 
14
 *   License along with this program; if not, write to the
 
15
 *   Free Software Foundation, Inc.,
 
16
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
17
 */
 
18
 
 
19
#ifndef SM_PLOTTER_HEADER
 
20
#define SM_PLOTTER_HEADER
 
21
 
 
22
#include <QGraphicsWidget>
 
23
 
 
24
#include "sm_export.h"
 
25
 
 
26
class QGraphicsLinearLayout;
 
27
 
 
28
namespace Plasma {
 
29
    class Meter;
 
30
    class SignalPlotter;
 
31
    class Frame;
 
32
}
 
33
 
 
34
namespace SM {
 
35
 
 
36
class SM_EXPORT Plotter : public QGraphicsWidget
 
37
{
 
38
        Q_OBJECT
 
39
    public:
 
40
        Plotter(QGraphicsItem* parent = 0, Qt::WindowFlags wFlags = 0);
 
41
        ~Plotter();
 
42
 
 
43
        void addSample(const QList<double>& values);
 
44
        void setAnalog(bool analog);
 
45
        void setMinMax(double min, double max);
 
46
        const QString& title();
 
47
        void setTitle(const QString& title);
 
48
        void setUnit(const QString& unit);
 
49
        void setPlotCount(int count);
 
50
        void setCustomPlots(const QList<QColor>& colors);
 
51
        void setScale(qreal scale);
 
52
        void setStackPlots(bool stack);
 
53
 
 
54
    protected slots:
 
55
        void themeChanged();
 
56
 
 
57
    protected:
 
58
        void createWidgets();
 
59
        void setOverlayText(const QString& text);
 
60
        virtual void resizeEvent(QGraphicsSceneResizeEvent* event);
 
61
 
 
62
    private:
 
63
        QGraphicsLinearLayout *m_layout;
 
64
        Plasma::SignalPlotter *m_plotter;
 
65
        Plasma::Meter *m_meter;
 
66
        int m_plotCount;
 
67
        QString m_title;
 
68
        QString m_unit;
 
69
        double m_min;
 
70
        double m_max;
 
71
        Plasma::Frame* m_overlayFrame;
 
72
        bool m_showAnalogValue;
 
73
};
 
74
 
 
75
}
 
76
 
 
77
#endif