00001 #ifndef MYTHNEWS_H 00002 #define MYTHNEWS_H 00003 00004 // MythTV headers 00005 #include <httpcomms.h> 00006 #include <mythscreentype.h> 00007 00008 // MythNews headers 00009 #include "newssite.h" 00010 00011 class QTimer; 00012 class HtppComms; 00013 class MythUIText; 00014 class MythUIImage; 00015 class MythDialogBox; 00016 class MythUIButtonList; 00017 class MythUIButtonListItem; 00018 class MythUIProgressDialog; 00019 00023 class MythNews : public MythScreenType 00024 { 00025 Q_OBJECT 00026 00027 public: 00028 MythNews(MythScreenStack *parent, const QString &name); 00029 ~MythNews(); 00030 00031 bool Create(void); 00032 bool keyPressEvent(QKeyEvent *); 00033 void customEvent(QEvent*); 00034 00035 private: 00036 void updateInfoView(void); 00037 void clearSites(void); 00038 void cancelRetrieve(void); 00039 void processAndShowNews(NewsSite *site); 00040 00041 bool getHttpFile(const QString &sFilename, const QString &cmdURL); 00042 void createProgress(const QString &title); 00043 QString formatSize(long long bytes, int prec); 00044 void playVideo(const NewsArticle &article); 00045 00046 // menu stuff 00047 void ShowMenu(void); 00048 void deleteNewsSite(void); 00049 void ShowEditDialog(bool edit); 00050 void ShowFeedManager(); 00051 00052 mutable QMutex m_lock; 00053 NewsSite::List m_NewsSites; 00054 00055 QTimer *m_RetrieveTimer; 00056 int m_TimerTimeout; 00057 unsigned int m_UpdateFreq; 00058 00059 QString m_zoom; 00060 QString m_browser; 00061 MythDialogBox *m_menuPopup; 00062 00063 MythUIProgressDialog *m_progressPopup; 00064 HttpComms *m_httpGrabber; 00065 bool m_abortHttp; 00066 00067 MythUIButtonList *m_sitesList; 00068 MythUIButtonList *m_articlesList; 00069 QMap<MythUIButtonListItem*,NewsArticle> m_articles; 00070 00071 MythUIText *m_nositesText; 00072 MythUIText *m_updatedText; 00073 MythUIText *m_titleText; 00074 MythUIText *m_descText; 00075 00076 MythUIImage *m_thumbnailImage; 00077 MythUIImage *m_downloadImage; 00078 MythUIImage *m_enclosureImage; 00079 MythUIImage *m_podcastImage; 00080 00081 private slots: 00082 void loadSites(void); 00083 void updateInfoView(MythUIButtonListItem*); 00084 void slotViewArticle(MythUIButtonListItem*); 00085 void slotRetrieveNews(void); 00086 void slotNewsRetrieved(NewsSite*); 00087 void slotSiteSelected(MythUIButtonListItem*); 00088 00089 void slotProgressCancelled(); 00090 }; 00091 00092 #endif /* MYTHNEWS_H */
1.6.3