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 typedef QMultiMap<long, const WeatherSource*> SourceMap;
17 
18 class SourceManager : public QObject
19 {
20  Q_OBJECT
21 
22  public:
23  SourceManager();
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
unsigned int slots[4]
Definition: element.c:38
WeatherSource * needSourceFor(int id, const QString &loc, units_t units)
QList< WeatherSource * > m_sources
Definition: sourceManager.h:44
unsigned int uint
Definition: compat.h:140
bool findScriptsDB()
QMultiMap< long, const WeatherSource * > SourceMap
Definition: sourceManager.h:15
bool findPossibleSources(QStringList types, QList< ScriptInfo * > &sources)
const char * name
Definition: ParseText.cpp:328
bool disconnectScreen(WeatherScreen *screen)
void recurseDirs(QDir dir)
unsigned char units_t
Definition: weatherUtils.h:20
SourceMap m_sourcemap
Definition: sourceManager.h:45
ScriptInfo * getSourceByName(const QString &name)
void doUpdate(bool forceUpdate=false)
void timeout(void)
Definition: sourceManager.h:40
bool connectScreen(uint id, WeatherScreen *screen)
Weather screen.
Definition: weatherScreen.h:26
QStringList getLocationList(ScriptInfo *si, const QString &str)
QList< ScriptInfo * > m_scripts
Definition: sourceManager.h:43