klistviewsearchline.h
/* This file is part of the KDE libraries
Copyright (c) 2003 Scott Wheeler <wheeler@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 version 2 as published by the Free Software Foundation.
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 KLISTVIEWSEARCHLINE_H
#define KLISTVIEWSEARCHLINE_H
#include <klineedit.h>
#include <qhbox.h>
class KListView;
class QListViewItem;
class QToolButton;
class KDEUI_EXPORT KListViewSearchLine : public KLineEdit
{
Q_OBJECT
public:
KListViewSearchLine(QWidget *parent = 0, KListView *listView = 0, const char *name = 0);
KListViewSearchLine(QWidget *parent, const char *name);
virtual ~KListViewSearchLine();
bool caseSensitive() const;
QValueList<int> searchColumns() const;
bool keepParentsVisible() const;
KListView *listView() const;
public slots:
virtual void updateSearch(const QString &s = QString::null);
void setCaseSensitive(bool cs);
void setKeepParentsVisible(bool v);
void setSearchColumns(const QValueList<int> &columns);
void setListView(KListView *lv);
protected:
virtual bool itemMatches(const QListViewItem *item, const QString &s) const;
virtual QPopupMenu *createPopupMenu();
protected slots:
void queueSearch(const QString &search);
void activateSearch();
private:
void checkItemParentsNotVisible();
bool checkItemParentsVisible(QListViewItem *item, QListViewItem *highestHiddenParent = 0);
private slots:
void itemAdded(QListViewItem *item) const;
void listViewDeleted();
void searchColumnsMenuActivated(int);
private:
class KListViewSearchLinePrivate;
KListViewSearchLinePrivate *d;
};
class KDEUI_EXPORT KListViewSearchLineWidget : public QHBox
{
Q_OBJECT
public:
KListViewSearchLineWidget(KListView *listView = 0, QWidget *parent = 0,
const char *name = 0);
~KListViewSearchLineWidget();
virtual KListViewSearchLine *createSearchLine(KListView *listView);
KListViewSearchLine *searchLine() const;
protected slots:
virtual void createWidgets();
private slots:
void positionInToolBar();
private:
class KListViewSearchLineWidgetPrivate;
KListViewSearchLineWidgetPrivate *d;
};
#endif
KListViewSearchLine
This class makes it easy to add a search line for filtering the items in a listview based on a simple...
Definition: klistviewsearchline.h:47
KLineEdit::createPopupMenu
virtual QPopupMenu * createPopupMenu()
Re-implemented for internal reasons.
Definition: klineedit.cpp:862
KListView
This Widget extends the functionality of QListView to honor the system wide settings for Single Click...
Definition: klistview.h:53
KListViewSearchLineWidget
Creates a widget featuring a KListViewSearchLine, a label with the text "Search" and a button to clea...
Definition: klistviewsearchline.h:219
KLineEdit
An enhanced QLineEdit widget for inputting text.
Definition: klineedit.h:145

KDE Home | KDE Accessibility Home | Description of Access Keys