kdeui Library API Documentation

kcompletionbox.h

00001 /* This file is part of the KDE libraries
00002 
00003    Copyright (c) 2000 Carsten Pfeiffer <pfeiffer@kde.org>
00004                  2000 Stefan Schimanski <1Stein@gmx.de>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License (LGPL) as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019    Boston, MA 02111-1307, USA.
00020 */
00021 
00022 #ifndef KCOMPLETIONBOX_H
00023 #define KCOMPLETIONBOX_H
00024 
00025 class QEvent;
00026 #include <qstringlist.h>
00027 #include <klistbox.h>
00028 
00042 class KDEUI_EXPORT KCompletionBox : public KListBox
00043 {
00044     Q_OBJECT
00045     Q_PROPERTY( bool isTabHandling READ isTabHandling WRITE setTabHandling )
00046     Q_PROPERTY(QString cancelledText READ cancelledText WRITE setCancelledText)
00047 
00048 public:
00055     KCompletionBox( QWidget *parent, const char *name = 0 );
00056 
00060     ~KCompletionBox();
00061 
00062     virtual QSize sizeHint() const;
00063 
00064 public slots:
00068     QStringList items() const;
00069 
00075     void insertItems( const QStringList& items, int index = -1 );
00076 
00080     void setItems( const QStringList& items );
00081 
00093     virtual void popup();
00094 
00104     void setTabHandling( bool enable );
00105 
00114     bool isTabHandling() const;
00115 
00126     void setCancelledText( const QString& txt);
00127 
00131     QString cancelledText() const;
00132 
00136     void down();
00137 
00141     void up();
00142 
00146     void pageDown();
00147 
00151     void pageUp();
00152 
00156     void home();
00157 
00161     void end();
00162 
00166     virtual void show();
00167 
00171     virtual void hide();
00172 
00173 signals:
00178     void activated( const QString& );
00179 
00184     void userCancelled( const QString& );
00185 
00186 protected:
00192     QRect calculateGeometry() const;
00193 
00197     void sizeAndPosition();
00198 
00203     virtual bool eventFilter( QObject *, QEvent * );
00204 
00205 protected slots:
00210     virtual void slotActivated( QListBoxItem * );
00211 
00212 private slots:
00213     void slotSetCurrentItem( QListBoxItem *i ) { setCurrentItem( i ); } // grrr
00214     void slotCurrentChanged();
00215     void canceled();
00216     void slotItemClicked( QListBoxItem * );
00217 
00218 protected:
00219     virtual void virtual_hook( int id, void* data );
00220 
00221 private:
00222     class KCompletionBoxPrivate;
00223     KCompletionBoxPrivate* const d;
00224 };
00225 
00226 
00227 #endif // KCOMPLETIONBOX_H
KDE Logo
This file is part of the documentation for kdeui Library Version 3.4.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Jul 21 13:14:01 2006 by doxygen 1.4.0 written by Dimitri van Heesch, © 1997-2003