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

Plasma

WeatherUtils Namespace Reference


Enumerations

enum  Unit {
  NoUnit = 0, Celsius, Fahrenheit, Kelvin,
  KilometersAnHour, MetersPerSecond, MilesAnHour, Kilopascals,
  InchesHG, Millibars, Hectopascals, Centimeters,
  Millimeters, Inches, Knots, Beaufort,
  Kilometers, Miles
}

Functions

float convert (float value, int srcUnit, int destUnit)
QString degreesToCardinal (float degrees)
QString getUnitString (int unit, bool plain=false)
int kilometersToBeaufort (float km)
int knotsToBeaufort (float knots)
int metersPerSecondToBeaufort (float ms)
int milesToBeaufort (float miles)

Enumeration Type Documentation

enum WeatherUtils::Unit

Enumerator:
NoUnit 
Celsius 
Fahrenheit 
Kelvin 
KilometersAnHour 
MetersPerSecond 
MilesAnHour 
Kilopascals 
InchesHG 
Millibars 
Hectopascals 
Centimeters 
Millimeters 
Inches 
Knots 
Beaufort 
Kilometers 
Miles 

Definition at line 32 of file weatherutils.h.


Function Documentation

ION_EXPORT float WeatherUtils::convert ( float  value,
int  srcUnit,
int  destUnit 
)

Convert from unit to another.

See WeatherUtils::Unit for available units.

Parameters:
value float to convert
srcUnit from which unit to convert
destUnit to which unit to convert
Returns:
converted value

Definition at line 29 of file weatherutils.cpp.

ION_EXPORT QString WeatherUtils::degreesToCardinal ( float  degrees  ) 

Converts wind/sun direction given in degrees to the nearest cardinal direction.

Parameters:
degrees wind direction in degrees.
Returns:
a cardinal if available, empty string on error.

Definition at line 269 of file weatherutils.cpp.

ION_EXPORT QString WeatherUtils::getUnitString ( int  unit,
bool  plain = false 
)

Returns a string presentation of of WeatherUtils::Unit.

Set plain to true in case you don't want a localized version of it.

Parameters:
unit unit to convert.
plain if true, returned string is not localized. defaults to false.
Returns:
a string presentation of WeatherUtils::Unit. Empty string if called for invalid unit.

Definition at line 159 of file weatherutils.cpp.

int WeatherUtils::kilometersToBeaufort ( float  km  ) 

Definition at line 348 of file weatherutils.cpp.

int WeatherUtils::knotsToBeaufort ( float  knots  ) 

For internal use only.

Definition at line 312 of file weatherutils.cpp.

int WeatherUtils::metersPerSecondToBeaufort ( float  ms  ) 

Definition at line 353 of file weatherutils.cpp.

int WeatherUtils::milesToBeaufort ( float  miles  ) 

Definition at line 343 of file weatherutils.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