MythTV  master
mythnews.h
Go to the documentation of this file.
1 #ifndef MYTHNEWS_H
2 #define MYTHNEWS_H
3 
4 // MythTV headers
5 #include <mythscreentype.h>
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();
28 
29  bool Create(void) override; // MythScreenType
30  bool keyPressEvent(QKeyEvent *) override; // MythScreenType
31  void customEvent(QEvent*) override; // MythUIType
32 
33  private:
34  void updateInfoView(void);
35  void clearSites(void);
36  void cancelRetrieve(void);
37  void processAndShowNews(NewsSite *site);
38 
39  QString formatSize(long long bytes, int prec);
40  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();
47 
48  mutable QMutex m_lock {QMutex::Recursive};
50 
51  QTimer *m_RetrieveTimer {nullptr};
52  int m_TimerTimeout {10*60*1000};
53  unsigned int m_UpdateFreq {30};
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);
77  void slotRetrieveNews(void);
80 };
81 
82 #endif /* MYTHNEWS_H */
void processAndShowNews(NewsSite *site)
Definition: mythnews.cpp:504
void customEvent(QEvent *) override
Definition: mythnews.cpp:716
unsigned int slots[4]
Definition: element.c:38
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
void slotRetrieveNews(void)
Definition: mythnews.cpp:450
QString formatSize(long long bytes, int prec)
Definition: mythnews.cpp:394
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 slotSiteSelected(MythUIButtonListItem *)
Definition: mythnews.cpp:539
MythUIText * m_nositesText
Definition: mythnews.h:63
~MythNews()
Definition: mythnews.cpp:69
void clearSites(void)
Definition: mythnews.cpp:126
void ShowMenu(void) override
Definition: mythnews.cpp:659
void slotNewsRetrieved(NewsSite *)
Definition: mythnews.cpp:473
void playVideo(const NewsArticle &article)
Definition: mythnews.cpp:709
QString m_browser
Definition: mythnews.h:56
void deleteNewsSite(void)
Definition: mythnews.cpp:691
void slotViewArticle(MythUIButtonListItem *)
Definition: mythnews.cpp:565
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:643
void cancelRetrieve(void)
Definition: mythnews.cpp:492
MythUIImage * m_podcastImage
Definition: mythnews.h:71
MythUIImage * m_downloadImage
Definition: mythnews.h:69
QTimer * m_RetrieveTimer
Definition: mythnews.h:51
int m_TimerTimeout
Definition: mythnews.h:52
NewsSite::List m_NewsSites
Definition: mythnews.h:49
QString m_zoom
Definition: mythnews.h:55
const char * name
Definition: ParseText.cpp:328
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 keyPressEvent(QKeyEvent *) override
Key event handler.
Definition: mythnews.cpp:417
bool Create(void) override
Definition: mythnews.cpp:74
MythUIImage * m_enclosureImage
Definition: mythnews.h:70
MythUIButtonList * m_articlesList
Definition: mythnews.h:60
void ShowEditDialog(bool edit)
Definition: mythnews.cpp:613
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
MythUIText * m_descText
Definition: mythnews.h:66
unsigned int m_UpdateFreq
Definition: mythnews.h:53
void loadSites(void)
Definition: mythnews.cpp:152
MythUIButtonList * m_sitesList
Definition: mythnews.h:59