Engines
ion.h
Go to the documentation of this file.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 Q_PROPERTY(QString timezone READ timezone WRITE setTimezoneFormat)
00040 Q_PROPERTY(QString unit READ metricUnit WRITE setMeasureUnit)
00041
00042 public:
00043 typedef QHash<QString, IonInterface*> IonDict;
00044
00049 explicit IonInterface(QObject *parent = 0, const QVariantList &args = QVariantList());
00053 virtual ~IonInterface() {}
00054
00058 void ref();
00059
00063 void deref();
00064
00069 bool isUsed() const;
00070
00075 virtual bool metricUnit(void) = 0;
00076
00081 virtual bool timezone(void) = 0;
00082
00083 public Q_SLOTS:
00084
00089 bool updateSourceEvent(const QString& source);
00090
00091 protected:
00098 void setInitialized(bool initialized);
00099
00104 bool sourceRequestEvent(const QString &source);
00105
00111 virtual bool updateIonSource(const QString &source) = 0;
00112
00113 friend class WeatherEngine;
00114
00115 private:
00120 virtual void setMeasureUnit(const QString& measureType) = 0;
00121
00126 virtual void setTimezoneFormat(const QString& isUtc) = 0;
00127
00128 class Private;
00129 Private* const d;
00130 };
00131
00132 #define K_EXPORT_PLASMA_ION(name, classname) \
00133 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
00134 K_EXPORT_PLUGIN(factory("ion_" #name))
00135 #endif