]> cloud.milkyroute.net Git - dolphin.git/blob - src/filterbar.h
2dd02d28d4b6af7dcd2d2c65a41ee2dc31133a3d
[dolphin.git] / src / filterbar.h
1 /***************************************************************************
2 * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
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 #ifndef FILTERBAR_H
21 #define FILTERBAR_H
22
23 #include <QWidget>
24
25 class QLabel;
26 class QToolButton;
27 class KLineEdit;
28 class DolphinMainWindow;
29
30 /**
31 * @brief Provides an input field for filtering the currently shown items.
32 *
33 * @author Gregor Kališnik <gregor@podnapisi.net>
34 * @author Peter Penz <peter.penz@gmx.at>
35 */
36 class FilterBar : public QWidget
37 {
38 Q_OBJECT
39
40 public:
41 FilterBar(QWidget* parent = 0);
42 virtual ~FilterBar();
43
44 signals:
45 /**
46 * Signal that reports the name filter has been
47 * changed to \a nameFilter.
48 */
49 void filterChanged(const QString& nameFilter);
50
51 /**
52 * Emitted as soon as the filterbar should get closed.
53 */
54 void closeRequest();
55
56 protected:
57 virtual void hideEvent(QHideEvent* event);
58 virtual void showEvent(QShowEvent* event);
59 virtual void keyReleaseEvent(QKeyEvent* event);
60
61 private slots:
62 void emitCloseRequest();
63
64 private:
65 QLabel* m_filter;
66 KLineEdit* m_filterInput;
67 QToolButton* m_close;
68 };
69
70 #endif