MythTV master
mythnews.h
Go to the documentation of this file.
1#ifndef MYTHNEWS_H
2#define MYTHNEWS_H
3
4// MythTV headers
6
7// MythNews headers
8#include "newssite.h"
9
10class QTimer;
11class HttpComms;
12class MythUIText;
13class MythUIImage;
14class MythDialogBox;
17
22{
23 Q_OBJECT
24
25 public:
26 MythNews(MythScreenStack *parent, const QString &name);
27 ~MythNews() override;
28
29 bool Create(void) override; // MythScreenType
30 bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
31 void customEvent(QEvent *event) override; // MythUIType
32
33 private:
34 void updateInfoView(void);
35 void clearSites(void);
36 void cancelRetrieve(void);
37 void processAndShowNews(NewsSite *site);
38 static QString cleanText(const QString &text);
39
40 static void playVideo(const NewsArticle &article);
41
42 // menu stuff
43 void ShowMenu(void) override; // MythScreenType
44 void deleteNewsSite(void);
45 void ShowEditDialog(bool edit);
46 void ShowFeedManager() const;
47
48 mutable QRecursiveMutex m_lock;
50
51 QTimer *m_retrieveTimer {nullptr};
52 std::chrono::minutes m_timerTimeout {10min};
53 std::chrono::minutes m_updateFreq {30min};
54
55 QString m_zoom {"1.0"};
56 QString m_browser;
58
61 QMap<MythUIButtonListItem*,NewsArticle> m_articles;
62
67
72
73 private slots:
74 void loadSites(void);
76 void slotViewArticle(MythUIButtonListItem *articlesListItem);
77 void slotRetrieveNews(void);
78 void slotNewsRetrieved(NewsSite *site);
80};
81
82#endif /* MYTHNEWS_H */
Basic menu dialog, message and a list of options.
Plugin for browsing RSS news feeds.
Definition: mythnews.h:22
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythnews.cpp:362
QRecursiveMutex m_lock
Definition: mythnews.h:48
void loadSites(void)
Definition: mythnews.cpp:153
void slotViewArticle(MythUIButtonListItem *articlesListItem)
Definition: mythnews.cpp:501
std::chrono::minutes m_timerTimeout
Definition: mythnews.h:52
MythUIText * m_nositesText
Definition: mythnews.h:63
void slotNewsRetrieved(NewsSite *site)
Definition: mythnews.cpp:417
static QString cleanText(const QString &text)
Definition: mythnews.cpp:682
MythUIImage * m_enclosureImage
Definition: mythnews.h:70
MythUIText * m_updatedText
Definition: mythnews.h:64
static void playVideo(const NewsArticle &article)
Definition: mythnews.cpp:648
MythUIImage * m_thumbnailImage
Definition: mythnews.h:68
void clearSites(void)
Definition: mythnews.cpp:127
void ShowFeedManager() const
Definition: mythnews.cpp:581
void cancelRetrieve(void)
Definition: mythnews.cpp:432
MythUIText * m_titleText
Definition: mythnews.h:65
MythDialogBox * m_menuPopup
Definition: mythnews.h:57
MythUIImage * m_podcastImage
Definition: mythnews.h:71
void updateInfoView(void)
NewsSite::List m_newsSites
Definition: mythnews.h:49
MythUIButtonList * m_sitesList
Definition: mythnews.h:59
QString m_zoom
Definition: mythnews.h:55
MythUIText * m_descText
Definition: mythnews.h:66
void processAndShowNews(NewsSite *site)
Definition: mythnews.cpp:443
void ShowMenu(void) override
Definition: mythnews.cpp:598
std::chrono::minutes m_updateFreq
Definition: mythnews.h:53
void deleteNewsSite(void)
Definition: mythnews.cpp:630
void ShowEditDialog(bool edit)
Definition: mythnews.cpp:549
bool Create(void) override
Definition: mythnews.cpp:75
QMap< MythUIButtonListItem *, NewsArticle > m_articles
Definition: mythnews.h:61
MythUIButtonList * m_articlesList
Definition: mythnews.h:60
MythNews(MythScreenStack *parent, const QString &name)
Creates a new MythNews Screen.
Definition: mythnews.cpp:43
void slotSiteSelected(MythUIButtonListItem *item)
Definition: mythnews.cpp:477
QTimer * m_retrieveTimer
Definition: mythnews.h:51
void customEvent(QEvent *event) override
Definition: mythnews.cpp:655
QString m_browser
Definition: mythnews.h:56
~MythNews() override
Definition: mythnews.cpp:70
MythUIImage * m_downloadImage
Definition: mythnews.h:69
void slotRetrieveNews(void)
Definition: mythnews.cpp:395
Screen in which all other widgets are contained and rendered.
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:98
All purpose text widget, displays a text string.
Definition: mythuitext.h:29