]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/YQBarGraph.h
YQPkgTextDialog
[duncan/yast2-qt4.git] / src / YQBarGraph.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:       YQBarGraph.h
14
15   Author:     Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19
20 #ifndef YQBarGraph_h
21 #define YQBarGraph_h
22
23 #include "qframe.h"
24 #include "YBarGraph.h"
25
26 class QPainter;
27
28
29 class YQBarGraph : public QFrame, public YBarGraph
30 {
31     Q_OBJECT
32
33 public:
34
35     /**
36      * Constructor.
37      **/
38     YQBarGraph( YWidget * parent );
39
40     /**
41      * Destructor.
42      **/
43     virtual ~YQBarGraph();
44
45     /**
46      * Perform a visual update on the screen.
47      *
48      * Implemented from YBarGraph.
49      **/
50     virtual void doUpdate();
51
52     /**
53      * Set enabled/disabled state.
54      *
55      * Reimplemented from YWidget.
56      **/
57     virtual void setEnabled( bool enabled );
58
59     /**
60      * Preferred width of the widget.
61      *
62      * Reimplemented from YWidget.
63      **/
64     virtual int preferredWidth();
65
66     /**
67      * Preferred height of the widget.
68      *
69      * Reimplemented from YWidget.
70      **/
71     virtual int preferredHeight();
72
73     /**
74      * Set the new size of the widget.
75      *
76      * Reimplemented from YWidget.
77      **/
78     virtual void setSize( int newWidth, int newHeight );
79
80     
81 protected:
82
83     /**
84      * Draw the contents.
85      *
86      * Reimplemented from QFrame.
87      **/
88     virtual void paintEvent( QPaintEvent * painter );
89
90     /**
91      * Return one from a set of default segment background colors.
92      **/
93     YColor defaultSegmentColor( unsigned index );
94
95     /**
96      * Return one from a set of default text colors. This text color is
97      * guaranteed to contrast with the defaultSegmentColor with the same index.
98      **/
99     YColor defaultTextColor( unsigned index );
100 };
101
102
103 #endif // YQBarGraph_h