• 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
  • dgml
DgmlItemTagWriter.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 2011 Utku Aydın <utkuaydin34@gmail.com>
9 //
10 
11 #include "DgmlItemTagWriter.h"
12 
13 #include "GeoSceneTypes.h"
14 #include "GeoWriter.h"
15 #include "GeoSceneSection.h"
16 #include "GeoSceneItem.h"
17 #include "GeoSceneIcon.h"
18 #include "DgmlElementDictionary.h"
19 
20 namespace Marble
21 {
22 
23 static GeoTagWriterRegistrar s_writerItem( GeoTagWriter::QualifiedName( GeoSceneTypes::GeoSceneItemType, dgml::dgmlTag_nameSpace20 ),
24  new DgmlItemTagWriter() );
25 
26 bool DgmlItemTagWriter::write(const GeoNode *node, GeoWriter& writer) const
27 {
28  const GeoSceneItem *item = static_cast<const GeoSceneItem*>( node );
29 
30  writer.writeStartElement( dgml::dgmlTag_Item );
31  writer.writeAttribute( "name", item->name() );
32 
33  writer.writeStartElement( dgml::dgmlTag_Icon );
34  if( !item->icon()->pixmap().isEmpty() ) {
35  writer.writeAttribute( "pixmap", item->icon()->pixmap() );
36  } else if( !item->icon()->color().name().isEmpty() ) {
37  writer.writeAttribute( "color", item->icon()->color().name() );
38  }
39  writer.writeEndElement();
40  writer.writeElement( "text", item->text() );
41 
42  writer.writeEndElement();
43  return true;
44 }
45 
46 }
GeoSceneTypes.h
Marble::GeoSceneItem
The section item in a legend of a GeoScene document.
Definition: GeoSceneItem.h:38
DgmlItemTagWriter.h
Marble::GeoSceneItem::icon
const GeoSceneIcon * icon() const
Definition: GeoSceneItem.cpp:50
GeoSceneItem.h
QColor::name
QString name() const
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
Marble::GeoSceneTypes::GeoSceneItemType
const char * GeoSceneItemType
Definition: GeoSceneTypes.cpp:24
Marble::GeoSceneItem::text
QString text() const
Definition: GeoSceneItem.cpp:65
Marble::GeoWriter::writeElement
void writeElement(const QString &namespaceUri, const QString &key, const QString &value)
Convenience method to write value with key prefixed format namespaceUri.
Definition: GeoWriter.cpp:84
GeoWriter.h
QString::isEmpty
bool isEmpty() const
Marble::dgml::dgmlTag_nameSpace20
const char * dgmlTag_nameSpace20
Definition: DgmlElementDictionary.cpp:31
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::GeoSceneItem::name
QString name() const
Definition: GeoSceneItem.cpp:60
Marble::DgmlItemTagWriter::write
virtual bool write(const GeoNode *node, GeoWriter &writer) const
Definition: DgmlItemTagWriter.cpp:26
DgmlElementDictionary.h
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::dgml::dgmlTag_Icon
const char * dgmlTag_Icon
Definition: DgmlElementDictionary.cpp:50
QXmlStreamWriter::writeAttribute
void writeAttribute(const QString &qualifiedName, const QString &value)
GeoSceneSection.h
Marble::GeoSceneIcon::pixmap
QString pixmap() const
Definition: GeoSceneIcon.cpp:37
GeoSceneIcon.h
Marble::s_writerItem
static GeoTagWriterRegistrar s_writerItem(GeoTagWriter::QualifiedName(GeoSceneTypes::GeoSceneItemType, dgml::dgmlTag_nameSpace20), new DgmlItemTagWriter())
Marble::dgml::dgmlTag_Item
const char * dgmlTag_Item
Definition: DgmlElementDictionary.cpp:52
Marble::GeoSceneIcon::color
QColor color() const
Definition: GeoSceneIcon.cpp:47
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: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