• 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
  • writer
GeoTagWriter.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 Andrew Manson <g.real.ate@gmail.com>
9 // Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
10 //
11 
12 #ifndef MARBLE_GEOTAGWRITER_H
13 #define MARBLE_GEOTAGWRITER_H
14 
15 #include <QPair>
16 #include <QHash>
17 
18 namespace Marble
19 {
20 
21 class GeoDataObject;
22 class GeoNode;
23 class GeoWriter;
24 
31 class GeoTagWriter
32 {
33 public:
34  virtual bool write( const GeoNode *node, GeoWriter& writer ) const = 0;
35 
48  typedef QPair<QString, QString> QualifiedName;
49 
50 protected:
51  GeoTagWriter();
52  virtual ~GeoTagWriter();
53 
54  bool writeElement( const GeoNode* object, GeoWriter& writer ) const;
55 
56 private:
57  // Only our registrar is allowed to register tag writers.
58  friend struct GeoTagWriterRegistrar;
59  static void registerWriter(const QualifiedName&, const GeoTagWriter*);
60 
61 private:
62  //Collect the Tag Writers and provide a singleton like accessor
63  typedef QHash<QualifiedName, const GeoTagWriter*> TagHash;
64  static TagHash* tagWriterHash();
65 
66 private:
67  // Only our writer is allowed to access tag handlers.
68  friend class GeoWriter;
69  static const GeoTagWriter* recognizes(const QualifiedName&);
70 };
71 
72 // Helper structure
73 struct GeoTagWriterRegistrar
74 {
75 public:
76  GeoTagWriterRegistrar(const GeoTagWriter::QualifiedName& name, const GeoTagWriter* writer)
77  {
78  GeoTagWriter::registerWriter(name, writer);
79  }
80 };
81 
82 }
83 
84 #endif
Marble::GeoTagWriter::GeoTagWriter
GeoTagWriter()
Definition: GeoTagWriter.cpp:21
Marble::GeoTagWriterRegistrar
Definition: GeoTagWriter.h:73
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
Marble::GeoTagWriterRegistrar::GeoTagWriterRegistrar
GeoTagWriterRegistrar(const GeoTagWriter::QualifiedName &name, const GeoTagWriter *writer)
Definition: GeoTagWriter.h:76
QHash
Marble::GeoTagWriter
Base class intended to be subclassed by specific XML tag writers This class provides a base class tha...
Definition: GeoTagWriter.h: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::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::GeoTagWriter::write
virtual bool write(const GeoNode *node, GeoWriter &writer) const =0
QPair< QString, QString >
Marble::GeoTagWriter::writeElement
bool writeElement(const GeoNode *object, GeoWriter &writer) const
Definition: GeoTagWriter.cpp:29
Marble::GeoTagWriter::~GeoTagWriter
virtual ~GeoTagWriter()
Definition: GeoTagWriter.cpp:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 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