MythTV  master
weather.h
Go to the documentation of this file.
1 #ifndef WEATHER_H_
2 #define WEATHER_H_
3 
4 // QT headers
5 #include <QList>
6 
7 // MythTV headers
8 #include <mythscreentype.h>
9 #include <mythuitext.h>
10 #include <mythmainwindow.h>
11 
12 // MythWeather headers
13 #include "weatherUtils.h"
14 
15 class SourceManager;
16 class WeatherScreen;
17 
18 using ScreenList = QList<WeatherScreen*>;
19 
20 class Weather : public MythScreenType
21 {
22  Q_OBJECT
23 
24  public:
25  Weather(MythScreenStack *parent, const QString &name, SourceManager *srcMan);
26  ~Weather();
27 
28  bool Create(void) override; // MythScreenType
29  bool keyPressEvent(QKeyEvent *) override; // MythScreenType
30 
31  bool UpdateData();
32  bool SetupScreens();
33 
34  public slots:
35  void setupScreens();
36 
37  private slots:
38  void update_timeout() {}
39  void nextpage_timeout();
40  void weatherTimeout() {}
41  void cursorLeft();
42  void cursorRight();
43  void holdPage();
44  void setupPage();
45  void screenReady(WeatherScreen *ws);
46 
47  private:
50  void clearScreens();
51  void showScreen(WeatherScreen *ws);
52  void hideScreen(void);
53 
55 
56  bool m_firstRun {true};
58 
59  QTimer *m_nextpage_Timer {nullptr};
60 
61  bool m_firstSetup {true};
62 
63  bool m_createdSrcMan {false};
64  SourceManager *m_srcMan {nullptr};
65  ScreenList m_screens; //screens in correct display order
66  int m_cur_screen {0};
67 
68  ScreenListMap m_allScreens; //screens parsed from xml
70  bool m_paused {false};
71 
72  MythUIText *m_pauseText {nullptr};
75 };
76 
77 #endif
78 
79 /*
80  * vim:ts=4:sw=4:ai:et:si:sts=4
81  */
int m_nextpageInterval
Definition: weather.h:57
bool m_paused
Definition: weather.h:70
void holdPage()
Definition: weather.cpp:302
unsigned int slots[4]
Definition: element.c:38
void setupScreens()
Definition: weather.cpp:107
void showScreen(WeatherScreen *ws)
Definition: weather.cpp:283
ScreenListMap m_allScreens
Definition: weather.h:68
bool UpdateData()
bool m_createdSrcMan
Definition: weather.h:63
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
void cursorLeft()
Definition: weather.cpp:358
bool m_firstSetup
Definition: weather.h:61
void cursorRight()
Definition: weather.cpp:346
bool SetupScreens()
Definition: weather.cpp:112
void clearScreens()
Definition: weather.cpp:93
WeatherScreen * nextScreen()
Definition: weather.cpp:223
void setupPage()
Definition: weather.cpp:320
int m_cur_screen
Definition: weather.h:66
MythScreenStack * m_weatherStack
Definition: weather.h:54
bool Create(void) override
Definition: weather.cpp:61
void weatherTimeout()
Definition: weather.h:40
void nextpage_timeout()
Definition: weather.cpp:370
MythUIText * m_headerText
Definition: weather.h:73
ScreenList m_screens
Definition: weather.h:65
QTimer * m_nextpage_Timer
Definition: weather.h:59
MythUIText * m_pauseText
Definition: weather.h:72
bool m_firstRun
Definition: weather.h:56
WeatherScreen * prevScreen()
Definition: weather.cpp:232
WeatherScreen * m_currScreen
Definition: weather.h:69
void screenReady(WeatherScreen *ws)
Definition: weather.cpp:211
void update_timeout()
Definition: weather.h:38
~Weather()
Definition: weather.cpp:50
MythUIText * m_updatedText
Definition: weather.h:74
SourceManager * m_srcMan
Definition: weather.h:64
Weather(MythScreenStack *parent, const QString &name, SourceManager *srcMan)
Definition: weather.cpp:22
Screen in which all other widgets are contained and rendered.
void hideScreen(void)
Definition: weather.cpp:294
Weather screen.
Definition: weatherScreen.h:26
QMap< QString, ScreenListInfo > ScreenListMap
Definition: weatherUtils.h:79
QList< WeatherScreen * > ScreenList
Definition: weather.h:18
bool keyPressEvent(QKeyEvent *) override
Key event handler.
Definition: weather.cpp:242