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
class QEvent;
00027
#include <qstringlist.h>
00028
#include <klistbox.h>
00029
00043 class KDEUI_EXPORT KCompletionBox :
public KListBox
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 KCompletionBox(
QWidget *parent,
const char *name = 0 );
00058
00062 ~KCompletionBox();
00063
00064
virtual QSize sizeHint()
const;
00065
00071
bool activateOnSelect()
const;
00072
00073
public slots:
00077
QStringList items()
const;
00078
00084
void insertItems(
const QStringList& items,
int index = -1 );
00085
00089
void setItems(
const QStringList& items );
00090
00102
virtual void popup();
00103
00113
void setTabHandling(
bool enable );
00114
00123
bool isTabHandling()
const;
00124
00135
void setCancelledText(
const QString& txt);
00136
00140
QString 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 QString& );
00198
00203
void userCancelled(
const QString& );
00204
00205
protected:
00211
QRect calculateGeometry()
const;
00212
00216
void sizeAndPosition();
00217
00222
virtual bool eventFilter(
QObject *,
QEvent * );
00223
00224
protected slots:
00229
virtual void slotActivated(
QListBoxItem * );
00230
00231
private slots:
00232
void slotSetCurrentItem(
QListBoxItem *i ) { setCurrentItem( i ); }
00233
void slotCurrentChanged();
00234
void canceled();
00235
void slotItemClicked(
QListBoxItem * );
00236
00237
protected:
00238
virtual void virtual_hook(
int id,
void* data );
00239
00240
private:
00241
class KCompletionBoxPrivate;
00242 KCompletionBoxPrivate*
const d;
00243 };
00244
00245
00246
#endif // KCOMPLETIONBOX_H