Engines
weatherengine.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 * Copyright (C) 2007 by Shawn Starr <shawn.starr@rogers.com> * 00003 * * 00004 * This program is free software; you can redistribute it and/or modify * 00005 * it under the terms of the GNU General Public License as published by * 00006 * the Free Software Foundation; either version 2 of the License, or * 00007 * (at your option) any later version. * 00008 * * 00009 * This program is distributed in the hope that it will be useful, * 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00012 * GNU General Public License for more details. * 00013 * * 00014 * You should have received a copy of the GNU General Public License * 00015 * along with this program; if not, write to the * 00016 * Free Software Foundation, Inc., * 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 00018 ***************************************************************************/ 00019 00020 #ifndef _WEATHER_ENGINE_H_ 00021 #define _WEATHER_ENGINE_H_ 00022 00023 #include <KService> 00024 #include <KGenericFactory> 00025 #include <plasma/dataengine.h> 00026 #include "ions/ion.h" 00027 00028 class QTimer; 00029 00036 class WeatherEngine : public Plasma::DataEngine 00037 { 00038 Q_OBJECT 00039 00040 public: 00045 WeatherEngine(QObject *parent, const QVariantList &args); 00046 00047 // Destructor 00048 ~WeatherEngine(); 00049 00055 IonInterface* Ion(const QString& name) const; 00061 IonInterface* loadIon(const QString& pluginName); 00066 void unloadIon(const QString& name); 00071 KService::List knownIons(); 00072 00073 protected: 00078 bool sourceRequestEvent(const QString &source); 00079 00080 protected slots: 00086 void dataUpdated(const QString& source, Plasma::DataEngine::Data data); 00091 void newIonSource(const QString& source); 00096 void removeIonSource(const QString& source); 00101 bool updateSourceEvent(const QString& source); 00102 00103 private: 00104 class Private; 00105 Private *const d; 00106 }; 00107 00108 K_EXPORT_PLASMA_DATAENGINE(weather, WeatherEngine) 00109 00110 #endif