• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • plugins
  • render
  • weather
WeatherData.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2009 Bastian Holst <bastianholst@gmx.de>
9 //
10 
11 #ifndef WEATHERDATA_H
12 #define WEATHERDATA_H
13 
14 #include<QtGlobal>
15 #include<QCoreApplication>
16 
17 class QDate;
18 class QDateTime;
19 class QImage;
20 
21 namespace Marble
22 {
23 
24 class WeatherDataPrivate;
25 
26 class WeatherData
27 {
28  Q_DECLARE_TR_FUNCTIONS ( WeatherData )
29  public:
30  enum WeatherCondition {
31  // Clouds
32  ConditionNotAvailable,
33  ClearDay,
34  ClearNight,
35  FewCloudsDay,
36  FewCloudsNight,
37  PartlyCloudyDay,
38  PartlyCloudyNight,
39  Overcast,
40  // Rain
41  LightShowersDay,
42  LightShowersNight,
43  ShowersDay,
44  ShowersNight,
45  LightRain,
46  Rain,
47  // Special
48  ChanceThunderstormDay,
49  ChanceThunderstormNight,
50  Thunderstorm,
51  Hail,
52  ChanceSnowDay,
53  ChanceSnowNight,
54  LightSnow,
55  Snow,
56  RainSnow,
57  Mist,
58  SandStorm // no icon available
59 // FreezingDrizzle, would be nice, but no icon for the moment
60 // Flurries, would be nice, but no icon available
61  // REMEMBER to change the implementation of conditionString() if you add items to this enum
62  };
63 
64  enum WindDirection {
65  N,
66  NNE,
67  NE,
68  ENE,
69  E,
70  SSE,
71  SE,
72  ESE,
73  S,
74  NNW,
75  NW,
76  WNW,
77  W,
78  SSW,
79  SW,
80  WSW,
81  DirectionNotAvailable
82  };
83 
84  enum PressureDevelopment {
85  Rising,
86  NoChange,
87  Falling,
88  PressureDevelopmentNotAvailable
89  };
90 
91  enum Visibility {
92  VeryGood,
93  Good,
94  Normal,
95  Poor,
96  VeryPoor,
97  Fog,
98  VisibilityNotAvailable
99  };
100 
101  enum SpeedUnit {
102  kph,
103  mph,
104  mps,
105  knots,
106  beaufort
107  };
108 
109  enum TemperatureUnit {
110  Celsius,
111  Fahrenheit,
112  Kelvin
113  };
114 
115  enum PressureUnit {
116  HectoPascal,
117  KiloPascal,
118  Bar,
119  mmHg,
120  inchHg
121  };
122 
123  WeatherData();
124  WeatherData( const WeatherData &other );
125  ~WeatherData();
126 
127  bool isValid() const;
128 
132  QDateTime publishingTime() const;
133 
137  void setPublishingTime( const QDateTime& dateTime );
138 
142  bool hasValidPublishingTime() const;
143 
147  QDate dataDate() const;
148 
152  void setDataDate( const QDate& date );
153 
157  bool hasValidDataDate() const;
158 
159  WeatherData::WeatherCondition condition() const;
160  void setCondition( WeatherData::WeatherCondition condition );
161  bool hasValidCondition() const;
162  QString conditionString() const;
163 
167  QImage icon() const;
168 
169  QString iconSource() const;
170 
171  WeatherData::WindDirection windDirection() const;
172  void setWindDirection( WeatherData::WindDirection direction );
173  bool hasValidWindDirection() const;
174  QString windDirectionString() const;
175 
176  qreal windSpeed( WeatherData::SpeedUnit format = WeatherData::mps ) const;
177  void setWindSpeed( qreal speed, WeatherData::SpeedUnit format = WeatherData::mps );
178  bool hasValidWindSpeed() const;
179  QString windSpeedString( WeatherData::SpeedUnit unit = WeatherData::kph ) const;
180 
181  qreal temperature( WeatherData::TemperatureUnit format = WeatherData::Kelvin ) const;
182  void setTemperature( qreal temp,
183  WeatherData::TemperatureUnit format = WeatherData::Kelvin );
184  bool hasValidTemperature() const;
185  QString temperatureString( WeatherData::TemperatureUnit format = WeatherData::Kelvin ) const;
186 
187  qreal maxTemperature( WeatherData::TemperatureUnit format = WeatherData::Kelvin ) const;
188  void setMaxTemperature( qreal temp,
189  WeatherData::TemperatureUnit format = WeatherData::Kelvin );
190  bool hasValidMaxTemperature() const;
191  QString maxTemperatureString( WeatherData::TemperatureUnit format = WeatherData::Kelvin ) const;
192 
193  qreal minTemperature( WeatherData::TemperatureUnit format = WeatherData::Kelvin ) const;
194  void setMinTemperature( qreal temp,
195  WeatherData::TemperatureUnit format = WeatherData::Kelvin );
196  bool hasValidMinTemperature() const;
197  QString minTemperatureString( WeatherData::TemperatureUnit format = WeatherData::Kelvin ) const;
198 
199  WeatherData::Visibility visibility() const;
200  void setVisibilty( WeatherData::Visibility visibility );
201  bool hasValidVisibility() const;
202 
203  qreal pressure( WeatherData::PressureUnit format = WeatherData::HectoPascal ) const;
204  void setPressure( qreal pressure,
205  WeatherData::PressureUnit format = WeatherData::HectoPascal );
206  bool hasValidPressure() const;
207  QString pressureString( WeatherData::PressureUnit format = WeatherData::HectoPascal ) const;
208 
209  WeatherData::PressureDevelopment pressureDevelopment() const;
210  void setPressureDevelopment( WeatherData::PressureDevelopment );
211  bool hasValidPressureDevelopment() const;
212  QString pressureDevelopmentString() const;
213 
214  qreal humidity() const;
215  void setHumidity( qreal humidity );
216  bool hasValidHumidity() const;
217  QString humidityString() const;
218 
219  QString toHtml( WeatherData::TemperatureUnit temperatureUnit,
220  WeatherData::SpeedUnit speedUnit,
221  WeatherData::PressureUnit pressureUnit ) const;
222 
223  WeatherData& operator=( const WeatherData &other );
224 
225  void detach();
226  private:
227  WeatherDataPrivate *d;
228 };
229 
230 } // namespace Marble
231 
232 #endif // WEATHERDATA_H
Marble::WeatherData::hasValidCondition
bool hasValidCondition() const
Definition: WeatherData.cpp:354
Marble::WeatherData::Rain
Definition: WeatherData.h:46
Marble::WeatherData::pressure
qreal pressure(WeatherData::PressureUnit format=WeatherData::HectoPascal) const
Definition: WeatherData.cpp:698
Marble::WeatherData::NW
Definition: WeatherData.h:75
Marble::WeatherData::LightShowersNight
Definition: WeatherData.h:42
Marble::WeatherData::inchHg
Definition: WeatherData.h:120
Marble::WeatherData::WindDirection
WindDirection
Definition: WeatherData.h:64
Marble::WeatherData::setCondition
void setCondition(WeatherData::WeatherCondition condition)
Definition: WeatherData.cpp:348
Marble::WeatherData::hasValidWindDirection
bool hasValidWindDirection() const
Definition: WeatherData.cpp:443
Marble::WeatherData::mps
Definition: WeatherData.h:104
Marble::WeatherData::hasValidPressureDevelopment
bool hasValidPressureDevelopment() const
Definition: WeatherData.cpp:786
Marble::WeatherData::Hail
Definition: WeatherData.h:51
Marble::WeatherData::setPressure
void setPressure(qreal pressure, WeatherData::PressureUnit format=WeatherData::HectoPascal)
Definition: WeatherData.cpp:721
Marble::WeatherData::Normal
Definition: WeatherData.h:94
Marble::WeatherData::minTemperatureString
QString minTemperatureString(WeatherData::TemperatureUnit format=WeatherData::Kelvin) const
Definition: WeatherData.cpp:665
Marble::WeatherData::icon
QImage icon() const
Get the icon showing the current condition.
Definition: WeatherData.cpp:409
Marble::WeatherData::setPressureDevelopment
void setPressureDevelopment(WeatherData::PressureDevelopment)
Definition: WeatherData.cpp:780
Marble::WeatherData::SW
Definition: WeatherData.h:79
Marble::WeatherData::publishingTime
QDateTime publishingTime() const
Get the time when the data was published.
Definition: WeatherData.cpp:311
Marble::WeatherData::PressureUnit
PressureUnit
Definition: WeatherData.h:115
Marble::WeatherData::LightShowersDay
Definition: WeatherData.h:41
Marble::WeatherData::ConditionNotAvailable
Definition: WeatherData.h:32
Marble::WeatherData::dataDate
QDate dataDate() const
Get the date the data is meant for.
Definition: WeatherData.cpp:327
Marble::WeatherData::windDirection
WeatherData::WindDirection windDirection() const
Definition: WeatherData.cpp:432
Marble::WeatherData::humidity
qreal humidity() const
Definition: WeatherData.cpp:805
Marble::WeatherData::hasValidDataDate
bool hasValidDataDate() const
Checks, if the data item has a valid data date.
Definition: WeatherData.cpp:338
Marble::WeatherData::setMaxTemperature
void setMaxTemperature(qreal temp, WeatherData::TemperatureUnit format=WeatherData::Kelvin)
Definition: WeatherData.cpp:643
Marble::WeatherData::WeatherCondition
WeatherCondition
Definition: WeatherData.h:30
Marble::WeatherData::Bar
Definition: WeatherData.h:118
Marble::WeatherData::SpeedUnit
SpeedUnit
Definition: WeatherData.h:101
Marble::WeatherData::TemperatureUnit
TemperatureUnit
Definition: WeatherData.h:109
Marble::WeatherData::PressureDevelopmentNotAvailable
Definition: WeatherData.h:88
Marble::WeatherData::Mist
Definition: WeatherData.h:57
Marble::WeatherData::~WeatherData
~WeatherData()
Definition: WeatherData.cpp:289
Marble::WeatherData::humidityString
QString humidityString() const
Definition: WeatherData.cpp:821
Marble::WeatherData::hasValidHumidity
bool hasValidHumidity() const
Definition: WeatherData.cpp:816
Marble::WeatherData::WNW
Definition: WeatherData.h:76
Marble::WeatherData
Definition: WeatherData.h:26
Marble::WeatherData::hasValidPressure
bool hasValidPressure() const
Definition: WeatherData.cpp:744
Marble::WeatherData::beaufort
Definition: WeatherData.h:106
Marble::WeatherData::isValid
bool isValid() const
Definition: WeatherData.cpp:295
Marble::WeatherData::setWindSpeed
void setWindSpeed(qreal speed, WeatherData::SpeedUnit format=WeatherData::mps)
Definition: WeatherData.cpp:536
Marble::WeatherData::pressureDevelopment
WeatherData::PressureDevelopment pressureDevelopment() const
Definition: WeatherData.cpp:775
Marble::WeatherData::hasValidPublishingTime
bool hasValidPublishingTime() const
Checks, if the data item has a valid publishing time.
Definition: WeatherData.cpp:322
Marble::WeatherData::LightRain
Definition: WeatherData.h:45
Marble::WeatherData::SSW
Definition: WeatherData.h:78
Marble::WeatherData::KiloPascal
Definition: WeatherData.h:117
Marble::WeatherData::Falling
Definition: WeatherData.h:87
Marble::WeatherData::condition
WeatherData::WeatherCondition condition() const
Definition: WeatherData.cpp:343
Marble::WeatherData::setDataDate
void setDataDate(const QDate &date)
Set the date the data is meant for.
Definition: WeatherData.cpp:332
Marble::WeatherData::setVisibilty
void setVisibilty(WeatherData::Visibility visibility)
Definition: WeatherData.cpp:687
Marble::WeatherData::pressureString
QString pressureString(WeatherData::PressureUnit format=WeatherData::HectoPascal) const
Definition: WeatherData.cpp:749
Marble::WeatherData::ClearDay
Definition: WeatherData.h:33
Marble::WeatherData::Kelvin
Definition: WeatherData.h:112
QDate
Marble::WeatherData::NE
Definition: WeatherData.h:67
Marble::WeatherData::maxTemperature
qreal maxTemperature(WeatherData::TemperatureUnit format=WeatherData::Kelvin) const
Definition: WeatherData.cpp:638
Marble::WeatherData::VeryPoor
Definition: WeatherData.h:96
Marble::WeatherData::ChanceSnowNight
Definition: WeatherData.h:53
Marble::WeatherData::Celsius
Definition: WeatherData.h:110
Marble::WeatherData::Overcast
Definition: WeatherData.h:39
QString
Marble::WeatherData::hasValidWindSpeed
bool hasValidWindSpeed() const
Definition: WeatherData.cpp:585
Marble::WeatherData::Rising
Definition: WeatherData.h:85
Marble::WeatherData::SandStorm
Definition: WeatherData.h:58
Marble::WeatherData::W
Definition: WeatherData.h:77
Marble::WeatherData::kph
Definition: WeatherData.h:102
Marble::WeatherData::N
Definition: WeatherData.h:65
Marble::WeatherData::PartlyCloudyNight
Definition: WeatherData.h:38
Marble::WeatherData::maxTemperatureString
QString maxTemperatureString(WeatherData::TemperatureUnit format=WeatherData::Kelvin) const
Definition: WeatherData.cpp:649
Marble::WeatherData::hasValidTemperature
bool hasValidTemperature() const
Definition: WeatherData.cpp:627
Marble::WeatherData::ChanceSnowDay
Definition: WeatherData.h:52
Marble::WeatherData::Good
Definition: WeatherData.h:93
QImage
Marble::WeatherData::HectoPascal
Definition: WeatherData.h:116
Marble::WeatherData::ShowersNight
Definition: WeatherData.h:44
Marble::WeatherData::WSW
Definition: WeatherData.h:80
Marble::WeatherData::operator=
WeatherData & operator=(const WeatherData &other)
Definition: WeatherData.cpp:875
Marble::WeatherData::WeatherData
WeatherData()
Definition: WeatherData.cpp:278
Marble::WeatherData::setTemperature
void setTemperature(qreal temp, WeatherData::TemperatureUnit format=WeatherData::Kelvin)
Definition: WeatherData.cpp:621
Marble::WeatherData::detach
void detach()
Definition: WeatherData.cpp:881
Marble::WeatherData::VisibilityNotAvailable
Definition: WeatherData.h:98
Marble::WeatherData::Visibility
Visibility
Definition: WeatherData.h:91
direction
qreal direction
Definition: tools/osm-addresses/OsmParser.cpp:40
Marble::WeatherData::Thunderstorm
Definition: WeatherData.h:50
Marble::WeatherData::Poor
Definition: WeatherData.h:95
Marble::WeatherData::hasValidMaxTemperature
bool hasValidMaxTemperature() const
Definition: WeatherData.cpp:655
Marble::WeatherData::windDirectionString
QString windDirectionString() const
Definition: WeatherData.cpp:448
Marble::WeatherData::mph
Definition: WeatherData.h:103
Marble::WeatherData::ENE
Definition: WeatherData.h:68
Marble::WeatherData::mmHg
Definition: WeatherData.h:119
Marble::WeatherData::PartlyCloudyDay
Definition: WeatherData.h:37
Marble::WeatherData::hasValidVisibility
bool hasValidVisibility() const
Definition: WeatherData.cpp:693
Marble::WeatherData::temperature
qreal temperature(WeatherData::TemperatureUnit format=WeatherData::Kelvin) const
Definition: WeatherData.cpp:616
Marble::WeatherData::windSpeed
qreal windSpeed(WeatherData::SpeedUnit format=WeatherData::mps) const
Definition: WeatherData.cpp:488
Marble::WeatherData::SSE
Definition: WeatherData.h:70
Marble::WeatherData::iconSource
QString iconSource() const
Definition: WeatherData.cpp:425
Marble::WeatherData::setMinTemperature
void setMinTemperature(qreal temp, WeatherData::TemperatureUnit format=WeatherData::Kelvin)
Definition: WeatherData.cpp:671
Marble::WeatherData::setHumidity
void setHumidity(qreal humidity)
Definition: WeatherData.cpp:810
Marble::WeatherData::DirectionNotAvailable
Definition: WeatherData.h:81
Marble::WeatherData::SE
Definition: WeatherData.h:71
Marble::WeatherData::minTemperature
qreal minTemperature(WeatherData::TemperatureUnit format=WeatherData::Kelvin) const
Definition: WeatherData.cpp:660
Marble::WeatherData::ClearNight
Definition: WeatherData.h:34
Marble::WeatherData::FewCloudsNight
Definition: WeatherData.h:36
Marble::WeatherData::Snow
Definition: WeatherData.h:55
Marble::WeatherData::LightSnow
Definition: WeatherData.h:54
Marble::WeatherData::pressureDevelopmentString
QString pressureDevelopmentString() const
Definition: WeatherData.cpp:791
Marble::WeatherData::S
Definition: WeatherData.h:73
Marble::WeatherData::RainSnow
Definition: WeatherData.h:56
Marble::WeatherData::ChanceThunderstormNight
Definition: WeatherData.h:49
Marble::WeatherData::temperatureString
QString temperatureString(WeatherData::TemperatureUnit format=WeatherData::Kelvin) const
Definition: WeatherData.cpp:632
Marble::WeatherData::ESE
Definition: WeatherData.h:72
Marble::WeatherData::setPublishingTime
void setPublishingTime(const QDateTime &dateTime)
Set the time when the data was published.
Definition: WeatherData.cpp:316
Marble::WeatherData::ShowersDay
Definition: WeatherData.h:43
Marble::WeatherData::Fog
Definition: WeatherData.h:97
Marble::WeatherData::Fahrenheit
Definition: WeatherData.h:111
Marble::WeatherData::conditionString
QString conditionString() const
Definition: WeatherData.cpp:359
Marble::WeatherData::knots
Definition: WeatherData.h:105
Marble::WeatherData::NoChange
Definition: WeatherData.h:86
Marble::WeatherData::PressureDevelopment
PressureDevelopment
Definition: WeatherData.h:84
Marble::WeatherData::toHtml
QString toHtml(WeatherData::TemperatureUnit temperatureUnit, WeatherData::SpeedUnit speedUnit, WeatherData::PressureUnit pressureUnit) const
Definition: WeatherData.cpp:826
Marble::WeatherData::VeryGood
Definition: WeatherData.h:92
Marble::WeatherData::windSpeedString
QString windSpeedString(WeatherData::SpeedUnit unit=WeatherData::kph) const
Definition: WeatherData.cpp:590
Marble::WeatherData::hasValidMinTemperature
bool hasValidMinTemperature() const
Definition: WeatherData.cpp:677
Marble::WeatherData::NNE
Definition: WeatherData.h:66
Marble::WeatherData::NNW
Definition: WeatherData.h:74
Marble::WeatherData::visibility
WeatherData::Visibility visibility() const
Definition: WeatherData.cpp:682
QDateTime
Marble::WeatherData::FewCloudsDay
Definition: WeatherData.h:35
Marble::WeatherData::setWindDirection
void setWindDirection(WeatherData::WindDirection direction)
Definition: WeatherData.cpp:437
Marble::WeatherData::ChanceThunderstormDay
Definition: WeatherData.h:48
Marble::WeatherData::E
Definition: WeatherData.h:69
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal