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

Plasma

IonInterface Class Reference

#include <ion.h>

Inheritance diagram for IonInterface:

Inheritance graph
[legend]

List of all members.


Public Types

enum  ConditionIcons {
  ClearDay = 1, FewCloudsDay, PartlyCloudyDay, Overcast,
  Rain, LightRain, Showers, ChanceShowersDay,
  Thunderstorm, Hail, Snow, LightSnow,
  Flurries, FewCloudsNight, ChanceShowersNight, PartlyCloudyNight,
  ClearNight, Mist, Haze, FreezingRain,
  RainSnow, FreezingDrizzle, ChanceThunderstormDay, ChanceThunderstormNight,
  ChanceSnowDay, ChanceSnowNight, NotAvailable
}
typedef QHash< QString,
IonInterface * > 
IonDict
enum  WindDirections {
  N, NNE, NE, ENE,
  E, SSE, SE, ESE,
  S, NNW, NW, WNW,
  W, SSW, SW, WSW,
  VR
}

Public Slots

bool updateSourceEvent (const QString &source)

Public Member Functions

void deref ()
QString getWeatherIcon (const QMap< QString, ConditionIcons > &conditionList, const QString &condition)
QString getWindDirectionIcon (const QMap< QString, WindDirections > &windDirList, const QString &windDirection)
 IonInterface (QObject *parent=0, const QVariantList &args=QVariantList())
bool isUsed () const
void ref ()
virtual ~IonInterface ()

Protected Member Functions

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

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.


Member Typedef Documentation

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

Definition at line 52 of file ion.h.


Member Enumeration Documentation

enum IonInterface::ConditionIcons

Enumerator:
ClearDay 
FewCloudsDay 
PartlyCloudyDay 
Overcast 
Rain 
LightRain 
Showers 
ChanceShowersDay 
Thunderstorm 
Hail 
Snow 
LightSnow 
Flurries 
FewCloudsNight 
ChanceShowersNight 
PartlyCloudyNight 
ClearNight 
Mist 
Haze 
FreezingRain 
RainSnow 
FreezingDrizzle 
ChanceThunderstormDay 
ChanceThunderstormNight 
ChanceSnowDay 
ChanceSnowNight 
NotAvailable 

Definition at line 42 of file ion.h.

enum IonInterface::WindDirections

Enumerator:
N 
NNE 
NE 
ENE 
E 
SSE 
SE 
ESE 
S 
NNW 
NW 
WNW 
W 
SSW 
SW 
WSW 
VR 

Definition at line 50 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. args The argument list.

Definition at line 35 of file ion.cpp.

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

Destructor for the ion.

Definition at line 63 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.

QString IonInterface::getWeatherIcon ( const QMap< QString, ConditionIcons > &  conditionList,
const QString &  condition 
)

Returns weather icon filename to display in applet.

Return weather icon to display in an applet when given a condition.

Parameters:
conditionList a QList map pair of icons mapped to a enumeration of conditions.
condition the current condition being reported.
Returns:
icon name

Definition at line 152 of file ion.cpp.

QString IonInterface::getWindDirectionIcon ( const QMap< QString, WindDirections > &  windDirList,
const QString &  windDirection 
)

Returns wind icon element to display in applet.

Return wind direction svg element to display in applet when given a wind direction.

Parameters:
windDirList a QList map pair of wind directions mapped to a enumeration of directions.
windDirection the current wind direction.
Returns:
svg element for wind direction

Definition at line 106 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.

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::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.


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

Plasma

Skip menu "Plasma"
  • 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
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
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