summaryrefslogtreecommitdiff
path: root/src/libpcp_qed/src/qed_bar.h
blob: 8aafe3603bcd814f5493f05e85778c2912c8643e (plain)
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
/*
 * Copyright (c) 2013-2014, Red Hat.
 * 
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.
 * 
 * This program 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 General Public License
 * for more details.
 */
#ifndef QED_BAR_H
#define QED_BAR_H

#include <QtGui>
#include "qed_gadget.h"
#include "qed_colorlist.h"

class QedBar : public QedGadget
{
    Q_OBJECT

public:
    QedBar(QWidget *parent, int x, int y, int w, int h);
    void setMinimum(double min);
    void setMaximum(double max);
    void setColor(const char *color);
    void setOrientation(Qt::Orientation);
    void setScaleRange(int range);

protected:
    virtual void paintEvent(QPaintEvent *);
    virtual void resizeEvent(QResizeEvent *);

    struct {
	QColor		color;
	Qt::Orientation	oriented;
	int		scaleRange;
	double		minimum;
	double		maximum;
    } my;
};

class QedMultiBar : public QedBar
{
    Q_OBJECT

public:
    QedMultiBar(QWidget *parent, int x, int y, int w, int h,
		QedColorList *l, int history);
    void setOutline(bool);
    void setMaximum(double, bool);
};

class QedBarGraph : public QedBar
{
    Q_OBJECT

public:
    QedBarGraph(QWidget *parent, int x, int y, int w, int h, int history);
    void clipRange();
};

#endif // QED_BAR_H