KDEUI
kcompletionbox.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef KCOMPLETIONBOX_H
00024 #define KCOMPLETIONBOX_H
00025
00026 #include <klistwidget.h>
00027
00028 class QEvent;
00029
00043 class KDEUI_EXPORT KCompletionBox : public KListWidget
00044 {
00045 Q_OBJECT
00046 Q_PROPERTY( bool isTabHandling READ isTabHandling WRITE setTabHandling )
00047 Q_PROPERTY(QString cancelledText READ cancelledText WRITE setCancelledText)
00048 Q_PROPERTY( bool activateOnSelect READ activateOnSelect WRITE setActivateOnSelect )
00049
00050 public:
00057 explicit KCompletionBox( QWidget *parent = 0 );
00058
00062 ~KCompletionBox();
00063
00064 virtual QSize sizeHint() const;
00065
00069 bool activateOnSelect() const;
00070
00071 public Q_SLOTS:
00075 QStringList items() const;
00076
00082 void insertItems( const QStringList& items, int index = -1 );
00083
00087 void setItems( const QStringList& items );
00088
00100 virtual void popup();
00101
00112 void setTabHandling( bool enable );
00113
00122 bool isTabHandling() const;
00123
00134 void setCancelledText( const QString& txt);
00135
00139 QString cancelledText() const;
00140
00147 void setActivateOnSelect(bool state);
00148
00149
00153 void down();
00154
00158 void up();
00159
00163 void pageDown();
00164
00168 void pageUp();
00169
00173 void home();
00174
00178 void end();
00179
00183 virtual void setVisible( bool visible );
00184
00185 Q_SIGNALS:
00190 void activated( const QString& );
00191
00196 void userCancelled( const QString& );
00197
00198 protected:
00204 QRect calculateGeometry() const;
00205
00209 void sizeAndPosition();
00210
00215 virtual bool eventFilter( QObject *, QEvent * );
00216
00221 virtual QPoint globalPositionHint() const;
00222
00223 protected Q_SLOTS:
00228 virtual void slotActivated( QListWidgetItem * );
00229
00230 private Q_SLOTS:
00231 void slotCurrentChanged();
00232 void canceled();
00233 void slotItemClicked( QListWidgetItem * );
00234
00235 private:
00236 class KCompletionBoxPrivate;
00237 KCompletionBoxPrivate* const d;
00238 };
00239
00240
00241 #endif // KCOMPLETIONBOX_H