libyui

/data/gitorious.org/libyui/libyui-master/src/YComboBox.h

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 |                       \ V / _` \___ \ | |   __) |                    |
00026 |                        | | (_| |___) || |  / __/                     |
00027 |                        |_|\__,_|____/ |_| |_____|                    |
00028 |                                                                      |
00029 |                               core system                            |
00030 |                                                        (C) SuSE GmbH |
00031 \----------------------------------------------------------------------/
00032 
00033   File:         YComboBox.h
00034 
00035   Author:       Stefan Hundhammer <sh@suse.de>
00036 
00037 /-*/
00038 
00039 #ifndef YComboBox_h
00040 #define YComboBox_h
00041 
00042 #include "YSelectionWidget.h"
00043 
00044 class YComboBoxPrivate;
00045 
00046 
00067 class YComboBox : public YSelectionWidget
00068 {
00069 protected:
00076     YComboBox( YWidget * parent, const string & label, bool editable );
00077 
00078 public:
00082     virtual ~YComboBox();
00083 
00088     virtual const char * widgetClass() const { return "YComboBox"; }
00089 
00097     bool editable() const;
00098 
00108     string value();
00109 
00120     void setValue( const string & newText );
00121 
00131     virtual YItem * selectedItem();
00132 
00145     virtual YItemCollection selectedItems();
00146 
00152     virtual void selectItem( YItem * item, bool selected = true );
00153 
00160     string validChars();
00161 
00171     virtual void setValidChars( const string & validChars );
00172 
00179     int inputMaxLength() const;
00180 
00190     virtual void setInputMaxLength( int numberOfChars );
00191 
00202     virtual bool setProperty( const string & propertyName,
00203                               const YPropertyValue & val );
00204 
00211     virtual YPropertyValue getProperty( const string & propertyName );
00212 
00219     virtual const YPropertySet & propertySet();
00220     
00225     const char * userInputProperty() { return YUIProperty_Value; }
00226 
00227 
00228 protected:
00229 
00237     virtual string text() = 0;
00238 
00248     virtual void setText( const string & newText ) = 0;
00249 
00250 
00251 private:
00252 
00253     ImplPtr<YComboBoxPrivate> priv;
00254 };
00255 
00256 
00257 #endif // YComboBox_h
 All Classes Functions Variables Enumerations Friends