1 /* 2 * SPDX-FileCopyrightText: 2014 Kevin Ottens <ervin@kde.org> 3 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 4 */ 5 6 7 8 #ifndef WIDGETS_FILTERWIDGET_H 9 #define WIDGETS_FILTERWIDGET_H 10 11 #include <QWidget> 12 13 class QComboBox; 14 class QLineEdit; 15 16 namespace Presentation 17 { 18 class TaskFilterProxyModel; 19 } 20 21 namespace Ui { 22 class FilterWidget; 23 } 24 25 namespace Widgets { 26 27 class FilterWidget : public QWidget 28 { 29 Q_OBJECT 30 public: 31 explicit FilterWidget(QWidget *parent = nullptr); 32 ~FilterWidget(); 33 34 Presentation::TaskFilterProxyModel *proxyModel() const; 35 36 public slots: 37 void clear(); 38 void setShowDoneTasks(bool show); 39 void setShowFutureTasks(bool show); 40 41 private slots: 42 void onTextChanged(const QString &text); 43 void onSortTypeChanged(int index); 44 void onAscendingClicked(); 45 void onDescendingClicked(); 46 47 private: 48 Ui::FilterWidget *ui; 49 Presentation::TaskFilterProxyModel *m_model; 50 }; 51 52 } 53 54 #endif // WIDGETS_FILTERWIDGET_H 55