• 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
  • lib
  • marble
  • geodata
  • handlers
  • kml
KmlRefreshModeTagHandler.cpp
Go to the documentation of this file.
1 #include "KmlRefreshModeTagHandler.h"
2 #include "MarbleDebug.h"
3 #include "KmlElementDictionary.h"
4 #include "GeoDataLink.h"
5 #include "GeoParser.h"
6 
7 namespace Marble
8 {
9 namespace kml
10 {
11 KML_DEFINE_TAG_HANDLER( refreshMode )
12 
13 GeoNode* KmlrefreshModeTagHandler::parse( GeoParser& parser ) const
14 {
15  Q_ASSERT( parser.isStartElement() && parser.isValidElement( kmlTag_refreshMode ) );
16  GeoStackItem parentItem = parser.parentElement();
17  QString content = parser.readElementText().trimmed();
18  GeoDataLink::RefreshMode mode;
19 
20  if ( parentItem.is<GeoDataLink>()) {
21  if( content == QString( "onChange" ) ) {
22  mode = GeoDataLink::OnChange;
23  } else if( content == QString( "onExpire" ) ) {
24  mode = GeoDataLink::OnExpire;
25  } else if( content == QString( "onInterval" ) ) {
26  mode = GeoDataLink::OnInterval;
27  } else {
28  mode = GeoDataLink::OnChange;
29  mDebug() << "Value " << content << "set in kml file is invalid."
30  << "Value of <refreshMode> has been reset to onChange" ;
31  }
32  parentItem.nodeAs<GeoDataLink>()->setRefreshMode( mode );
33  }
34 
35  return 0;
36 }
37 
38 }
39 }
40 
Marble::GeoDataLink::OnInterval
Definition: GeoDataLink.h:27
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
GeoParser.h
Marble::GeoDataLink
Definition: GeoDataLink.h:22
MarbleDebug.h
Marble::GeoParser
Definition: GeoParser.h:40
Marble::kml::KmlrefreshModeTagHandler
Definition: KmlRefreshModeTagHandler.h:11
KmlElementDictionary.h
Marble::GeoDataLink::RefreshMode
RefreshMode
Definition: GeoDataLink.h:25
QString::trimmed
QString trimmed() const
GeoDataLink.h
Marble::GeoStackItem
Definition: GeoParser.h:97
KML_DEFINE_TAG_HANDLER
#define KML_DEFINE_TAG_HANDLER(Name)
Definition: KmlElementDictionary.h:242
QString
Marble::kml::kmlTag_refreshMode
const char * kmlTag_refreshMode
Definition: KmlElementDictionary.cpp:149
Marble::GeoDataLink::OnExpire
Definition: GeoDataLink.h:28
Marble::GeoDataLink::OnChange
Definition: GeoDataLink.h:26
KmlRefreshModeTagHandler.h
Marble::mDebug
QDebug mDebug()
a function to replace qDebug() in Marble library code
Definition: MarbleDebug.cpp:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:40 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