1 /***************************************************************************
2 * Copyright (C) 2007 by Shawn Starr <shawn.starr@rogers.com> *
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. *
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. *
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_
24 #include <KGenericFactory>
25 #include <Plasma/DataEngine>
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
42 * @param parent The parent object.
43 * @param args Argument list, unused.
45 WeatherEngine(QObject
*parent
, const QVariantList
&args
);
55 * @arg pluginName Name of the plugin
56 * @return IonInterface returns an instance of the loaded plugin
58 DataEngine
* loadIon(const QString
& pluginName
);
62 * @arg name Name of the plugin.
64 void unloadIon(const QString
& name
);
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
);
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
);
81 * Notify WeatherEngine a new ion has data sources.
82 * @arg source datasource name.
84 void newIonSource(const QString
& source
);
86 * Notify WeatherEngine a datasource is being removed.
87 * @arg source datasource name.
89 void removeIonSource(const QString
& source
);
91 * Reimplemented from Plasma::DataEngine.
92 * @param source The datasource to update.
94 bool updateSourceEvent(const QString
& source
);
101 K_EXPORT_PLASMA_DATAENGINE(weather
, WeatherEngine
)