klistviewsearchline.h00001
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
00044 class KDEUI_EXPORT KListViewSearchLine : public KLineEdit
00045 {
00046 Q_OBJECT
00047
00048 public:
00049
00057 KListViewSearchLine(QWidget *parent = 0, KListView *listView = 0, const char *name = 0);
00058
00063 KListViewSearchLine(QWidget *parent, const char *name);
00064
00068 virtual ~KListViewSearchLine();
00069
00075 bool caseSensitive() const;
00076
00083 QValueList<int> searchColumns() const;
00084
00091 bool keepParentsVisible() const;
00092
00098 KListView *listView() const;
00099
00100 public slots:
00105 virtual void updateSearch(const QString &s = QString::null);
00106
00112 void setCaseSensitive(bool cs);
00113
00124 void setKeepParentsVisible(bool v);
00125
00133 void setSearchColumns(const QValueList<int> &columns);
00134
00141 void setListView(KListView *lv);
00142
00143 protected:
00144
00150 virtual bool itemMatches(const QListViewItem *item, const QString &s) const;
00151
00157 virtual QPopupMenu *createPopupMenu();
00158
00159 protected slots:
00173 void queueSearch(const QString &search);
00174
00183 void activateSearch();
00184
00185 private:
00186
00191 void checkItemParentsNotVisible();
00192
00198 bool checkItemParentsVisible(QListViewItem *item, QListViewItem *highestHiddenParent = 0);
00199
00200 private slots:
00201 void itemAdded(QListViewItem *item) const;
00202 void listViewDeleted();
00203 void searchColumnsMenuActivated(int);
00204
00205 private:
00206 class KListViewSearchLinePrivate;
00207 KListViewSearchLinePrivate *d;
00208 };
00209
00216 class KDEUI_EXPORT KListViewSearchLineWidget : public QHBox
00217 {
00218 Q_OBJECT
00219
00220 public:
00225 KListViewSearchLineWidget(KListView *listView = 0, QWidget *parent = 0,
00226 const char *name = 0);
00227
00231 ~KListViewSearchLineWidget();
00232
00237 virtual KListViewSearchLine *createSearchLine(KListView *listView);
00238
00242 KListViewSearchLine *searchLine() const;
00243
00244 protected slots:
00251 virtual void createWidgets();
00252
00253 private slots:
00254 void positionInToolBar();
00255
00256 private:
00257 class KListViewSearchLineWidgetPrivate;
00258 KListViewSearchLineWidgetPrivate *d;
00259 };
00260
00261 #endif
|