MythTV  master
sourceManager.h
Go to the documentation of this file.
1 #ifndef SOURCEMANAGER_H
2 #define SOURCEMANAGER_H
3 
4 // QT headers
5 #include <QDir>
6 #include <QObject>
7 #include <QMultiMap>
8 #include <QStringList>
9 
10 // MythWeather headers
11 #include "weatherUtils.h"
12 #include "weatherSource.h"
13 
14 class WeatherScreen;
15 class ScriptInfo;
16 using SourceMap = QMultiMap<long, const WeatherSource*>;
17 
18 class SourceManager : public QObject
19 {
20  Q_OBJECT
21 
22  public:
23  SourceManager();
24  ~SourceManager() override;
25  WeatherSource *needSourceFor(int id, const QString &loc, units_t units);
26  QStringList getLocationList(ScriptInfo *si, const QString &str);
27  void startTimers();
28  void stopTimers();
29  void doUpdate(bool forceUpdate = false);
30  bool findPossibleSources(QStringList types, QList<ScriptInfo *> &sources);
31  void clearSources();
32  bool findScripts();
33  bool findScriptsDB();
34  void setupSources();
35  bool connectScreen(uint id, WeatherScreen *screen);
36  bool disconnectScreen(WeatherScreen *screen);
37  ScriptInfo *getSourceByName(const QString &name);
38 
39  private slots:
40  void timeout(void) {}
41 
42  private:
43  QList<ScriptInfo *> m_scripts; //all scripts
44  QList<WeatherSource *> m_sources; //in-use scripts
46  void recurseDirs(QDir dir);
47 };
48 
49 #endif /* SOURCEMANAGER_H */
types
static const struct wl_interface * types[]
Definition: idle_inhibit_unstable_v1.c:39
WeatherSource
Definition: weatherSource.h:33
SourceManager::m_sources
QList< WeatherSource * > m_sources
Definition: sourceManager.h:44
weatherSource.h
SourceManager::startTimers
void startTimers()
Definition: sourceManager.cpp:260
SourceMap
QMultiMap< long, const WeatherSource * > SourceMap
Definition: sourceManager.h:16
SourceManager::recurseDirs
void recurseDirs(QDir dir)
Definition: sourceManager.cpp:351
SourceManager::stopTimers
void stopTimers()
Definition: sourceManager.cpp:266
SourceManager::findScripts
bool findScripts()
Definition: sourceManager.cpp:81
SourceManager::m_scripts
QList< ScriptInfo * > m_scripts
Definition: sourceManager.h:43
SourceManager::~SourceManager
~SourceManager() override
Definition: sourceManager.cpp:30
SourceManager::disconnectScreen
bool disconnectScreen(WeatherScreen *screen)
Definition: sourceManager.cpp:324
SourceManager::doUpdate
void doUpdate(bool forceUpdate=false)
Definition: sourceManager.cpp:272
SourceManager::connectScreen
bool connectScreen(uint id, WeatherScreen *screen)
Definition: sourceManager.cpp:299
SourceManager::findScriptsDB
bool findScriptsDB()
Definition: sourceManager.cpp:35
SourceManager::clearSources
void clearSources()
Definition: sourceManager.cpp:154
WeatherScreen
Weather screen.
Definition: weatherScreen.h:26
uint
unsigned int uint
Definition: compat.h:144
SourceManager::setupSources
void setupSources()
Definition: sourceManager.cpp:165
units_t
unsigned char units_t
Definition: weatherUtils.h:24
SourceManager::getSourceByName
ScriptInfo * getSourceByName(const QString &name)
Definition: sourceManager.cpp:196
SourceManager::getLocationList
QStringList getLocationList(ScriptInfo *si, const QString &str)
Definition: sourceManager.cpp:216
SourceManager::findPossibleSources
bool findPossibleSources(QStringList types, QList< ScriptInfo * > &sources)
Definition: sourceManager.cpp:281
SourceManager::needSourceFor
WeatherSource * needSourceFor(int id, const QString &loc, units_t units)
Definition: sourceManager.cpp:229
SourceManager::timeout
void timeout(void)
Definition: sourceManager.h:40
ScriptInfo
Definition: serverSideScripting.h:36
SourceManager::SourceManager
SourceManager()
Definition: sourceManager.cpp:24
SourceManager
Definition: sourceManager.h:18
weatherUtils.h
SourceManager::m_sourcemap
SourceMap m_sourcemap
Definition: sourceManager.h:45