00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: YQMultiLineEdit.h 00014 00015 Author: Stefan Hundhammer <sh@suse.de> 00016 00017 /-*/ 00018 00019 // -*- c++ -*- 00020 00021 #ifndef YQMultiLineEdit_h 00022 #define YQMultiLineEdit_h 00023 00024 #include <qvbox.h> 00025 #include <qlabel.h> 00026 #include <ycp/YCPString.h> 00027 00028 #include "YMultiLineEdit.h" 00029 00030 #define DEFAULT_VISIBLE_LINES 3 00031 00032 00033 class QTextEdit; 00034 00035 class YQMultiLineEdit : public QVBox, public YMultiLineEdit 00036 { 00037 Q_OBJECT 00038 00039 public: 00043 YQMultiLineEdit( QWidget * parent, 00044 const YWidgetOpt & opt, 00045 const YCPString & label, 00046 const YCPString & initialText ); 00047 00053 void setEnabling( bool enabled ); 00054 00060 long nicesize( YUIDimension dim ); 00061 00065 void setSize( long newWidth, long newHeight ); 00066 00070 bool setKeyboardFocus(); 00071 00075 void setLabel( const YCPString & newLabel ); 00076 00081 void setText( const YCPString & text ); 00082 00087 YCPString text(); 00088 00092 int visibleLines() const { return DEFAULT_VISIBLE_LINES; } 00093 00094 00095 00096 protected slots: 00100 void changed(); 00101 00102 00103 protected: 00104 00105 QLabel * _qt_label; 00106 QTextEdit * _qt_textedit; 00107 }; 00108 00109 00110 #endif // YQMultiLineEdit_h