00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KCOMPLETIONBOX_H
00023 #define KCOMPLETIONBOX_H
00024
00025 class QEvent;
00026 #include <qstringlist.h>
00027 #include <klistbox.h>
00028
00041 class KCompletionBox : public KListBox
00042 {
00043 Q_OBJECT
00044 Q_PROPERTY( bool isTabHandling READ isTabHandling WRITE setTabHandling )
00045 Q_PROPERTY(QString cancelledText READ cancelledText WRITE setCancelledText)
00046
00047 public:
00059 KCompletionBox( QWidget *parent, const char *name = 0 );
00060
00064 ~KCompletionBox();
00065
00066 virtual QSize sizeHint() const;
00067
00068 public slots:
00072 QStringList items() const;
00073
00079 void insertItems( const QStringList& items, int index = -1 );
00080
00084 void setItems( const QStringList& items );
00085
00097 virtual void popup();
00098
00108 void setTabHandling( bool enable );
00109
00118 bool isTabHandling() const;
00119
00130 void setCancelledText( const QString& );
00131
00135 QString cancelledText() const;
00136
00140 void down();
00141
00145 void up();
00146
00150 void pageDown();
00151
00155 void pageUp();
00156
00160 void home();
00161
00165 void end();
00166
00170 virtual void show();
00171
00175 virtual void hide();
00176
00177 signals:
00182 void activated( const QString& );
00183
00188 void userCancelled( const QString& );
00189
00190 protected:
00195 virtual bool eventFilter( QObject *, QEvent * );
00196
00197 protected slots:
00202 virtual void slotActivated( QListBoxItem * );
00203
00204 private slots:
00205 void slotSetCurrentItem( QListBoxItem *i ) { setCurrentItem( i ); }
00206 void slotCurrentChanged();
00207 void cancelled();
00208 void slotItemClicked( QListBoxItem * );
00209
00210 protected:
00211 virtual void virtual_hook( int id, void* data );
00212
00213 private:
00214 class KCompletionBoxPrivate;
00215 KCompletionBoxPrivate* d;
00216 };
00217
00218
00219 #endif // KCOMPLETIONBOX_H