libyui-qt  2.49.2
YQCheckBox.h
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: YQCheckBox.h
20 
21  Author: Stefan Hundhammer <sh@suse.de>
22 
23 /-*/
24 
25 
26 #ifndef YQCheckBox_h
27 #define YQCheckBox_h
28 
29 #include <QCheckBox>
30 #include <yui/YCheckBox.h>
31 
32 class YQCheckBox : public QCheckBox, public YCheckBox
33 {
34  Q_OBJECT
35 
36 public:
37 
38  /**
39  * Constructor.
40  **/
41  YQCheckBox( YWidget * parent,
42  const std::string & label,
43  bool checked );
44 
45  /**
46  * Destructor.
47  **/
48  virtual ~YQCheckBox();
49 
50  /**
51  * Get the current value:
52  *
53  * YCheckBox_on CheckBox is checked
54  * YCheckBox_off CheckBox is unchecked
55  *
56  * YCheckBox_dont_care tri-state: CheckBox is greyed out,
57  * neither checked nor unchecked
58  *
59  * Reimplemented from YCheckBox.
60  **/
61  virtual YCheckBoxState value();
62 
63  /**
64  * Set the CheckBox value (on/off/don't care).
65  *
66  * Reimplemented from YCheckBox.
67  **/
68  virtual void setValue( YCheckBoxState state );
69 
70  /**
71  * Change the label (the text) on the RadioButton.
72  *
73  * Reimplemented from YRadioButton.
74  **/
75  virtual void setLabel( const std::string & label );
76 
77  /**
78  * Use a bold font.
79  *
80  * Reimplemented from YRadioButton.
81  **/
82  virtual void setUseBoldFont( bool bold = true );
83 
84  /**
85  * Set enabled / disabled state.
86  *
87  * Reimplemented from YWidget.
88  **/
89  virtual void setEnabled( bool enabled );
90 
91  /**
92  * Preferred width of the widget.
93  *
94  * Reimplemented from YWidget.
95  **/
96  virtual int preferredWidth();
97 
98  /**
99  * Preferred height of the widget.
100  *
101  * Reimplemented from YWidget.
102  **/
103  virtual int preferredHeight();
104 
105  /**
106  * Set the new size of the widget.
107  *
108  * Reimplemented from YWidget.
109  **/
110  virtual void setSize( int newWidth, int newHeight );
111 
112  /**
113  * Accept the keyboard focus.
114  *
115  * Reimplemented from YWidget.
116  **/
117  virtual bool setKeyboardFocus();
118 
119 
120 private slots:
121 
122  /**
123  * Triggered when the on/off status is changed
124  **/
125  void stateChanged ( int newState );
126 
127 };
128 
129 #endif // YQCheckBox_h
YQCheckBox(YWidget *parent, const std::string &label, bool checked)
Constructor.
Definition: YQCheckBox.cc:41
virtual void setValue(YCheckBoxState state)
Set the CheckBox value (on/off/don&#39;t care).
Definition: YQCheckBox.cc:77
virtual bool setKeyboardFocus()
Accept the keyboard focus.
Definition: YQCheckBox.cc:141
virtual ~YQCheckBox()
Destructor.
Definition: YQCheckBox.cc:56
virtual YCheckBoxState value()
Get the current value:
Definition: YQCheckBox.cc:63
virtual int preferredWidth()
Preferred width of the widget.
Definition: YQCheckBox.cc:123
virtual void setUseBoldFont(bool bold=true)
Use a bold font.
Definition: YQCheckBox.cc:106
virtual void setSize(int newWidth, int newHeight)
Set the new size of the widget.
Definition: YQCheckBox.cc:135
virtual void setLabel(const std::string &label)
Change the label (the text) on the RadioButton.
Definition: YQCheckBox.cc:99
virtual int preferredHeight()
Preferred height of the widget.
Definition: YQCheckBox.cc:129
virtual void setEnabled(bool enabled)
Set enabled / disabled state.
Definition: YQCheckBox.cc:116