]> cloud.milkyroute.net Git - dolphin.git/blob - src/search/dolphinfacetswidget.h
Merge branch 'KDE/4.9'
[dolphin.git] / src / search / dolphinfacetswidget.h
1 /***************************************************************************
2 * Copyright (C) 2012 by Peter Penz <peter.penz19@gmail.com> *
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 DOLPHINFACETSWIDGET_H
21 #define DOLPHINFACETSWIDGET_H
22
23 #include <QWidget>
24
25 #include <config-nepomuk.h>
26 #ifdef HAVE_NEPOMUK
27 #include <Nepomuk2/Query/Term>
28 #endif
29
30 class QButtonGroup;
31 class QCheckBox;
32 class QRadioButton;
33
34 /**
35 * @brief Allows to filter search-queries by facets.
36 *
37 * TODO: The current implementation is a temporary
38 * workaround for the 4.9 release and represents no
39 * real facets-implementation yet: There have been
40 * some Dolphin specific user-interface and interaction
41 * issues since 4.6 by embedding the Nepomuk facet-widget
42 * into a QDockWidget (this is unrelated to the
43 * Nepomuk facet-widget itself). Now in combination
44 * with the search-shortcuts in the Places Panel some
45 * existing issues turned into real showstoppers.
46 *
47 * So the longterm plan is to use the Nepomuk facets
48 * again as soon as possible.
49 */
50 class DolphinFacetsWidget : public QWidget
51 {
52 Q_OBJECT
53
54 public:
55 explicit DolphinFacetsWidget(QWidget* parent = 0);
56 virtual ~DolphinFacetsWidget();
57
58 #ifdef HAVE_NEPOMUK
59 Nepomuk2::Query::Term facetsTerm() const;
60 #endif
61
62 signals:
63 void facetChanged();
64
65 private:
66 /**
67 * @return New checkbox which is connected to the
68 * slotFacedChanged() slot whenever it has
69 * been toggled.
70 */
71 QCheckBox* createCheckBox(const QString& text);
72
73 /**
74 * @return New radiobutton which is connected to the
75 * slotFacedChanged() slot whenever it has
76 * been toggled.
77 */
78 QRadioButton* createRadioButton(const QString& text,
79 QButtonGroup* group);
80
81 private:
82 QCheckBox* m_documents;
83 QCheckBox* m_images;
84 QCheckBox* m_audio;
85 QCheckBox* m_videos;
86
87 QRadioButton* m_anytime;
88 QRadioButton* m_today;
89 QRadioButton* m_yesterday;
90 QRadioButton* m_thisWeek;
91 QRadioButton* m_thisMonth;
92 QRadioButton* m_thisYear;
93
94 QRadioButton* m_anyRating;
95 QRadioButton* m_oneOrMore;
96 QRadioButton* m_twoOrMore;
97 QRadioButton* m_threeOrMore;
98 QRadioButton* m_fourOrMore;
99 QRadioButton* m_maxRating;
100 };
101
102 #endif