]> cloud.milkyroute.net Git - dolphin.git/blob - src/filterbar/filterbar.h
Don't use the submodule-path for Qt-includes on application-level
[dolphin.git] / src / filterbar / filterbar.h
1 /***************************************************************************
2 * Copyright (C) 2006-2010 by Peter Penz <peter.penz19@gmail.com> *
3 * Copyright (C) 2006 by Gregor Kališnik <gregor@podnapisi.net> *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
20
21 #ifndef FILTERBAR_H
22 #define FILTERBAR_H
23
24 #include <QWidget>
25
26 class KLineEdit;
27
28 /**
29 * @brief Provides an input field for filtering the currently shown items.
30 *
31 * @author Gregor Kališnik <gregor@podnapisi.net>
32 */
33 class FilterBar : public QWidget
34 {
35 Q_OBJECT
36
37 public:
38 explicit FilterBar(QWidget* parent = 0);
39 virtual ~FilterBar();
40
41 /**
42 * Selects the whole text of the filter bar.
43 */
44 void selectAll();
45
46 public slots:
47 /** Clears the input field. */
48 void clear();
49
50 signals:
51 /**
52 * Signal that reports the name filter has been
53 * changed to \a nameFilter.
54 */
55 void filterChanged(const QString& nameFilter);
56
57 /**
58 * Emitted as soon as the filterbar should get closed.
59 */
60 void closeRequest();
61
62 protected:
63 virtual void showEvent(QShowEvent* event);
64 virtual void keyReleaseEvent(QKeyEvent* event);
65
66 private:
67 KLineEdit* m_filterInput;
68 };
69
70 #endif