]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/YQProgressBar.h
- Don't create layouts with parent. Qt 4.x automatically reparents
[duncan/yast2-qt4.git] / src / YQProgressBar.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:       YQProgressBar.h
14
15   Author:     Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19
20 #ifndef YQProgressBar_h
21 #define YQProgressBar_h
22
23 #include <QFrame>
24 #include "YProgressBar.h"
25
26
27 class QString;
28 class YQWidgetCaption;
29 class QProgressBar;
30
31 class YQProgressBar : public QFrame, public YProgressBar
32 {
33     Q_OBJECT
34
35 public:
36     /**
37      * Constructor.
38      **/
39     YQProgressBar( YWidget *            parent,
40                    const string &       label,
41                    int                  maxValue = 100 );
42     /**
43      * Destructor.
44      **/
45     virtual ~YQProgressBar();
46
47     /**
48      * Set the label (the caption above the progress bar).
49      *
50      * Reimplemented from YProgressBar.
51      **/
52     virtual void setLabel( const string & label );
53
54     /**
55      * Set the current progress value ( <= maxValue() ).
56      *
57      * Reimplemented from YProgressBar.
58      **/
59     virtual void setValue( int newValue );
60
61     /**
62      * Set enabled/disabled state.
63      *
64      * Reimplemented from YWidget.
65      **/
66     virtual void setEnabled( bool enabled );
67
68     /**
69      * Preferred width of the widget.
70      *
71      * Reimplemented from YWidget.
72      **/
73     virtual int preferredWidth();
74
75     /**
76      * Preferred height of the widget.
77      *
78      * Reimplemented from YWidget.
79      **/
80     virtual int preferredHeight();
81
82     /**
83      * Set the new size of the widget.
84      *
85      * Reimplemented from YWidget.
86      **/
87     virtual void setSize( int newWidth, int newHeight );
88
89     /**
90      * Accept the keyboard focus.
91      **/
92     virtual bool setKeyboardFocus();
93
94
95 protected:
96
97     YQWidgetCaption *   _caption;
98     QProgressBar *      _qt_progressbar;
99 };
100
101 #endif // YQProgressBar_h