| 1 | // For license of this file, see <project-root-folder>/LICENSE.md. |
| 2 | |
| 3 | #ifndef FEEDSTOOLBAR_H |
| 4 | #define FEEDSTOOLBAR_H |
| 5 | |
| 6 | #include "core/feedsproxymodel.h" |
| 7 | #include "gui/reusable/searchlineedit.h" |
| 8 | #include "gui/toolbars/basetoolbar.h" |
| 9 | |
| 10 | class QWidgetAction; |
| 11 | |
| 12 | class FeedsToolBar : public BaseToolBar { |
| 13 | Q_OBJECT |
| 14 | |
| 15 | public: |
| 16 | explicit FeedsToolBar(const QString& title, QWidget* parent = nullptr); |
| 17 | |
| 18 | virtual QList<QAction*> availableActions() const; |
| 19 | virtual QList<QAction*> activatedActions() const; |
| 20 | virtual void saveAndSetActions(const QStringList& actions); |
| 21 | virtual QList<QAction*> convertActions(const QStringList& actions); |
| 22 | virtual void loadSpecificActions(const QList<QAction*>& actions, bool initial_load = false); |
| 23 | virtual QStringList defaultActions() const; |
| 24 | virtual QStringList savedActions() const; |
| 25 | virtual QList<QAction*> extraActions() const; |
| 26 | |
| 27 | SearchLineEdit* searchBox() const; |
| 28 | |
| 29 | signals: |
| 30 | void feedFilterChanged(FeedsProxyModel::FeedListFilter filter); |
| 31 | void searchCriteriaChanged(SearchLineEdit::SearchMode mode, |
| 32 | Qt::CaseSensitivity sensitivity, |
| 33 | int custom_criteria, |
| 34 | const QString& phrase); |
| 35 | |
| 36 | private slots: |
| 37 | void handleMessageFilterChange(QAction* action); |
| 38 | |
| 39 | private: |
| 40 | void initializeFilter(); |
| 41 | void initializeSearchBox(); |
| 42 | |
| 43 | private: |
| 44 | QWidgetAction* m_actionMessageFilter; |
| 45 | QToolButton* m_btnMessageFilter; |
| 46 | QMenu* m_menuMessageFilter; |
| 47 | |
| 48 | SearchLineEdit* m_txtSearchMessages; |
| 49 | QWidgetAction* m_actionSearchMessages; |
| 50 | }; |
| 51 | |
| 52 | #endif // FEEDSTOOLBAR_H |