00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _ION_H
00021 #define _ION_H
00022
00023 #include <QtCore/QObject>
00024 #include <KDE/KGenericFactory>
00025 #include <plasma/dataengine.h>
00026
00027 #include "ion_export.h"
00028
00036 class ION_EXPORT IonInterface : public Plasma::DataEngine
00037 {
00038 Q_OBJECT
00039
00040 public:
00041
00042 enum ConditionIcons { ClearDay = 1, FewCloudsDay, PartlyCloudyDay, Overcast,
00043 Rain, LightRain, Showers, ChanceShowersDay, Thunderstorm, Hail,
00044 Snow, LightSnow, Flurries, FewCloudsNight, ChanceShowersNight,
00045 PartlyCloudyNight, ClearNight, Mist, Haze, FreezingRain,
00046 RainSnow, FreezingDrizzle, ChanceThunderstormDay, ChanceThunderstormNight,
00047 ChanceSnowDay, ChanceSnowNight, NotAvailable
00048 };
00049
00050 enum WindDirections { N, NNE, NE, ENE, E, SSE, SE, ESE, S, NNW, NW, WNW, W, SSW, SW, WSW, VR };
00051
00052 typedef QHash<QString, IonInterface*> IonDict;
00053
00059 explicit IonInterface(QObject *parent = 0, const QVariantList &args = QVariantList());
00063 virtual ~IonInterface() {}
00064
00068 void ref();
00069
00073 void deref();
00074
00079 bool isUsed() const;
00080
00087 QString getWeatherIcon(const QMap<QString, ConditionIcons> &conditionList, const QString& condition);
00088
00095 QString getWindDirectionIcon(const QMap<QString, WindDirections> &windDirList, const QString& windDirection);
00096
00097 public Q_SLOTS:
00098
00103 bool updateSourceEvent(const QString& source);
00104
00105 protected:
00112 void setInitialized(bool initialized);
00113
00118 bool sourceRequestEvent(const QString &source);
00119
00125 virtual bool updateIonSource(const QString &source) = 0;
00126
00127 friend class WeatherEngine;
00128
00129 private:
00130 class Private;
00131 Private* const d;
00132 };
00133
00134 #endif
00135