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
11 #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
);
55 void changeEvent(QEvent
* event
) override
;
58 void updateTagsMenu();
59 void updateTagsMenuItems(const QUrl
&, const KFileItemList
& items
);
62 void setRating(const int stars
);
63 void setTimespan(const QDate
& date
);
64 void addSearchTag(const QString
& tag
);
65 void removeSearchTag(const QString
& tag
);
67 void initComboBox(QComboBox
* combo
);
68 void updateTagsSelector();
71 QComboBox
* m_typeSelector
;
72 QComboBox
* m_dateSelector
;
73 QComboBox
* m_ratingSelector
;
74 QToolButton
* m_tagsSelector
;
76 QStringList m_searchTags
;
77 KCoreDirLister m_tagsLister
;