libyui
YComboBox.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: YComboBox.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 #ifndef YComboBox_h
26 #define YComboBox_h
27 
28 #include "YSelectionWidget.h"
29 
30 class YComboBoxPrivate;
31 
32 
54 {
55 protected:
62  YComboBox( YWidget * parent, const std::string & label, bool editable );
63 
64 public:
68  virtual ~YComboBox();
69 
74  virtual const char * widgetClass() const { return "YComboBox"; }
75 
83  bool editable() const;
84 
94  std::string value();
95 
106  void setValue( const std::string & newText );
107 
117  virtual YItem * selectedItem();
118 
131  virtual YItemCollection selectedItems();
132 
138  virtual void selectItem( YItem * item, bool selected = true );
139 
146  std::string validChars();
147 
157  virtual void setValidChars( const std::string & validChars );
158 
165  int inputMaxLength() const;
166 
176  virtual void setInputMaxLength( int numberOfChars );
177 
188  virtual bool setProperty( const std::string & propertyName,
189  const YPropertyValue & val );
190 
197  virtual YPropertyValue getProperty( const std::string & propertyName );
198 
205  virtual const YPropertySet & propertySet();
206 
211  const char * userInputProperty() { return YUIProperty_Value; }
212 
213 
214 protected:
215 
223  virtual std::string text() = 0;
224 
234  virtual void setText( const std::string & newText ) = 0;
235 
236 
237 private:
238 
240 };
241 
242 
243 #endif // YComboBox_h
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition: YComboBox.cc:222
const char * userInputProperty()
Definition: YComboBox.h:211
bool editable() const
Definition: YComboBox.cc:66
Definition: YProperty.h:104
std::vector< YItem * > YItemCollection
Collection of pointers to YItem.
Definition: YItem.h:39
Definition: YSelectionWidget.h:45
virtual void setInputMaxLength(int numberOfChars)
Definition: YComboBox.cc:90
Definition: YProperty.h:197
void setValue(const std::string &newText)
Definition: YComboBox.cc:102
YWidget * parent() const
Definition: YWidget.cc:271
YComboBox(YWidget *parent, const std::string &label, bool editable)
Definition: YComboBox.cc:51
Definition: YComboBox.h:53
virtual void selectItem(YItem *item, bool selected=true)
Definition: YComboBox.cc:124
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition: YComboBox.cc:202
std::string label() const
Definition: YSelectionWidget.cc:99
virtual std::string text()=0
virtual const char * widgetClass() const
Definition: YComboBox.h:74
Definition: YItem.h:55
std::string validChars()
Definition: YComboBox.cc:72
virtual ~YComboBox()
Definition: YComboBox.cc:60
virtual YItem * selectedItem()
Definition: YComboBox.cc:138
Definition: YComboBox.cc:36
int inputMaxLength() const
Definition: YComboBox.cc:84
virtual void setText(const std::string &newText)=0
Definition: YWidget.h:54
virtual YItemCollection selectedItems()
Definition: YComboBox.cc:159
std::string value()
Definition: YComboBox.cc:96
virtual const YPropertySet & propertySet()
Definition: YComboBox.cc:174
virtual void setValidChars(const std::string &validChars)
Definition: YComboBox.cc:78