• 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
BBCParser.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 BBCPARSER_H
12 #define BBCPARSER_H
13 
14 // Marble
15 #include "AbstractWorkerThread.h"
16 #include "WeatherData.h"
17 
18 // Qt
19 #include <QHash>
20 #include <QList>
21 #include <QMutex>
22 #include <QPointer>
23 #include <QStack>
24 #include <QXmlStreamReader>
25 
26 class QObject;
27 
28 namespace Marble
29 {
30 
31 class BBCWeatherItem;
32 
33 struct ScheduleEntry
34 {
35  QString path;
36  QPointer<BBCWeatherItem> item;
37  QString type;
38 };
39 
40 class BBCParser : public AbstractWorkerThread, public QXmlStreamReader
41 {
42  Q_OBJECT
43 public:
44  ~BBCParser();
45 
46  static BBCParser *instance();
47  void scheduleRead( const QString& path, BBCWeatherItem *item, const QString& type );
48 
49 protected:
50  bool workAvailable();
51  void work();
52 
53 Q_SIGNALS:
54  void parsedFile();
55 
56 private:
57  explicit BBCParser( QObject *parent = 0 );
58  QList<WeatherData> read( QIODevice *device );
59 
60  void readUnknownElement();
61  void readBBC();
62  void readChannel();
63  void readItem();
64  void readDescription( WeatherData *data );
65  void readTitle( WeatherData *data );
66  void readPubDate( WeatherData *data );
67 
68  QList<WeatherData> m_list;
69  QStack<ScheduleEntry> m_schedule;
70  QMutex m_scheduleMutex;
71 
72  QHash<QString, WeatherData::WeatherCondition> m_dayConditions;
73  QHash<QString, WeatherData::WeatherCondition> m_nightConditions;
74  QHash<QString, WeatherData::WindDirection> m_windDirections;
75  QHash<QString, WeatherData::PressureDevelopment> m_pressureDevelopments;
76  QHash<QString, WeatherData::Visibility> m_visibilityStates;
77  QHash<QString, int> m_monthNames;
78 };
79 
80 } // Marble namespace
81 
82 #endif // BBCPARSER_H
QIODevice
Marble::ScheduleEntry::path
QString path
Definition: BBCParser.h:35
QMutex
QPointer
Marble::BBCParser::instance
static BBCParser * instance()
Definition: BBCParser.cpp:185
Marble::WeatherData
Definition: WeatherData.h:26
Marble::BBCParser::work
void work()
Definition: BBCParser.cpp:213
Marble::BBCWeatherItem
Definition: BBCWeatherItem.h:22
QHash
QXmlStreamReader::device
QIODevice * device() const
QObject
Marble::BBCParser::scheduleRead
void scheduleRead(const QString &path, BBCWeatherItem *item, const QString &type)
Definition: BBCParser.cpp:191
Marble::ScheduleEntry::type
QString type
Definition: BBCParser.h:37
QString
QList
Marble::ScheduleEntry
Definition: BBCParser.h:33
Marble::ScheduleEntry::item
QPointer< BBCWeatherItem > item
Definition: BBCParser.h:36
Marble::BBCParser
Definition: BBCParser.h:40
QXmlStreamReader
Marble::BBCParser::parsedFile
void parsedFile()
Marble::BBCParser::~BBCParser
~BBCParser()
Definition: BBCParser.cpp:181
QObject::parent
QObject * parent() const
AbstractWorkerThread.h
WeatherData.h
Marble::AbstractWorkerThread
The AbstractWorkerThread is a class written for small tasks that have to run multiple times on differ...
Definition: AbstractWorkerThread.h:36
Marble::BBCParser::workAvailable
bool workAvailable()
Definition: BBCParser.cpp:207
QStack
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:38 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