tdeui
tdecompletionbox.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef TDECOMPLETIONBOX_H
00024 #define TDECOMPLETIONBOX_H
00025
00026 class TQEvent;
00027 #include <tqstringlist.h>
00028 #include <tdelistbox.h>
00029
00043 class TDEUI_EXPORT TDECompletionBox : public TDEListBox
00044 {
00045 Q_OBJECT
00046 TQ_PROPERTY( bool isTabHandling READ isTabHandling WRITE setTabHandling )
00047 TQ_PROPERTY(TQString cancelledText READ cancelledText WRITE setCancelledText)
00048 TQ_PROPERTY( bool activateOnSelect READ activateOnSelect WRITE setActivateOnSelect )
00049
00050 public:
00057 TDECompletionBox( TQWidget *parent, const char *name = 0 );
00058
00062 ~TDECompletionBox();
00063
00064 virtual TQSize sizeHint() const;
00065
00071 bool activateOnSelect() const;
00072
00073 public slots:
00077 TQStringList items() const;
00078
00084 void insertItems( const TQStringList& items, int index = -1 );
00085
00089 void setItems( const TQStringList& items );
00090
00102 virtual void popup();
00103
00113 void setTabHandling( bool enable );
00114
00123 bool isTabHandling() const;
00124
00135 void setCancelledText( const TQString& txt);
00136
00140 TQString cancelledText() const;
00141
00149 void setActivateOnSelect(bool state);
00150
00151
00155 void down();
00156
00160 void up();
00161
00165 void pageDown();
00166
00170 void pageUp();
00171
00175 void home();
00176
00180 void end();
00181
00185 virtual void show();
00186
00190 virtual void hide();
00191
00192 signals:
00197 void activated( const TQString& );
00198
00203 void userCancelled( const TQString& );
00204
00205 protected:
00211 TQRect calculateGeometry() const;
00212
00216 void sizeAndPosition();
00217
00222 virtual bool eventFilter( TQObject *, TQEvent * );
00223
00224 protected slots:
00229 virtual void slotActivated( TQListBoxItem * );
00230
00231 private slots:
00232 void slotSetCurrentItem( TQListBoxItem *i ) { setCurrentItem( i ); }
00233 void slotCurrentChanged();
00234 void canceled();
00235 void slotItemClicked( TQListBoxItem * );
00236
00237 protected:
00238 virtual void virtual_hook( int id, void* data );
00239
00240 private:
00241 class TDECompletionBoxPrivate;
00242 TDECompletionBoxPrivate* const d;
00243 };
00244
00245
00246 #endif // TDECOMPLETIONBOX_H