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

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • geodata
  • handlers
  • kml
KmlGxTimeSpanTagHandler.cpp
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 2013 Mayank Madan <maddiemadan@gmail.com>
9 //
10 
11 #include "KmlGxTimeSpanTagHandler.h"
12 
13 #include "MarbleDebug.h"
14 
15 #include "KmlElementDictionary.h"
16 #include "GeoDataTimeSpan.h"
17 #include "GeoDataFeature.h"
18 #include "GeoDataAbstractView.h"
19 #include "GeoParser.h"
20 
21 namespace Marble
22 {
23 namespace kml
24 {
25 namespace gx
26 {
27 
28 KML_DEFINE_TAG_HANDLER_GX22( TimeSpan )
29 
30 GeoNode* KmlTimeSpanTagHandler::parse( GeoParser& parser ) const
31 {
32  Q_ASSERT( parser.isStartElement() && parser.isValidElement( kmlTag_TimeSpan ) );
33 
34  GeoStackItem parentItem = parser.parentElement();
35  if ( parentItem.is<GeoDataFeature>() ) {
36  GeoDataTimeSpan timeSpan;
37  timeSpan.setBegin( QDateTime::fromString( "1752-01-02T00:00:00", Qt::ISODate ) );
38  timeSpan.setEnd( QDateTime::fromString( "7999-12-31T23:59:59", Qt::ISODate ) );
39  parentItem.nodeAs<GeoDataFeature>()->setTimeSpan( timeSpan );
40  return &parentItem.nodeAs<GeoDataFeature>()->timeSpan();
41  } else if ( parentItem.is<GeoDataAbstractView>() ) {
42  GeoDataTimeSpan timeSpan;
43  timeSpan.setBegin( QDateTime::fromString( "1752-01-02T00:00:00", Qt::ISODate ) );
44  timeSpan.setEnd( QDateTime::fromString( "7999-12-31T23:59:59", Qt::ISODate ) );
45  parentItem.nodeAs<GeoDataAbstractView>()->setTimeSpan( timeSpan );
46  return &parentItem.nodeAs<GeoDataAbstractView>()->timeSpan();
47  }
48 
49  return 0;
50 }
51 
52 }
53 }
54 }
Marble::kml::gx::KmlTimeSpanTagHandler
Definition: KmlGxTimeSpanTagHandler.h:23
Marble::kml::kmlTag_TimeSpan
const char * kmlTag_TimeSpan
Definition: KmlElementDictionary.cpp:186
Marble::GeoDataAbstractView
Definition: GeoDataAbstractView.h:28
GeoDataAbstractView.h
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
GeoParser.h
KmlGxTimeSpanTagHandler.h
MarbleDebug.h
GeoDataTimeSpan.h
Marble::GeoParser
Definition: GeoParser.h:40
Marble::GeoDataTimeSpan::setEnd
void setEnd(const QDateTime &end)
Set the ending instant of a timespan.
Definition: GeoDataTimeSpan.cpp:52
GeoDataFeature.h
KmlElementDictionary.h
Marble::GeoDataTimeSpan::setBegin
void setBegin(const QDateTime &begin)
Set the beginning instant of a timespan.
Definition: GeoDataTimeSpan.cpp:62
Marble::GeoStackItem
Definition: GeoParser.h:97
Marble::GeoDataTimeSpan
Definition: GeoDataTimeSpan.h:27
KML_DEFINE_TAG_HANDLER_GX22
#define KML_DEFINE_TAG_HANDLER_GX22(Name)
Definition: KmlElementDictionary.h:235
Marble::GeoDataFeature
A base class for all geodata features.
Definition: GeoDataFeature.h:55
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:50 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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