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

Engines

IonInterface Class Reference

#include <ion.h>

Inheritance diagram for IonInterface:

Inheritance graph
[legend]

List of all members.


Detailed Description

Author:
Shawn Starr This is the base class to be used to implement new ions for the WeatherEngine.

The idea is that you can have multiple ions which provide weather information from different services to the engine from which an applet will request the data from.

Basically an ion is a Plasma::DataEngine, which is queried by the WeatherEngine instead of some applet.

Definition at line 36 of file ion.h.


Public Types

typedef QHash< QString,
IonInterface * > 
IonDict

Public Slots

bool updateSourceEvent (const QString &source)

Public Member Functions

void deref ()
 IonInterface (QObject *parent=0, const QVariantList &args=QVariantList())
bool isUsed () const
virtual bool metricUnit (void)=0
void ref ()
virtual bool timezone (void)=0
virtual ~IonInterface ()

Protected Member Functions

void setInitialized (bool initialized)
bool sourceRequestEvent (const QString &source)
virtual bool updateIonSource (const QString &source)=0

Properties

QString timezone
QString unit

Member Typedef Documentation

typedef QHash<QString, IonInterface*> IonInterface::IonDict

Definition at line 43 of file ion.h.


Constructor & Destructor Documentation

IonInterface::IonInterface ( QObject *  parent = 0,
const QVariantList &  args = QVariantList() 
) [explicit]

Constructor for the ion.

Parameters:
parent The parent object.

Definition at line 35 of file ion.cpp.

virtual IonInterface::~IonInterface (  )  [inline, virtual]

Destructor for the ion.

Definition at line 53 of file ion.h.


Member Function Documentation

void IonInterface::deref (  ) 

Decrement ion counter.

Called when ion is destroyed/unloaded.

Definition at line 50 of file ion.cpp.

bool IonInterface::isUsed (  )  const

Returns whether the ion is being used.

Returns:
true if the ion is being used, false otherwise

Definition at line 56 of file ion.cpp.

virtual bool IonInterface::metricUnit ( void   )  [pure virtual]

Reimplement to check whether the measurement is metric or not.

Returns:
true if metric is used, false if not.

Implemented in UKMETIon, EnvCanadaIon, and NOAAIon.

void IonInterface::ref (  ) 

Increment ion counter.

This is used to check if the ion is being used.

Definition at line 44 of file ion.cpp.

void IonInterface::setInitialized ( bool  initialized  )  [protected]

Call this method to flush waiting source requests that may be pending initialization.

Set the ion to make sure it is ready to get real data.

  • initialized whether or not the ion is currently ready to fetch data

Definition at line 92 of file ion.cpp.

bool IonInterface::sourceRequestEvent ( const QString &  source  )  [protected]

Reimplemented from Plasma::DataEngine.

If the ion is not initialized just set the initial data source up even if it's empty, we'll retry once the initialization is done.

Parameters:
source The datasource being requested

Definition at line 64 of file ion.cpp.

virtual bool IonInterface::timezone ( void   )  [pure virtual]

Reimplement to check if timeformat is UTC or not.

Returns:
true if UTC, false if local time.

Implemented in UKMETIon, EnvCanadaIon, and NOAAIon.

virtual bool IonInterface::updateIonSource ( const QString &  source  )  [protected, pure virtual]

Reimplement to fetch the data from the ion.

  • source the name of the datasource.
    Returns:
    true if update was successful, false if failed

Implemented in UKMETIon, EnvCanadaIon, and NOAAIon.

bool IonInterface::updateSourceEvent ( const QString &  source  )  [slot]

Reimplemented from Plasma::DataEngine.

Update the ion's datasource.

Parameters:
source the name of the datasource to be updated
Triggered when a Plasma::DataEngine::connectSource() timeout occurs.

Definition at line 79 of file ion.cpp.


Property Documentation

QString IonInterface::timezone [read, write]

Definition at line 39 of file ion.h.

QString IonInterface::unit [read, write]

Definition at line 40 of file ion.h.


The documentation for this class was generated from the following files:
  • ion.h
  • ion.cpp

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