00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
#ifndef KLISTVIEWSEARCHLINE_H
00020
#define KLISTVIEWSEARCHLINE_H
00021
00022
#include <klineedit.h>
00023
#include <qhbox.h>
00024
00025
class KListView;
00026
class QListViewItem;
00027
class QToolButton;
00028
00039 class KDEUI_EXPORT KListViewSearchLine :
public KLineEdit
00040 {
00041 Q_OBJECT
00042
00043
public:
00044
00052 KListViewSearchLine(
QWidget *parent = 0,
KListView *listView = 0,
const char *name = 0);
00053
00058 KListViewSearchLine(
QWidget *parent,
const char *name);
00059
00063
virtual ~KListViewSearchLine();
00064
00070
bool caseSensitive()
const;
00071
00078
QValueList<int> searchColumns()
const;
00079
00086
bool keepParentsVisible()
const;
00087
00093
KListView *listView()
const;
00094
00095
public slots:
00100
virtual void updateSearch(
const QString &s = QString::null);
00101
00107
void setCaseSensitive(
bool cs);
00108
00119
void setKeepParentsVisible(
bool v);
00120
00128
void setSearchColumns(
const QValueList<int> &columns);
00129
00136
void setListView(
KListView *lv);
00137
00138
protected:
00139
00145
virtual bool itemMatches(
const QListViewItem *item,
const QString &s)
const;
00146
00152
virtual QPopupMenu *
createPopupMenu();
00153
00154
protected slots:
00168
void queueSearch(
const QString &search);
00169
00178
void activateSearch();
00179
00180
private:
00181
00186
void checkItemParentsNotVisible();
00187
00193
bool checkItemParentsVisible(
QListViewItem *item);
00194
00195
private slots:
00196
void itemAdded(
QListViewItem *item)
const;
00197
void listViewDeleted();
00198
void searchColumnsMenuActivated(
int);
00199
00200
private:
00201
class KListViewSearchLinePrivate;
00202 KListViewSearchLinePrivate *d;
00203 };
00204
00211 class KDEUI_EXPORT KListViewSearchLineWidget :
public QHBox
00212 {
00213 Q_OBJECT
00214
00215
public:
00220 KListViewSearchLineWidget(
KListView *listView = 0,
QWidget *parent = 0,
00221
const char *name = 0);
00222
00226 ~KListViewSearchLineWidget();
00227
00232
virtual KListViewSearchLine *createSearchLine(
KListView *listView);
00233
00237 KListViewSearchLine *searchLine()
const;
00238
00239
protected slots:
00246
virtual void createWidgets();
00247
00248
private slots:
00249
void positionInToolBar();
00250
00251
private:
00252
class KListViewSearchLineWidgetPrivate;
00253 KListViewSearchLineWidgetPrivate *d;
00254 };
00255
00256
#endif