]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/search/dolphinfacetswidget.h
Build TerminalPanel also on Windows
[dolphin.git] / src / search / dolphinfacetswidget.h
index 916e056081e98a44130a0937884084fec00813b0..1e8ab6cea745affe57cf1c8ccc6b3dce503ecc76 100644 (file)
 
 #include <QWidget>
 
-class QCheckBox;
+class QButtonGroup;
+class QDate;
 class QRadioButton;
 
 /**
  * @brief Allows to filter search-queries by facets.
  *
  * TODO: The current implementation is a temporary
- * workaround for the 4.10 release and represents no
+ * workaround for the 4.9 release and represents no
  * real facets-implementation yet: There have been
  * some Dolphin specific user-interface and interaction
  * issues since 4.6 by embedding the Nepomuk facet-widget
@@ -46,14 +47,39 @@ class DolphinFacetsWidget : public QWidget
     Q_OBJECT
 
 public:
-    explicit DolphinFacetsWidget(QWidget* parent = 0);
-    virtual ~DolphinFacetsWidget();
+    explicit DolphinFacetsWidget(QWidget* parent = nullptr);
+    ~DolphinFacetsWidget() override;
+
+    QString ratingTerm() const;
+    QString facetType() const;
+
+    bool isRatingTerm(const QString& term) const;
+    void setRatingTerm(const QString& term);
+
+    void setFacetType(const QString& type);
+
+signals:
+    void facetChanged();
+
+private:
+    void setRating(const int stars);
+    void setTimespan(const QDate& date);
+
+    /**
+     * @return New radiobutton which is connected to the
+     *         slotFacedChanged() slot whenever it has
+     *         been toggled.
+     */
+    QRadioButton* createRadioButton(const QString& text,
+                                    QButtonGroup* group);
 
 private:
-    QCheckBox* m_documents;
-    QCheckBox* m_images;
-    QCheckBox* m_audio;
-    QCheckBox* m_videos;
+    QRadioButton* m_anyType;
+    QRadioButton* m_folders;
+    QRadioButton* m_documents;
+    QRadioButton* m_images;
+    QRadioButton* m_audio;
+    QRadioButton* m_videos;
 
     QRadioButton* m_anytime;
     QRadioButton* m_today;