]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/YQCheckBox.h
compile
[duncan/yast2-qt4.git] / src / YQCheckBox.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:       YQCheckBox.h
14
15   Author:     Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19
20 #ifndef YQCheckBox_h
21 #define YQCheckBox_h
22
23 #include <Q3GroupBox>
24 #include "YCheckBox.h"
25
26
27 class QCheckBox;
28
29 class YQCheckBox : public Q3GroupBox, public YCheckBox
30 {
31     Q_OBJECT
32
33 public:
34
35     /**
36      * Constructor.
37      **/
38     YQCheckBox( YWidget *       parent,
39                 const string &  label,
40                 bool            checked );
41
42     /**
43      * Destructor.
44      **/
45     virtual ~YQCheckBox();
46
47     /**
48      * Get the current value:
49      *
50      * YCheckBox_on             CheckBox is checked
51      * YCheckBox_off            CheckBox is unchecked
52      *
53      * YCheckBox_dont_care      tri-state: CheckBox is greyed out,
54      *                          neither checked nor unchecked
55      *
56      * Reimplemented from YCheckBox.
57      **/
58     virtual YCheckBoxState value();
59
60     /**
61      * Set the CheckBox value (on/off/don't care).
62      *
63      * Reimplemented from YCheckBox.
64      **/
65     virtual void setValue( YCheckBoxState state );
66
67     /**
68      * Change the label (the text) on the RadioButton.
69      *
70      * Reimplemented from YRadioButton.
71      **/
72     virtual void setLabel( const string & label );
73
74     /**
75      * Use a bold font.
76      *
77      * Reimplemented from YRadioButton.
78      **/
79     virtual void setUseBoldFont( bool bold = true );
80
81     /**
82      * Set enabled / disabled state.
83      *
84      * Reimplemented from YWidget.
85      **/
86     virtual void setEnabled( bool enabled );
87
88     /**
89      * Preferred width of the widget.
90      *
91      * Reimplemented from YWidget.
92      **/
93     virtual int preferredWidth();
94
95     /**
96      * Preferred height of the widget.
97      *
98      * Reimplemented from YWidget.
99      **/
100     virtual int preferredHeight();
101
102     /**
103      * Set the new size of the widget.
104      *
105      * Reimplemented from YWidget.
106      **/
107     virtual void setSize( int newWidth, int newHeight );
108
109     /**
110      * Accept the keyboard focus.
111      *
112      * Reimplemented from YWidget.
113      **/
114     virtual bool setKeyboardFocus();
115
116
117 private slots:
118
119     /**
120      * Triggered when the on/off status is changed
121      **/
122     void stateChanged ( int newState );
123
124
125 protected:
126
127     QCheckBox * _qt_checkBox;
128 };
129
130 #endif // YQCheckBox_h