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
10 #include <libmythui/mythuitext.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() override;
27 
28  bool Create(void) override; // MythScreenType
29  bool keyPressEvent(QKeyEvent *event) 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};
57  std::chrono::seconds m_nextpageInterval {10s};
58 
59  QTimer *m_nextPageTimer {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_curScreenNum {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  */
Weather::hideScreen
void hideScreen(void)
Definition: weather.cpp:292
mythuitext.h
Weather::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: weather.cpp:240
Weather::nextpage_timeout
void nextpage_timeout()
Definition: weather.cpp:368
Weather::m_screens
ScreenList m_screens
Definition: weather.h:65
Weather::Weather
Weather(MythScreenStack *parent, const QString &name, SourceManager *srcMan)
Definition: weather.cpp:21
Weather::nextScreen
WeatherScreen * nextScreen()
Definition: weather.cpp:221
Weather::showScreen
void showScreen(WeatherScreen *ws)
Definition: weather.cpp:281
MythScreenStack
Definition: mythscreenstack.h:16
Weather::~Weather
~Weather() override
Definition: weather.cpp:49
Weather::m_weatherStack
MythScreenStack * m_weatherStack
Definition: weather.h:54
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
Weather::update_timeout
void update_timeout()
Definition: weather.h:38
Weather::m_updatedText
MythUIText * m_updatedText
Definition: weather.h:74
Weather::m_srcMan
SourceManager * m_srcMan
Definition: weather.h:64
Weather::m_curScreenNum
int m_curScreenNum
Definition: weather.h:66
Weather::holdPage
void holdPage()
Definition: weather.cpp:300
Weather::UpdateData
bool UpdateData()
Weather::cursorLeft
void cursorLeft()
Definition: weather.cpp:356
Weather::setupPage
void setupPage()
Definition: weather.cpp:318
Weather::m_firstSetup
bool m_firstSetup
Definition: weather.h:61
Weather::m_firstRun
bool m_firstRun
Definition: weather.h:56
Weather::m_paused
bool m_paused
Definition: weather.h:70
Weather::m_currScreen
WeatherScreen * m_currScreen
Definition: weather.h:69
ScreenListMap
QMap< QString, ScreenListInfo > ScreenListMap
Definition: weatherUtils.h:71
Weather
Definition: weather.h:20
Weather::m_allScreens
ScreenListMap m_allScreens
Definition: weather.h:68
WeatherScreen
Weather screen.
Definition: weatherScreen.h:26
Weather::setupScreens
void setupScreens()
Definition: weather.cpp:106
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
Weather::cursorRight
void cursorRight()
Definition: weather.cpp:344
Weather::m_nextPageTimer
QTimer * m_nextPageTimer
Definition: weather.h:59
Weather::SetupScreens
bool SetupScreens()
Definition: weather.cpp:111
Weather::Create
bool Create(void) override
Definition: weather.cpp:60
Weather::weatherTimeout
void weatherTimeout()
Definition: weather.h:40
Weather::screenReady
void screenReady(WeatherScreen *ws)
Definition: weather.cpp:210
Weather::m_headerText
MythUIText * m_headerText
Definition: weather.h:73
srcMan
SourceManager * srcMan
Definition: mythweather.cpp:20
Weather::m_nextpageInterval
std::chrono::seconds m_nextpageInterval
Definition: weather.h:57
Weather::m_pauseText
MythUIText * m_pauseText
Definition: weather.h:72
mythmainwindow.h
ScreenList
QList< WeatherScreen * > ScreenList
Definition: weather.h:18
mythscreentype.h
Weather::m_createdSrcMan
bool m_createdSrcMan
Definition: weather.h:63
SourceManager
Definition: sourceManager.h:18
Weather::clearScreens
void clearScreens()
Definition: weather.cpp:92
Weather::prevScreen
WeatherScreen * prevScreen()
Definition: weather.cpp:230
weatherUtils.h