00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: YQComboBox.h 00014 00015 Author: Stefan Hundhammer <sh@suse.de> 00016 00017 /-*/ 00018 00019 // -*- c++ -*- 00020 00021 #ifndef YQComboBox_h 00022 #define YQComboBox_h 00023 00024 #include <qvbox.h> 00025 #include <ycp/YCPString.h> 00026 00027 #include "YComboBox.h" 00028 00029 00030 class QLabel; 00031 class QComboBox; 00032 class QY2CharValidator; 00033 00034 00035 class YQComboBox : public QVBox, public YComboBox 00036 { 00037 Q_OBJECT 00038 00039 public: 00040 00041 YQComboBox( QWidget * parent, const YWidgetOpt & opt, const YCPString & label ); 00042 00048 void setEnabling( bool enabled ); 00049 00055 long nicesize( YUIDimension dim ); 00056 00060 void setSize( long newWidth, long newHeight ); 00061 00065 void setLabel( const YCPString & label ); 00066 00072 void setValidChars( const YCPString & validChars ); 00073 00079 void itemAdded( const YCPString & itemText, int itemIndex, bool selected ); 00080 00085 YCPString getValue() const; 00086 00092 void setValue( const YCPString & new_value ); 00093 00099 int getCurrentItem() const; 00100 00106 void setCurrentItem( int index ); 00107 00111 virtual bool setKeyboardFocus(); 00112 00113 00114 protected slots: 00115 00120 void slotSelected( int i ); 00121 00127 void textChanged( const QString &new_text ); 00128 00129 00130 protected: 00131 00132 // 00133 // Data members 00134 // 00135 00136 QLabel * _qt_label; 00137 QComboBox * _qt_combo_box; 00138 QY2CharValidator * _validator; 00139 }; 00140 00141 00142 #endif // YQLabel_h