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
11
12// MythWeather headers
13#include "weatherUtils.h"
14
15class SourceManager;
16class WeatherScreen;
17
18using ScreenList = QList<WeatherScreen*>;
19
20class 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:
39 void nextpage_timeout();
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};
65 ScreenList m_screens; //screens in correct display order
67
68 ScreenListMap m_allScreens; //screens parsed from xml
70 bool m_paused {false};
71
75};
76
77#endif
78
79/*
80 * vim:ts=4:sw=4:ai:et:si:sts=4
81 */
Screen in which all other widgets are contained and rendered.
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
Weather screen.
Definition: weatherScreen.h:27
void update_timeout()
Definition: weather.h:38
bool m_createdSrcMan
Definition: weather.h:63
MythUIText * m_headerText
Definition: weather.h:73
void hideScreen(void)
Definition: weather.cpp:295
QTimer * m_nextPageTimer
Definition: weather.h:59
MythUIText * m_updatedText
Definition: weather.h:74
std::chrono::seconds m_nextpageInterval
Definition: weather.h:57
bool Create(void) override
Definition: weather.cpp:61
MythScreenStack * m_weatherStack
Definition: weather.h:54
MythUIText * m_pauseText
Definition: weather.h:72
bool SetupScreens()
Definition: weather.cpp:112
void weatherTimeout()
Definition: weather.h:40
void cursorLeft()
Definition: weather.cpp:359
void nextpage_timeout()
Definition: weather.cpp:371
ScreenListMap m_allScreens
Definition: weather.h:68
Weather(MythScreenStack *parent, const QString &name, SourceManager *srcMan)
Definition: weather.cpp:22
void showScreen(WeatherScreen *ws)
Definition: weather.cpp:284
bool UpdateData()
void cursorRight()
Definition: weather.cpp:347
void setupScreens()
Definition: weather.cpp:107
int m_curScreenNum
Definition: weather.h:66
~Weather() override
Definition: weather.cpp:50
WeatherScreen * nextScreen()
Definition: weather.cpp:222
bool m_paused
Definition: weather.h:70
void setupPage()
Definition: weather.cpp:321
void clearScreens()
Definition: weather.cpp:93
bool m_firstSetup
Definition: weather.h:61
void screenReady(WeatherScreen *ws)
Definition: weather.cpp:211
SourceManager * m_srcMan
Definition: weather.h:64
ScreenList m_screens
Definition: weather.h:65
void holdPage()
Definition: weather.cpp:303
WeatherScreen * prevScreen()
Definition: weather.cpp:231
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: weather.cpp:241
WeatherScreen * m_currScreen
Definition: weather.h:69
bool m_firstRun
Definition: weather.h:56
SourceManager * srcMan
Definition: mythweather.cpp:21
QMap< QString, ScreenListInfo > ScreenListMap
Definition: weatherUtils.h:68
QList< WeatherScreen * > ScreenList
Definition: weather.h:18