]> cloud.milkyroute.net Git - dolphin.git/blob - src/panels/filter/filterpanel.h
Use capitalized KDE includes
[dolphin.git] / src / panels / filter / filterpanel.h
1 /***************************************************************************
2 * Copyright (C) 2010 by Sebastian Trueg <trueg@kde.org> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
19
20 #ifndef FILTERPANEL_H
21 #define FILTERPANEL_H
22
23 #include <Nepomuk/Query/Query>
24 #include <panels/panel.h>
25
26 class KJob;
27
28 namespace Nepomuk {
29 namespace Utils {
30 class FacetWidget;
31 }
32 }
33
34 /**
35 * @brief Allows the filtering of search results.
36 */
37 class FilterPanel : public Panel
38 {
39 Q_OBJECT
40
41 public:
42 FilterPanel(QWidget* parent = 0);
43 virtual ~FilterPanel();
44
45 signals:
46 void urlActivated(const KUrl& url);
47
48 protected:
49 /** @see Panel::urlChanged() */
50 virtual bool urlChanged();
51
52 /** @see QWidget::showEvent() */
53 virtual void showEvent(QShowEvent* event);
54
55 /** @see QWidget::hideEvent() */
56 virtual void hideEvent(QHideEvent* event);
57
58 /** @see QWidget::contextMenuEvent() */
59 virtual void contextMenuEvent(QContextMenuEvent* event);
60
61 private slots:
62 void slotSetUrlStatFinished(KJob*);
63 void slotQueryTermChanged(const Nepomuk::Query::Term& term);
64
65 private:
66 void setQuery(const Nepomuk::Query::Query& query);
67
68 private:
69 bool m_initialized;
70 KJob* m_lastSetUrlStatJob;
71
72 KUrl m_startedFromDir;
73 Nepomuk::Utils::FacetWidget* m_facetWidget;
74 Nepomuk::Query::Query m_unfacetedRestQuery;
75 };
76
77 #endif // FILTERPANEL_H