• 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
WeatherItem.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 // Copyright 2012 Illya Kovalevskyy <illya.kovalevskyy@gmail.com>
10 //
11 
12 #ifndef WEATHERITEM_H
13 #define WEATHERITEM_H
14 
15 // Marble
16 #include "AbstractDataPluginItem.h"
17 #include "MarbleWidget.h"
18 
19 // Qt
20 #include <QMap>
21 
22 class QString;
23 class QAction;
24 class QDate;
25 
26 namespace Marble
27 {
28 
29 class WeatherData;
30 
31 class WeatherItemPrivate;
32 
37 class WeatherItem : public AbstractDataPluginItem
38 {
39  Q_OBJECT
40 
41  Q_PROPERTY( QString station READ stationName WRITE setStationName NOTIFY stationNameChanged )
42  Q_PROPERTY( QString description READ description NOTIFY descriptionChanged )
43  Q_PROPERTY( QString image READ image NOTIFY imageChanged )
44  Q_PROPERTY( double temperature READ temperature NOTIFY temperatureChanged )
45 
46  public:
47  explicit WeatherItem( QObject *parent = 0 );
48  explicit WeatherItem( MarbleWidget* widget, QObject *parent = 0 );
49  ~WeatherItem();
50 
51  QAction *action();
52 
56  virtual bool request( const QString& type );
57 
61  virtual QString service() const = 0;
62 
63  bool initialized() const;
64 
65  virtual void addDownloadedFile( const QString& url, const QString& type ) = 0;
66 
67  bool operator<( const AbstractDataPluginItem *other ) const;
68 
69  QString stationName() const;
70  void setStationName( const QString& name );
71 
72  WeatherData currentWeather() const;
73  void setCurrentWeather( const WeatherData& weather );
74 
75  QMap<QDate, WeatherData> forecastWeather() const;
76  void setForecastWeather( const QMap<QDate, WeatherData>& forecasts );
77 
82  void addForecastWeather( const QList<WeatherData>& forecasts );
83 
84  quint8 priority() const;
85  void setPriority( quint8 priority );
86 
87  void setSettings( const QHash<QString, QVariant>& settings );
88 
89  void setMarbleWidget( MarbleWidget *widget );
90 
91  virtual QList<QAction*> actions();
92 
93  QString description() const;
94 
95  QString image() const;
96 
97  double temperature() const;
98 
99  public Q_SLOTS:
100  void openBrowser();
101 
102 Q_SIGNALS:
103  void stationNameChanged();
104 
105  void descriptionChanged();
106 
107  void imageChanged();
108 
109  void temperatureChanged();
110 
111  private:
112  Q_DISABLE_COPY(WeatherItem)
113  WeatherItemPrivate * const d;
114  friend class WeatherItemPrivate;
115  QString createFromTemplate(const QString &templateHtml);
116 };
117 
118 } // namespace Marble
119 
120 #endif // WEATHERITEM_H
Marble::WeatherItem::stationNameChanged
void stationNameChanged()
Marble::AbstractDataPluginItem
Definition: AbstractDataPluginItem.h:28
Marble::WeatherItem::currentWeather
WeatherData currentWeather() const
Definition: WeatherItem.cpp:395
QMap
Marble::WeatherItem::WeatherItemPrivate
friend class WeatherItemPrivate
Definition: WeatherItem.h:114
Marble::WeatherItem::initialized
bool initialized() const
Definition: WeatherItem.cpp:360
Marble::WeatherItem::descriptionChanged
void descriptionChanged()
Marble::WeatherItem::forecastWeather
QMap< QDate, WeatherData > forecastWeather() const
Definition: WeatherItem.cpp:411
Marble::MarbleWidget
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:104
Marble::WeatherData
Definition: WeatherData.h:26
Marble::WeatherItem::imageChanged
void imageChanged()
QObject::name
const char * name() const
Marble::WeatherItem::addDownloadedFile
virtual void addDownloadedFile(const QString &url, const QString &type)=0
QHash
Marble::WeatherItem::actions
virtual QList< QAction * > actions()
Definition: WeatherItem.cpp:541
Marble::WeatherItem::setStationName
void setStationName(const QString &name)
Definition: WeatherItem.cpp:384
QObject
Marble::WeatherItem::request
virtual bool request(const QString &type)
Test if the item wants to request type again.
Definition: WeatherItem.cpp:354
Marble::WeatherItem::priority
quint8 priority() const
Definition: WeatherItem.cpp:455
Marble::WeatherItem::setForecastWeather
void setForecastWeather(const QMap< QDate, WeatherData > &forecasts)
Definition: WeatherItem.cpp:416
Marble::WeatherItem::addForecastWeather
void addForecastWeather(const QList< WeatherData > &forecasts)
Adds additional forecasts to the list.
Definition: WeatherItem.cpp:424
Marble::WeatherItem::setPriority
void setPriority(quint8 priority)
Definition: WeatherItem.cpp:460
QDate
QString
QList
Marble::WeatherItem::action
QAction * action()
Returns the action of this specific item.
Definition: WeatherItem.cpp:345
Marble::WeatherItem::stationName
QString stationName() const
Definition: WeatherItem.cpp:379
Marble::WeatherItem::setSettings
void setSettings(const QHash< QString, QVariant > &settings)
Set the settings of the item.
Definition: WeatherItem.cpp:465
Marble::WeatherItem::station
QString station
Definition: WeatherItem.h:41
QAction
MarbleWidget.h
This file contains the headers for MarbleWidget.
Marble::WeatherItem::setMarbleWidget
void setMarbleWidget(MarbleWidget *widget)
Definition: WeatherItem.cpp:478
Marble::WeatherItem::description
QString description() const
Marble::WeatherItem::temperature
double temperature() const
Marble::WeatherItem::openBrowser
void openBrowser()
Definition: WeatherItem.cpp:483
QObject::parent
QObject * parent() const
Marble::WeatherItem
This is the class painting a weather item on the screen.
Definition: WeatherItem.h:37
AbstractDataPluginItem.h
Marble::WeatherItem::service
virtual QString service() const =0
Returns the provider of the weather information.
Marble::WeatherItem::temperatureChanged
void temperatureChanged()
Marble::WeatherItem::image
QString image() const
Marble::WeatherItem::setCurrentWeather
void setCurrentWeather(const WeatherData &weather)
Definition: WeatherItem.cpp:400
QVariant
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