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 void ShowMenu(void) override; // MythScreenType
31 bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
32
33 protected:
34 void customEvent(QEvent *event) override; // MythUIType
35
36 private:
37 void updateInfoView(void);
38 void clearSites(void);
39 void cancelRetrieve(void);
40 void processAndShowNews(NewsSite *site);
41 static QString cleanText(const QString &text);
42
43 static void playVideo(const NewsArticle &article);
44
45 // menu stuff
46 void deleteNewsSite(void);
47 void ShowEditDialog(bool edit);
48 void ShowFeedManager() const;
49
50 mutable QRecursiveMutex m_lock;
52
53 QTimer *m_retrieveTimer {nullptr};
54 std::chrono::minutes m_timerTimeout {10min};
55 std::chrono::minutes m_updateFreq {30min};
56
57 QString m_zoom {"1.0"};
58 QString m_browser;
60
63 QMap<MythUIButtonListItem*,NewsArticle> m_articles;
64
69
74
75 private slots:
76 void loadSites(void);
78 void slotViewArticle(MythUIButtonListItem *articlesListItem);
79 void slotRetrieveNews(void);
80 void slotNewsRetrieved(NewsSite *site);
82};
83
84#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:363
QRecursiveMutex m_lock
Definition: mythnews.h:50
void loadSites(void)
Definition: mythnews.cpp:154
void slotViewArticle(MythUIButtonListItem *articlesListItem)
Definition: mythnews.cpp:502
std::chrono::minutes m_timerTimeout
Definition: mythnews.h:54
MythUIText * m_nositesText
Definition: mythnews.h:65
void slotNewsRetrieved(NewsSite *site)
Definition: mythnews.cpp:418
static QString cleanText(const QString &text)
Definition: mythnews.cpp:683
MythUIImage * m_enclosureImage
Definition: mythnews.h:72
MythUIText * m_updatedText
Definition: mythnews.h:66
static void playVideo(const NewsArticle &article)
Definition: mythnews.cpp:649
MythUIImage * m_thumbnailImage
Definition: mythnews.h:70
void clearSites(void)
Definition: mythnews.cpp:128
void ShowFeedManager() const
Definition: mythnews.cpp:582
void cancelRetrieve(void)
Definition: mythnews.cpp:433
MythUIText * m_titleText
Definition: mythnews.h:67
MythDialogBox * m_menuPopup
Definition: mythnews.h:59
MythUIImage * m_podcastImage
Definition: mythnews.h:73
void updateInfoView(void)
NewsSite::List m_newsSites
Definition: mythnews.h:51
MythUIButtonList * m_sitesList
Definition: mythnews.h:61
QString m_zoom
Definition: mythnews.h:57
MythUIText * m_descText
Definition: mythnews.h:68
void processAndShowNews(NewsSite *site)
Definition: mythnews.cpp:444
void ShowMenu(void) override
Definition: mythnews.cpp:599
std::chrono::minutes m_updateFreq
Definition: mythnews.h:55
void deleteNewsSite(void)
Definition: mythnews.cpp:631
void ShowEditDialog(bool edit)
Definition: mythnews.cpp:550
bool Create(void) override
Definition: mythnews.cpp:76
QMap< MythUIButtonListItem *, NewsArticle > m_articles
Definition: mythnews.h:63
MythUIButtonList * m_articlesList
Definition: mythnews.h:62
MythNews(MythScreenStack *parent, const QString &name)
Creates a new MythNews Screen.
Definition: mythnews.cpp:44
void slotSiteSelected(MythUIButtonListItem *item)
Definition: mythnews.cpp:478
QTimer * m_retrieveTimer
Definition: mythnews.h:53
void customEvent(QEvent *event) override
Definition: mythnews.cpp:656
QString m_browser
Definition: mythnews.h:58
~MythNews() override
Definition: mythnews.cpp:71
MythUIImage * m_downloadImage
Definition: mythnews.h:71
void slotRetrieveNews(void)
Definition: mythnews.cpp:396
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