• 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
  • writers
  • kml
KmlNetworkLinkControlTagWriter.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 2014 Marek Hakala <hakala.marek@gmail.com>
9 //
10 
11 #include "KmlNetworkLinkControlTagWriter.h"
12 
13 #include "GeoDataNetworkLinkControl.h"
14 #include "GeoDataTypes.h"
15 #include "GeoWriter.h"
16 #include "KmlElementDictionary.h"
17 
18 namespace Marble
19 {
20 
21 static GeoTagWriterRegistrar s_writerNetworkLinkControl(
22  GeoTagWriter::QualifiedName( GeoDataTypes::GeoDataNetworkLinkControlType,
23  kml::kmlTag_nameSpaceOgc22 ),
24  new KmlNetworkLinkControlTagWriter );
25 
26 bool KmlNetworkLinkControlTagWriter::write( const GeoNode *node, GeoWriter& writer ) const
27 {
28  const GeoDataNetworkLinkControl *networkLinkControl = static_cast<const GeoDataNetworkLinkControl*>( node );
29 
30  writer.writeStartElement( kml::kmlTag_NetworkLinkControl );
31  writer.writeOptionalElement( kml::kmlTag_minRefreshPeriod, QString::number( networkLinkControl->minRefreshPeriod() ), "1" );
32  writer.writeOptionalElement( kml::kmlTag_maxSessionLength, QString::number( networkLinkControl->maxSessionLength() ), "2" );
33  writer.writeOptionalElement( kml::kmlTag_cookie, networkLinkControl->cookie() );
34  writer.writeOptionalElement( kml::kmlTag_message, networkLinkControl->message() );
35  writer.writeOptionalElement( kml::kmlTag_linkName, networkLinkControl->linkName() );
36  writer.writeOptionalElement( kml::kmlTag_linkDescription, networkLinkControl->linkDescription() );
37 
38  writer.writeStartElement( kml::kmlTag_linkSnippet );
39 
40  if( networkLinkControl->maxLines() > 0 ) {
41  writer.writeAttribute( "maxLines", QString::number( networkLinkControl->maxLines() ) );
42  }
43 
44  writer.writeCharacters( networkLinkControl->linkSnippet() );
45  writer.writeEndElement();
46 
47  writer.writeOptionalElement( kml::kmlTag_expires, networkLinkControl->expires().toString( Qt::ISODate ) );
48  writeElement( &networkLinkControl->update(), writer );
49  writer.writeEndElement();
50 
51  return true;
52 }
53 
54 }
QDateTime::toString
QString toString(Qt::DateFormat format) const
Marble::kml::kmlTag_message
const char * kmlTag_message
Definition: KmlElementDictionary.cpp:118
Marble::GeoWriter::writeOptionalElement
void writeOptionalElement(const QString &key, const QString &value, const QString &defaultValue=QString())
Convenience method to write value if value is not equal to defaultValue.
Definition: GeoWriter.cpp:98
Marble::kml::kmlTag_expires
const char * kmlTag_expires
Definition: KmlElementDictionary.cpp:66
Marble::GeoDataNetworkLinkControl::minRefreshPeriod
qreal minRefreshPeriod() const
Definition: GeoDataNetworkLinkControl.cpp:152
Marble::kml::kmlTag_linkSnippet
const char * kmlTag_linkSnippet
Definition: KmlElementDictionary.cpp:105
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
KmlNetworkLinkControlTagWriter.h
Marble::kml::kmlTag_minRefreshPeriod
const char * kmlTag_minRefreshPeriod
Definition: KmlElementDictionary.cpp:123
Marble::GeoDataNetworkLinkControl::maxLines
int maxLines() const
Definition: GeoDataNetworkLinkControl.cpp:222
Marble::GeoDataNetworkLinkControl::linkSnippet
QString linkSnippet() const
Definition: GeoDataNetworkLinkControl.cpp:212
Marble::GeoDataNetworkLinkControl::linkDescription
QString linkDescription() const
Definition: GeoDataNetworkLinkControl.cpp:202
Marble::KmlNetworkLinkControlTagWriter::write
virtual bool write(const GeoNode *node, GeoWriter &writer) const
Definition: KmlNetworkLinkControlTagWriter.cpp:26
Marble::GeoDataNetworkLinkControl::linkName
QString linkName() const
Definition: GeoDataNetworkLinkControl.cpp:192
GeoWriter.h
Marble::GeoDataNetworkLinkControl::update
GeoDataUpdate & update()
Definition: GeoDataNetworkLinkControl.cpp:242
Marble::GeoDataNetworkLinkControl::cookie
QString cookie() const
Definition: GeoDataNetworkLinkControl.cpp:172
QString::number
QString number(int n, int base)
Marble::GeoDataNetworkLinkControl::expires
QDateTime expires() const
Definition: GeoDataNetworkLinkControl.cpp:232
Marble::GeoDataNetworkLinkControl::message
QString message() const
Definition: GeoDataNetworkLinkControl.cpp:182
Marble::kml::kmlTag_linkName
const char * kmlTag_linkName
Definition: KmlElementDictionary.cpp:104
Marble::kml::kmlTag_maxSessionLength
const char * kmlTag_maxSessionLength
Definition: KmlElementDictionary.cpp:116
KmlElementDictionary.h
Marble::kml::kmlTag_NetworkLinkControl
const char * kmlTag_NetworkLinkControl
Definition: KmlElementDictionary.cpp:129
Marble::GeoWriter
Standard Marble way of writing XML This class is intended to be a standardised way of writing XML for...
Definition: GeoWriter.h:29
Marble::GeoTagWriter::QualifiedName
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
Definition: GeoTagWriter.h:48
Marble::kml::kmlTag_cookie
const char * kmlTag_cookie
Definition: KmlElementDictionary.cpp:53
Marble::kml::kmlTag_nameSpaceOgc22
const char * kmlTag_nameSpaceOgc22
Definition: KmlElementDictionary.cpp:34
Marble::GeoTagWriter::writeElement
bool writeElement(const GeoNode *object, GeoWriter &writer) const
Definition: GeoTagWriter.cpp:29
QXmlStreamWriter::writeAttribute
void writeAttribute(const QString &qualifiedName, const QString &value)
Marble::kml::kmlTag_linkDescription
const char * kmlTag_linkDescription
Definition: KmlElementDictionary.cpp:103
Marble::s_writerNetworkLinkControl
static GeoTagWriterRegistrar s_writerNetworkLinkControl(GeoTagWriter::QualifiedName(GeoDataTypes::GeoDataNetworkLinkControlType, kml::kmlTag_nameSpaceOgc22), new KmlNetworkLinkControlTagWriter)
Marble::GeoDataTypes::GeoDataNetworkLinkControlType
const char * GeoDataNetworkLinkControlType
Definition: GeoDataTypes.cpp:94
Marble::GeoDataNetworkLinkControl::maxSessionLength
qreal maxSessionLength() const
Definition: GeoDataNetworkLinkControl.cpp:162
GeoDataNetworkLinkControl.h
GeoDataTypes.h
Marble::GeoDataNetworkLinkControl
Definition: GeoDataNetworkLinkControl.h:27
QXmlStreamWriter::writeCharacters
void writeCharacters(const QString &text)
QXmlStreamWriter::writeEndElement
void writeEndElement()
QXmlStreamWriter::writeStartElement
void writeStartElement(const QString &qualifiedName)
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