File indexing completed on 2025-01-05 04:59:46

0001 /*
0002  * SPDX-FileCopyrightText: 2014 Kevin Ottens <ervin@kde.org>
0003  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004  */
0005 
0006 
0007 
0008 #ifndef WIDGETS_FILTERWIDGET_H
0009 #define WIDGETS_FILTERWIDGET_H
0010 
0011 #include <QWidget>
0012 
0013 class QComboBox;
0014 class QLineEdit;
0015 
0016 namespace Presentation
0017 {
0018     class TaskFilterProxyModel;
0019 }
0020 
0021 namespace Ui {
0022     class FilterWidget;
0023 }
0024 
0025 namespace Widgets {
0026 
0027 class FilterWidget : public QWidget
0028 {
0029     Q_OBJECT
0030 public:
0031     explicit FilterWidget(QWidget *parent = nullptr);
0032     ~FilterWidget();
0033 
0034     Presentation::TaskFilterProxyModel *proxyModel() const;
0035 
0036 public slots:
0037     void clear();
0038     void setShowDoneTasks(bool show);
0039     void setShowFutureTasks(bool show);
0040 
0041 private slots:
0042     void onTextChanged(const QString &text);
0043     void onSortTypeChanged(int index);
0044     void onAscendingClicked();
0045     void onDescendingClicked();
0046 
0047 private:
0048     Ui::FilterWidget *ui;
0049     Presentation::TaskFilterProxyModel *m_model;
0050 };
0051 
0052 }
0053 
0054 #endif // WIDGETS_FILTERWIDGET_H