// For license of this file, see /LICENSE.md. #ifndef ARTICLELISTNOTIFICATION_H #define ARTICLELISTNOTIFICATION_H #include "gui/notifications/basetoastnotification.h" #include "core/message.h" #include "ui_articlelistnotification.h" class Feed; class ArticleListNotificationModel; class ArticleListNotification : public BaseToastNotification { Q_OBJECT public: explicit ArticleListNotification(QWidget* parent = nullptr); void loadResults(const QHash>& new_messages); signals: void openingArticleInArticleListRequested(Feed* feed, const Message& msg); void reloadMessageListRequested(bool mark_selected_messages_read); public: virtual bool eventFilter(QObject* watched, QEvent* event); private slots: void openArticleInArticleList(); void onMessageSelected(const QModelIndex& current, const QModelIndex& previous); void showFeed(int index); void openArticleInWebBrowser(); void markAllRead(); private: void markAsRead(Feed* feed, const QList& articles); Feed* selectedFeed(int index = -1) const; Message selectedMessage() const; private: Ui::ArticleListNotification m_ui; ArticleListNotificationModel* m_model; QHash> m_newMessages; }; #endif // ARTICLELISTNOTIFICATION_H