00001 #ifndef WEATHER_H_ 00002 #define WEATHER_H_ 00003 00004 // QT headers 00005 #include <QList> 00006 00007 // MythTV headers 00008 #include <mythscreentype.h> 00009 #include <mythuitext.h> 00010 #include <mythmainwindow.h> 00011 00012 // MythWeather headers 00013 #include "weatherUtils.h" 00014 00015 class SourceManager; 00016 class WeatherScreen; 00017 00018 typedef QList<WeatherScreen*> ScreenList; 00019 00020 class Weather : public MythScreenType 00021 { 00022 Q_OBJECT 00023 00024 public: 00025 Weather(MythScreenStack *parent, const QString &name, SourceManager *srcMan); 00026 ~Weather(); 00027 00028 bool Create(void); 00029 bool keyPressEvent(QKeyEvent *); 00030 00031 bool UpdateData(); 00032 bool SetupScreens(); 00033 00034 public slots: 00035 void setupScreens(); 00036 00037 private slots: 00038 void update_timeout() {} 00039 void nextpage_timeout(); 00040 void weatherTimeout() {} 00041 void cursorLeft(); 00042 void cursorRight(); 00043 void holdPage(); 00044 void setupPage(); 00045 void screenReady(WeatherScreen *ws); 00046 00047 private: 00048 WeatherScreen *nextScreen(); 00049 WeatherScreen *prevScreen(); 00050 void clearScreens(); 00051 void showScreen(WeatherScreen *ws); 00052 void hideScreen(void); 00053 00054 MythScreenStack *m_weatherStack; 00055 int m_timeoutCounter; 00056 int m_wantAnimated; 00057 bool m_stopProcessing; 00058 00059 units_t m_units; 00060 bool m_firstRun; 00061 int m_updateInterval; 00062 int m_nextpageInterval; 00063 int m_nextpageIntArrow; 00064 QTimer *m_nextpage_Timer; 00065 00066 bool m_gotDataHook; 00067 00068 bool m_firstSetup; 00069 00070 bool m_createdSrcMan; 00071 SourceManager *m_srcMan; 00072 ScreenList m_screens; //screens in correct display order 00073 int m_cur_screen; 00074 00075 ScreenListMap m_allScreens; //screens parsed from xml 00076 WeatherScreen *m_currScreen; 00077 bool m_paused; 00078 00079 MythUIText *m_pauseText; 00080 MythUIText *m_headerText; 00081 MythUIText *m_updatedText; 00082 }; 00083 00084 #endif 00085 00086 /* 00087 * vim:ts=4:sw=4:ai:et:si:sts=4 00088 */
1.6.3