00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: YComboBox.h 00014 00015 Author: Stefan Hundhammer <sh@suse.de> 00016 00017 /-*/ 00018 00019 #ifndef YComboBox_h 00020 #define YComboBox_h 00021 00022 #include "YSelectionWidget.h" 00023 #include <ycp/YCPString.h> 00024 #include <ycp/YCPList.h> 00025 00026 class YMacroRecorder; 00027 00031 class YComboBox : public YSelectionWidget 00032 { 00033 public: 00037 YComboBox( const YWidgetOpt & opt, YCPString label ); 00038 00043 bool editable() const { return _editable; } 00044 00049 virtual char *widgetClass() { return "YComboBox"; } 00050 00054 YCPValue changeWidget( const YCPSymbol & property, const YCPValue & newvalue ); 00055 00059 YCPValue queryWidget( const YCPSymbol & property ); 00060 00067 virtual void setValidChars( const YCPString & validChars ); 00068 00072 YCPString getValidChars(); 00073 00079 virtual void setInputMaxLength( const YCPInteger & numberOfChars ); 00080 00085 const char *userInputProperty() { return YUIProperty_Value; } 00086 00087 00088 protected: 00092 virtual YCPString getValue() const = 0; 00093 00098 virtual void setValue( const YCPString & new_value ) = 0; 00099 00104 virtual int getCurrentItem() const = 0; 00105 00110 virtual void setCurrentItem( int index ) = 0; 00111 00112 private: 00118 virtual void saveUserInput( YMacroRecorder *macroRecorder ); 00119 00123 YCPString validChars; 00124 00128 bool _editable; 00129 }; 00130 00131 00132 #endif // YComboBox_h