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 
10 class QTimer;
11 class HttpComms;
12 class MythUIText;
13 class MythUIImage;
14 class MythDialogBox;
15 class MythUIButtonList;
17 
21 class MythNews : public MythScreenType
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 
65  MythUIText *m_titleText {nullptr};
66  MythUIText *m_descText {nullptr};
67 
72 
73  private slots:
74  void loadSites(void);
75  void updateInfoView(MythUIButtonListItem *selected);
76  void slotViewArticle(MythUIButtonListItem *articlesListItem);
77  void slotRetrieveNews(void);
78  void slotNewsRetrieved(NewsSite *site);
80 };
81 
82 #endif /* MYTHNEWS_H */
MythNews::ShowMenu
void ShowMenu(void) override
Definition: mythnews.cpp:597
MythNews::m_updatedText
MythUIText * m_updatedText
Definition: mythnews.h:64
MythNews::m_newsSites
NewsSite::List m_newsSites
Definition: mythnews.h:49
MythNews::cleanText
static QString cleanText(const QString &text)
Definition: mythnews.cpp:681
MythUIImage
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
MythNews::m_nositesText
MythUIText * m_nositesText
Definition: mythnews.h:63
MythNews::slotNewsRetrieved
void slotNewsRetrieved(NewsSite *site)
Definition: mythnews.cpp:416
MythNews::m_menuPopup
MythDialogBox * m_menuPopup
Definition: mythnews.h:57
MythNews::processAndShowNews
void processAndShowNews(NewsSite *site)
Definition: mythnews.cpp:442
MythNews::slotRetrieveNews
void slotRetrieveNews(void)
Definition: mythnews.cpp:394
MythNews::customEvent
void customEvent(QEvent *event) override
Definition: mythnews.cpp:654
MythScreenStack
Definition: mythscreenstack.h:16
MythNews::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythnews.cpp:361
MythNews::loadSites
void loadSites(void)
Definition: mythnews.cpp:152
MythNews
Plugin for browsing RSS news feeds.
Definition: mythnews.h:21
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
MythNews::m_articles
QMap< MythUIButtonListItem *, NewsArticle > m_articles
Definition: mythnews.h:61
MythNews::slotViewArticle
void slotViewArticle(MythUIButtonListItem *articlesListItem)
Definition: mythnews.cpp:500
MythNews::MythNews
MythNews(MythScreenStack *parent, const QString &name)
Creates a new MythNews Screen.
Definition: mythnews.cpp:42
MythUIButtonListItem
Definition: mythuibuttonlist.h:41
MythNews::m_browser
QString m_browser
Definition: mythnews.h:56
MythNews::m_downloadImage
MythUIImage * m_downloadImage
Definition: mythnews.h:69
MythNews::ShowFeedManager
void ShowFeedManager() const
Definition: mythnews.cpp:580
MythNews::m_zoom
QString m_zoom
Definition: mythnews.h:55
NewsArticle
Definition: newsarticle.h:10
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
MythNews::playVideo
static void playVideo(const NewsArticle &article)
Definition: mythnews.cpp:647
MythNews::m_lock
QRecursiveMutex m_lock
Definition: mythnews.h:48
MythNews::deleteNewsSite
void deleteNewsSite(void)
Definition: mythnews.cpp:629
MythNews::updateInfoView
void updateInfoView(void)
MythNews::cancelRetrieve
void cancelRetrieve(void)
Definition: mythnews.cpp:431
NewsSite
Definition: newssite.h:50
MythNews::m_podcastImage
MythUIImage * m_podcastImage
Definition: mythnews.h:71
MythNews::m_titleText
MythUIText * m_titleText
Definition: mythnews.h:65
MythNews::m_articlesList
MythUIButtonList * m_articlesList
Definition: mythnews.h:60
MythNews::slotSiteSelected
void slotSiteSelected(MythUIButtonListItem *item)
Definition: mythnews.cpp:476
newssite.h
MythNews::ShowEditDialog
void ShowEditDialog(bool edit)
Definition: mythnews.cpp:548
MythNews::m_retrieveTimer
QTimer * m_retrieveTimer
Definition: mythnews.h:51
NewsSite::List
Definition: newssite.h:63
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
MythNews::m_descText
MythUIText * m_descText
Definition: mythnews.h:66
MythNews::m_thumbnailImage
MythUIImage * m_thumbnailImage
Definition: mythnews.h:68
MythNews::Create
bool Create(void) override
Definition: mythnews.cpp:74
MythNews::m_updateFreq
std::chrono::minutes m_updateFreq
Definition: mythnews.h:53
MythNews::~MythNews
~MythNews() override
Definition: mythnews.cpp:69
MythNews::m_timerTimeout
std::chrono::minutes m_timerTimeout
Definition: mythnews.h:52
MythNews::m_sitesList
MythUIButtonList * m_sitesList
Definition: mythnews.h:59
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:191
MythNews::m_enclosureImage
MythUIImage * m_enclosureImage
Definition: mythnews.h:70
mythscreentype.h
MythNews::clearSites
void clearSites(void)
Definition: mythnews.cpp:126