libyui
|
00001 /************************************************************************** 00002 Copyright (C) 2000 - 2010 Novell, Inc. 00003 All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License along 00016 with this program; if not, write to the Free Software Foundation, Inc., 00017 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 00019 **************************************************************************/ 00020 00021 00022 /*---------------------------------------------------------------------\ 00023 | | 00024 | __ __ ____ _____ ____ | 00025 | \ \ / /_ _/ ___|_ _|___ \ | 00026 | \ V / _` \___ \ | | __) | | 00027 | | | (_| |___) || | / __/ | 00028 | |_|\__,_|____/ |_| |_____| | 00029 | | 00030 | core system | 00031 | (C) SuSE GmbH | 00032 \----------------------------------------------------------------------/ 00033 00034 File: YRadioButton.h 00035 00036 Author: Stefan Hundhammer <sh@suse.de> 00037 00038 /-*/ 00039 00040 #ifndef YRadioButton_h 00041 #define YRadioButton_h 00042 00043 #include "YWidget.h" 00044 00045 class YRadioButtonGroup; 00046 class YRadioButtonPrivate; 00047 00048 using std::string; 00049 00067 class YRadioButton : public YWidget 00068 { 00069 protected: 00086 YRadioButton( YWidget * parent, const string & label ); 00087 00088 public: 00092 virtual ~YRadioButton(); 00093 00100 virtual const char * widgetClass() const { return "YRadioButton"; } 00101 00108 virtual bool value() = 0; 00109 00115 virtual void setValue( bool checked ) = 0; 00116 00120 string label() const; 00121 00128 virtual void setLabel( const string & label ); 00129 00133 bool useBoldFont() const; 00134 00141 virtual void setUseBoldFont( bool bold = true ); 00142 00146 YRadioButtonGroup * buttonGroup(); 00147 00161 virtual bool setProperty( const string & propertyName, 00162 const YPropertyValue & val ); 00163 00171 virtual YPropertyValue getProperty( const string & propertyName ); 00172 00179 virtual const YPropertySet & propertySet(); 00180 00186 virtual string shortcutString() const { return label(); } 00187 00193 virtual void setShortcutString( const string & str ) 00194 { setLabel( str ); } 00195 00200 const char * userInputProperty() { return YUIProperty_Value; } 00201 00202 protected: 00209 YRadioButtonGroup * findRadioButtonGroup() const; 00210 00217 virtual void saveUserInput( YMacroRecorder *macroRecorder ); 00218 00219 private: 00220 00221 ImplPtr<YRadioButtonPrivate> priv; 00222 }; 00223 00224 00225 #endif // YRadioButton_h