]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/YQCheckBox.h
don't create QObjects in ycp thread - make timeouts work
[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 <QCheckBox>
24 #include "YCheckBox.h"
25
26 class YQCheckBox : public QCheckBox, public YCheckBox
27 {
28     Q_OBJECT
29
30 public:
31
32     /**
33      * Constructor.
34      **/
35     YQCheckBox( YWidget *       parent,
36                 const string &  label,
37                 bool            checked );
38
39     /**
40      * Destructor.
41      **/
42     virtual ~YQCheckBox();
43
44     /**
45      * Get the current value:
46      *
47      * YCheckBox_on             CheckBox is checked
48      * YCheckBox_off            CheckBox is unchecked
49      *
50      * YCheckBox_dont_care      tri-state: CheckBox is greyed out,
51      *                          neither checked nor unchecked
52      *
53      * Reimplemented from YCheckBox.
54      **/
55     virtual YCheckBoxState value();
56
57     /**
58      * Set the CheckBox value (on/off/don't care).
59      *
60      * Reimplemented from YCheckBox.
61      **/
62     virtual void setValue( YCheckBoxState state );
63
64     /**
65      * Change the label (the text) on the RadioButton.
66      *
67      * Reimplemented from YRadioButton.
68      **/
69     virtual void setLabel( const string & label );
70
71     /**
72      * Use a bold font.
73      *
74      * Reimplemented from YRadioButton.
75      **/
76     virtual void setUseBoldFont( bool bold = true );
77
78     /**
79      * Set enabled / disabled state.
80      *
81      * Reimplemented from YWidget.
82      **/
83     virtual void setEnabled( bool enabled );
84
85     /**
86      * Preferred width of the widget.
87      *
88      * Reimplemented from YWidget.
89      **/
90     virtual int preferredWidth();
91
92     /**
93      * Preferred height of the widget.
94      *
95      * Reimplemented from YWidget.
96      **/
97     virtual int preferredHeight();
98
99     /**
100      * Set the new size of the widget.
101      *
102      * Reimplemented from YWidget.
103      **/
104     virtual void setSize( int newWidth, int newHeight );
105
106     /**
107      * Accept the keyboard focus.
108      *
109      * Reimplemented from YWidget.
110      **/
111     virtual bool setKeyboardFocus();
112
113
114 private slots:
115
116     /**
117      * Triggered when the on/off status is changed
118      **/
119     void stateChanged ( int newState );
120
121 };
122
123 #endif // YQCheckBox_h