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
14class WeatherScreen;
15class ScriptInfo;
16using SourceMap = QMultiMap<long, const WeatherSource*>;
17
18class SourceManager : public QObject
19{
20 Q_OBJECT
21
22 public:
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 */
void doUpdate(bool forceUpdate=false)
bool connectScreen(uint id, WeatherScreen *screen)
bool findScriptsDB()
~SourceManager() override
bool findPossibleSources(QStringList types, QList< ScriptInfo * > &sources)
WeatherSource * needSourceFor(int id, const QString &loc, units_t units)
void timeout(void)
Definition: sourceManager.h:40
QStringList getLocationList(ScriptInfo *si, const QString &str)
ScriptInfo * getSourceByName(const QString &name)
bool disconnectScreen(WeatherScreen *screen)
SourceMap m_sourcemap
Definition: sourceManager.h:45
QList< WeatherSource * > m_sources
Definition: sourceManager.h:44
void recurseDirs(QDir dir)
QList< ScriptInfo * > m_scripts
Definition: sourceManager.h:43
Weather screen.
Definition: weatherScreen.h:27
unsigned int uint
Definition: freesurround.h:24
static const struct wl_interface * types[]
QMultiMap< long, const WeatherSource * > SourceMap
Definition: sourceManager.h:16
unsigned char units_t
Definition: weatherUtils.h:25