2 * SPDX-FileCopyrightText: 2012 Peter Penz <peter.penz19@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0-or-later
7 #ifndef DOLPHINFACETSWIDGET_H
8 #define DOLPHINFACETSWIDGET_H
10 #include <KCoreDirLister>
19 * @brief Allows to filter search-queries by facets.
21 * TODO: The current implementation is a temporary
22 * workaround for the 4.9 release and represents no
23 * real facets-implementation yet: There have been
24 * some Dolphin specific user-interface and interaction
25 * issues since 4.6 by embedding the Nepomuk facet-widget
26 * into a QDockWidget (this is unrelated to the
27 * Nepomuk facet-widget itself). Now in combination
28 * with the search-shortcuts in the Places Panel some
29 * existing issues turned into real showstoppers.
31 * So the longterm plan is to use the Nepomuk facets
32 * again as soon as possible.
34 class DolphinFacetsWidget
: public QWidget
39 explicit DolphinFacetsWidget(QWidget
*parent
= nullptr);
40 ~DolphinFacetsWidget() override
;
42 QStringList
searchTerms() const;
43 QString
facetType() const;
45 bool isSearchTerm(const QString
&term
) const;
46 void setSearchTerm(const QString
&term
);
47 void resetSearchTerms();
49 void setFacetType(const QString
&type
);
51 QSize
minimumSizeHint() const override
;
57 void changeEvent(QEvent
*event
) override
;
60 void updateTagsMenu();
61 void updateTagsMenuItems(const QUrl
&, const KFileItemList
&items
);
64 void setRating(const int stars
);
65 void setTimespan(const QDate
&date
);
66 void addSearchTag(const QString
&tag
);
67 void removeSearchTag(const QString
&tag
);
68 void resetSearchTags();
70 void initComboBox(QComboBox
*combo
);
71 void updateTagsSelector();
74 QComboBox
*m_typeSelector
;
75 QComboBox
*m_dateSelector
;
76 QComboBox
*m_ratingSelector
;
77 QToolButton
*m_tagsSelector
;
79 QStringList m_searchTags
;
80 KCoreDirLister m_tagsLister
;
81 QAction
*m_clearTagsAction
;