• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Engines

ion.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 _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; // Define Dict as a QHash for Ions
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

Engines

Skip menu "Engines"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal