libyui
YRadioButtonGroup.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: YRadioButtonGroup.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 #ifndef YRadioButtonGroup_h
26 #define YRadioButtonGroup_h
27 
28 #include "YSingleChildContainerWidget.h"
29 
30 class YRadioButton;
32 
33 typedef std::list<YRadioButton *> YRadioButtonList;
34 typedef YRadioButtonList::iterator YRadioButtonListIterator;
35 typedef YRadioButtonList::const_iterator YRadioButtonListConstIterator;
36 
37 
42 {
43 protected:
48 
49 public:
53  virtual ~YRadioButtonGroup();
54 
59  virtual const char * widgetClass() const { return "YRadioButtonGroup"; }
60 
64  YRadioButton * currentButton() const;
65 
69  YRadioButton * value() const { return currentButton(); }
70 
78  virtual void addRadioButton( YRadioButton * radioButton );
79 
89  virtual void removeRadioButton( YRadioButton * radioButton );
90 
96  void uncheckOtherButtons( YRadioButton * radioButton );
97 
111  virtual bool setProperty( const std::string & propertyName,
112  const YPropertyValue & val );
113 
121  virtual YPropertyValue getProperty( const std::string & propertyName );
122 
129  virtual const YPropertySet & propertySet();
130 
131 protected:
132 
140  YRadioButtonListConstIterator radioButtonsBegin() const;
141 
146  YRadioButtonListConstIterator radioButtonsEnd() const;
147 
151  int radioButtonsCount() const;
152 
153 
154 private:
155 
157 };
158 
159 
160 #endif // YRadioButtonGroup_h
Definition: YRadioButton.h:51
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition: YRadioButtonGroup.cc:161
Definition: YProperty.h:104
YRadioButtonGroup(YWidget *parent)
Definition: YRadioButtonGroup.cc:48
Definition: YRadioButtonGroup.h:41
Definition: YProperty.h:197
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition: YRadioButtonGroup.cc:145
YWidget * parent() const
Definition: YWidget.cc:271
Definition: YRadioButtonGroup.cc:36
Definition: YSingleChildContainerWidget.h:34
virtual void addRadioButton(YRadioButton *radioButton)
Definition: YRadioButtonGroup.cc:83
YRadioButtonListConstIterator radioButtonsBegin() const
Definition: YRadioButtonGroup.cc:62
virtual const char * widgetClass() const
Definition: YRadioButtonGroup.h:59
virtual ~YRadioButtonGroup()
Definition: YRadioButtonGroup.cc:56
YRadioButtonListConstIterator radioButtonsEnd() const
Definition: YRadioButtonGroup.cc:69
YRadioButton * value() const
Definition: YRadioButtonGroup.h:69
virtual const YPropertySet & propertySet()
Definition: YRadioButtonGroup.cc:125
void uncheckOtherButtons(YRadioButton *radioButton)
Definition: YRadioButtonGroup.cc:97
int radioButtonsCount() const
Definition: YRadioButtonGroup.cc:76
Definition: YWidget.h:54
YRadioButton * currentButton() const
Definition: YRadioButtonGroup.cc:110
virtual void removeRadioButton(YRadioButton *radioButton)
Definition: YRadioButtonGroup.cc:90