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: YRadioButtonGroup.h 00035 00036 Author: Stefan Hundhammer <sh@suse.de> 00037 00038 /-*/ 00039 00040 #ifndef YRadioButtonGroup_h 00041 #define YRadioButtonGroup_h 00042 00043 #include "YSingleChildContainerWidget.h" 00044 00045 class YRadioButton; 00046 class YRadioButtonGroupPrivate; 00047 00048 typedef std::list<YRadioButton *> YRadioButtonList; 00049 typedef YRadioButtonList::iterator YRadioButtonListIterator; 00050 typedef YRadioButtonList::const_iterator YRadioButtonListConstIterator; 00051 00052 00053 class YRadioButtonGroup : public YSingleChildContainerWidget 00054 { 00055 protected: 00059 YRadioButtonGroup( YWidget * parent ); 00060 00061 public: 00065 virtual ~YRadioButtonGroup(); 00066 00071 virtual const char * widgetClass() const { return "YRadioButtonGroup"; } 00072 00076 YRadioButton * currentButton() const; 00077 00081 YRadioButton * value() const { return currentButton(); } 00082 00090 virtual void addRadioButton( YRadioButton * radioButton ); 00091 00101 virtual void removeRadioButton( YRadioButton * radioButton ); 00102 00108 void uncheckOtherButtons( YRadioButton * radioButton ); 00109 00123 virtual bool setProperty( const string & propertyName, 00124 const YPropertyValue & val ); 00125 00133 virtual YPropertyValue getProperty( const std::string & propertyName ); 00134 00141 virtual const YPropertySet & propertySet(); 00142 00143 protected: 00144 00152 YRadioButtonListConstIterator radioButtonsBegin() const; 00153 00158 YRadioButtonListConstIterator radioButtonsEnd() const; 00159 00163 int radioButtonsCount() const; 00164 00165 00166 private: 00167 00168 ImplPtr<YRadioButtonGroupPrivate> priv; 00169 }; 00170 00171 00172 #endif // YRadioButtonGroup_h