MythTV  master
Go to the documentation of this file.
1 #ifndef MYTHNEWS_H
2 #define MYTHNEWS_H
4 // MythTV headers
5 #include <mythscreentype.h>
7 // MythNews headers
8 #include "newssite.h"
10 class QTimer;
11 class HttpComms;
12 class MythUIText;
13 class MythUIImage;
14 class MythDialogBox;
15 class MythUIButtonList;
21 class MythNews : public MythScreenType
22 {
25  public:
26  MythNews(MythScreenStack *parent, const QString &name);
27  ~MythNews() override;
29  bool Create(void) override; // MythScreenType
30  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
31  void customEvent(QEvent *event) override; // MythUIType
33  private:
34  void updateInfoView(void);
35  void clearSites(void);
36  void cancelRetrieve(void);
37  void processAndShowNews(NewsSite *site);
39  static QString formatSize(long long bytes, int prec);
40  static void playVideo(const NewsArticle &article);
42  // menu stuff
43  void ShowMenu(void) override; // MythScreenType
44  void deleteNewsSite(void);
45  void ShowEditDialog(bool edit);
46  void ShowFeedManager();
48  mutable QMutex m_lock {QMutex::Recursive};
51  QTimer *m_retrieveTimer {nullptr};
52  int m_timerTimeout {10*60*1000};
53  unsigned int m_updateFreq {30};
55  QString m_zoom {"1.0"};
56  QString m_browser;
61  QMap<MythUIButtonListItem*,NewsArticle> m_articles;
65  MythUIText *m_titleText {nullptr};
66  MythUIText *m_descText {nullptr};
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 };
82 #endif /* MYTHNEWS_H */
void processAndShowNews(NewsSite *site)
Definition: mythnews.cpp:500
NewsSite::List m_newsSites
Definition: mythnews.h:49
unsigned int slots[4]
Definition: element.c:38
~MythNews() override
Definition: mythnews.cpp:69
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
void slotRetrieveNews(void)
Definition: mythnews.cpp:448
static QString formatSize(long long bytes, int prec)
Definition: mythnews.cpp:392
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
Basic menu dialog, message and a list of options.
void customEvent(QEvent *event) override
Definition: mythnews.cpp:708
MythUIText * m_nositesText
Definition: mythnews.h:63
int m_timerTimeout
Definition: mythnews.h:52
void clearSites(void)
Definition: mythnews.cpp:126
void slotNewsRetrieved(NewsSite *site)
Definition: mythnews.cpp:470
void ShowMenu(void) override
Definition: mythnews.cpp:651
static void playVideo(const NewsArticle &article)
Definition: mythnews.cpp:701
QString m_browser
Definition: mythnews.h:56
void slotSiteSelected(MythUIButtonListItem *item)
Definition: mythnews.cpp:534
void deleteNewsSite(void)
Definition: mythnews.cpp:683
QMap< MythUIButtonListItem *, NewsArticle > m_articles
Definition: mythnews.h:61
MythNews(MythScreenStack *parent, const QString &name)
Creates a new MythNews Screen.
Definition: mythnews.cpp:42
void ShowFeedManager()
Definition: mythnews.cpp:636
void cancelRetrieve(void)
Definition: mythnews.cpp:489
MythUIImage * m_podcastImage
Definition: mythnews.h:71
MythUIImage * m_downloadImage
Definition: mythnews.h:69
void slotViewArticle(MythUIButtonListItem *articlesListItem)
Definition: mythnews.cpp:558
QString m_zoom
Definition: mythnews.h:55
void updateInfoView(void)
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
MythUIImage * m_thumbnailImage
Definition: mythnews.h:68
bool Create(void) override
Definition: mythnews.cpp:74
MythUIImage * m_enclosureImage
Definition: mythnews.h:70
MythUIButtonList * m_articlesList
Definition: mythnews.h:60
QTimer * m_retrieveTimer
Definition: mythnews.h:51
void ShowEditDialog(bool edit)
Definition: mythnews.cpp:606
QMutex m_lock
Definition: mythnews.h:48
Plugin for browsing RSS news feeds.
Definition: mythnews.h:21
MythDialogBox * m_menuPopup
Definition: mythnews.h:57
Screen in which all other widgets are contained and rendered.
MythUIText * m_titleText
Definition: mythnews.h:65
MythUIText * m_updatedText
Definition: mythnews.h:64
unsigned int m_updateFreq
Definition: mythnews.h:53
MythUIText * m_descText
Definition: mythnews.h:66
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythnews.cpp:415
void loadSites(void)
Definition: mythnews.cpp:152
MythUIButtonList * m_sitesList
Definition: mythnews.h:59