00001 #ifndef _SOURCEMANAGER_H_ 00002 #define _SOURCEMANAGER_H_ 00003 00004 #include <qobject.h> 00005 #include <qintdict.h> 00006 #include <qstringlist.h> 00007 00008 #include "defs.h" 00009 00010 #include "weatherSource.h" 00011 00012 class WeatherScreen; 00013 struct ScriptInfo; 00014 00015 class SourceManager : public QObject 00016 { 00017 Q_OBJECT 00018 00019 public: 00020 SourceManager(); 00021 WeatherSource *needSourceFor(int id, const QString &loc, units_t units); 00022 QStringList getLocationList(ScriptInfo *si, const QString &str); 00023 void startTimers(); 00024 void stopTimers(); 00025 void doUpdate(); 00026 bool findPossibleSources(QStringList types, QPtrList<ScriptInfo> &sources); 00027 void clearSources(); 00028 bool findScripts(); 00029 bool findScriptsDB(); 00030 void setupSources(); 00031 bool connectScreen(uint id, WeatherScreen *screen); 00032 bool disconnectScreen(WeatherScreen *screen); 00033 ScriptInfo *getSourceByName(const QString &name); 00034 00035 private slots: 00036 void timeout(void) {} 00037 00038 private: 00039 QPtrList<ScriptInfo> m_scripts; //all scripts 00040 QPtrList<WeatherSource> m_sources; //in-use scripts 00041 QIntDict<WeatherSource> m_sourcemap; 00042 units_t m_units; 00043 void recurseDirs(QDir dir); 00044 }; 00045 00046 #endif
1.5.5