add more spacing
[personal-kdebase.git] / workspace / plasma / dataengines / weather / weatherengine.h
blobd215b0951d3e1ed92364097f9b8b34aeda1d3d7f
1 /***************************************************************************
2 * Copyright (C) 2007 by Shawn Starr <shawn.starr@rogers.com> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
18 ***************************************************************************/
20 #ifndef _WEATHER_ENGINE_H_
21 #define _WEATHER_ENGINE_H_
23 #include <KService>
24 #include <KGenericFactory>
25 #include <Plasma/DataEngine>
26 #include "ions/ion.h"
28 class QTimer;
30 /**
31 * @author Shawn Starr
32 * This class is DataEngine. It handles loading, unloading, updating any data the ions wish to send. It is a gateway for datasources (ions) to
33 * communicate with the WeatherEngine.
36 class WeatherEngine : public Plasma::DataEngine
38 Q_OBJECT
40 public:
41 /** Constructor
42 * @param parent The parent object.
43 * @param args Argument list, unused.
45 WeatherEngine(QObject *parent, const QVariantList &args);
47 // Destructor
48 ~WeatherEngine();
50 // initialization
51 void init();
53 /**
54 * Load a plugin
55 * @arg pluginName Name of the plugin
56 * @return IonInterface returns an instance of the loaded plugin
58 DataEngine* loadIon(const QString& pluginName);
60 /**
61 * Unload a plugin.
62 * @arg name Name of the plugin.
64 void unloadIon(const QString& name);
66 protected:
67 /**
68 * Reimplemented from Plasma::DataEngine. We use it to communicate to the Ion plugins to set the data sources.
69 * @param source The datasource name.
71 bool sourceRequestEvent(const QString &source);
73 protected slots:
74 /**
75 * Reimplemented from Plasma::DataEngine.
76 * @param source The datasource to be updated.
77 * @param data The new data updated.
79 void dataUpdated(const QString& source, Plasma::DataEngine::Data data);
80 /**
81 * Notify WeatherEngine a new ion has data sources.
82 * @arg source datasource name.
84 void newIonSource(const QString& source);
85 /**
86 * Notify WeatherEngine a datasource is being removed.
87 * @arg source datasource name.
89 void removeIonSource(const QString& source);
90 /**
91 * Reimplemented from Plasma::DataEngine.
92 * @param source The datasource to update.
94 bool updateSourceEvent(const QString& source);
96 private:
97 class Private;
98 Private *const d;
101 K_EXPORT_PLASMA_DATAENGINE(weather, WeatherEngine)
103 #endif