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