kdeui
klistviewsearchline.h
Go to the documentation of this file.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
00047 class KDEUI_EXPORT KListViewSearchLine : public KLineEdit
00048 {
00049 Q_OBJECT
00050
00051 public:
00052
00060 KListViewSearchLine(QWidget *parent = 0, KListView *listView = 0, const char *name = 0);
00061
00066 KListViewSearchLine(QWidget *parent, const char *name);
00067
00071 virtual ~KListViewSearchLine();
00072
00078 bool caseSensitive() const;
00079
00086 QValueList<int> searchColumns() const;
00087
00094 bool keepParentsVisible() const;
00095
00101 KListView *listView() const;
00102
00103 public slots:
00108 virtual void updateSearch(const QString &s = QString::null);
00109
00115 void setCaseSensitive(bool cs);
00116
00127 void setKeepParentsVisible(bool v);
00128
00136 void setSearchColumns(const QValueList<int> &columns);
00137
00144 void setListView(KListView *lv);
00145
00146 protected:
00147
00153 virtual bool itemMatches(const QListViewItem *item, const QString &s) const;
00154
00160 virtual QPopupMenu *createPopupMenu();
00161
00162 protected slots:
00176 void queueSearch(const QString &search);
00177
00186 void activateSearch();
00187
00188 private:
00189
00194 void checkItemParentsNotVisible();
00195
00201 bool checkItemParentsVisible(QListViewItem *item, QListViewItem *highestHiddenParent = 0);
00202
00203 private slots:
00204 void itemAdded(QListViewItem *item) const;
00205 void listViewDeleted();
00206 void searchColumnsMenuActivated(int);
00207
00208 private:
00209 class KListViewSearchLinePrivate;
00210 KListViewSearchLinePrivate *d;
00211 };
00212
00219 class KDEUI_EXPORT KListViewSearchLineWidget : public QHBox
00220 {
00221 Q_OBJECT
00222
00223 public:
00228 KListViewSearchLineWidget(KListView *listView = 0, QWidget *parent = 0,
00229 const char *name = 0);
00230
00234 ~KListViewSearchLineWidget();
00235
00240 virtual KListViewSearchLine *createSearchLine(KListView *listView);
00241
00245 KListViewSearchLine *searchLine() const;
00246
00247 protected slots:
00254 virtual void createWidgets();
00255
00256 private slots:
00257 void positionInToolBar();
00258
00259 private:
00260 class KListViewSearchLineWidgetPrivate;
00261 KListViewSearchLineWidgetPrivate *d;
00262 };
00263
00264 #endif