libyui
YRadioButton.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: YRadioButton.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 #ifndef YRadioButton_h
26 #define YRadioButton_h
27 
28 #include "YWidget.h"
29 
30 class YRadioButtonGroup;
32 
33 
51 class YRadioButton : public YWidget
52 {
53 protected:
70  YRadioButton( YWidget * parent, const std::string & label );
71 
72 public:
76  virtual ~YRadioButton();
77 
84  virtual const char * widgetClass() const { return "YRadioButton"; }
85 
92  virtual bool value() = 0;
93 
99  virtual void setValue( bool checked ) = 0;
100 
104  std::string label() const;
105 
112  virtual void setLabel( const std::string & label );
113 
117  bool useBoldFont() const;
118 
125  virtual void setUseBoldFont( bool bold = true );
126 
131 
145  virtual bool setProperty( const std::string & propertyName,
146  const YPropertyValue & val );
147 
155  virtual YPropertyValue getProperty( const std::string & propertyName );
156 
163  virtual const YPropertySet & propertySet();
164 
170  virtual std::string shortcutString() const { return label(); }
171 
177  virtual void setShortcutString( const std::string & str )
178  { setLabel( str ); }
179 
184  const char * userInputProperty() { return YUIProperty_Value; }
185 
186 
187 protected:
188 
196 
203  virtual void saveUserInput( YMacroRecorder * macroRecorder );
204 
205 private:
206 
208 };
209 
210 
211 #endif // YRadioButton_h
Definition: YRadioButton.h:51
Definition: YMacroRecorder.h:38
virtual void setLabel(const std::string &label)
Definition: YRadioButton.cc:88
virtual ~YRadioButton()
Definition: YRadioButton.cc:78
std::string label() const
Definition: YRadioButton.cc:94
Definition: YProperty.h:104
virtual void setUseBoldFont(bool bold=true)
Definition: YRadioButton.cc:106
Definition: YRadioButtonGroup.h:41
Definition: YProperty.h:197
YWidget * parent() const
Definition: YWidget.cc:271
bool useBoldFont() const
Definition: YRadioButton.cc:100
YRadioButtonGroup * buttonGroup()
Definition: YRadioButton.cc:164
virtual std::string shortcutString() const
Definition: YRadioButton.h:170
Definition: YRadioButton.cc:40
virtual bool value()=0
YRadioButton(YWidget *parent, const std::string &label)
Definition: YRadioButton.cc:61
virtual void setShortcutString(const std::string &str)
Definition: YRadioButton.h:177
YRadioButtonGroup * findRadioButtonGroup() const
Definition: YRadioButton.cc:176
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition: YRadioButton.cc:134
virtual void setValue(bool checked)=0
virtual const YPropertySet & propertySet()
Definition: YRadioButton.cc:113
virtual const char * widgetClass() const
Definition: YRadioButton.h:84
virtual void saveUserInput(YMacroRecorder *macroRecorder)
Definition: YRadioButton.cc:195
const char * userInputProperty()
Definition: YRadioButton.h:184
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition: YRadioButton.cc:150
Definition: YWidget.h:54