kcompletionbox.h
/* This file is part of the KDE libraries
Copyright (c) 2000 Carsten Pfeiffer <pfeiffer@kde.org>
2000 Stefan Schimanski <1Stein@gmx.de>
2000,2001,2002,2003,2004 Dawit Alemayehu <adawit@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License (LGPL) as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KCOMPLETIONBOX_H
#define KCOMPLETIONBOX_H
class QEvent;
#include <qstringlist.h>
#include <klistbox.h>
class KDEUI_EXPORT KCompletionBox : public KListBox
{
Q_OBJECT
Q_PROPERTY( bool isTabHandling READ isTabHandling WRITE setTabHandling )
Q_PROPERTY(QString cancelledText READ cancelledText WRITE setCancelledText)
Q_PROPERTY( bool activateOnSelect READ activateOnSelect WRITE setActivateOnSelect )
public:
KCompletionBox( QWidget *parent, const char *name = 0 );
~KCompletionBox();
virtual QSize sizeHint() const;
bool activateOnSelect() const;
public slots:
QStringList items() const;
void insertItems( const QStringList& items, int index = -1 );
void setItems( const QStringList& items );
virtual void popup();
void setTabHandling( bool enable );
bool isTabHandling() const;
void setCancelledText( const QString& txt);
QString cancelledText() const;
void setActivateOnSelect(bool state);
void down();
void up();
void pageDown();
void pageUp();
void home();
void end();
virtual void show();
virtual void hide();
signals:
void activated( const QString& );
void userCancelled( const QString& );
protected:
QRect calculateGeometry() const;
void sizeAndPosition();
virtual bool eventFilter( QObject *, QEvent * );
protected slots:
virtual void slotActivated( QListBoxItem * );
private slots:
void slotSetCurrentItem( QListBoxItem *i ) { setCurrentItem( i ); } // grrr
void slotCurrentChanged();
void canceled();
void slotItemClicked( QListBoxItem * );
protected:
virtual void virtual_hook( int id, void* data );
private:
class KCompletionBoxPrivate;
KCompletionBoxPrivate* const d;
};
#endif // KCOMPLETIONBOX_H
KCompletionBox
A helper widget for "completion-widgets" (KLineEdit, KComboBox))
Definition: kcompletionbox.h:43
KListBox
A variant of QListBox that honors KDE's system-wide settings.
Definition: klistbox.h:40

KDE Home | KDE Accessibility Home | Description of Access Keys