Marble

KmlDocumentTagWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2009 Andrew Manson <g.real.ate@gmail.com>
4//
5
6#include "KmlDocumentTagWriter.h"
7
8#include "GeoDataDocument.h"
9#include "GeoDataSchema.h"
10#include "GeoDataStyle.h"
11#include "GeoDataStyleMap.h"
12#include "GeoDocument.h"
13#include "GeoWriter.h"
14#include "KmlElementDictionary.h"
15
16#include "GeoDataTypes.h"
17
18#include <QList>
19
20namespace Marble
21{
22
23static GeoTagWriterRegistrar s_writerDocument(GeoTagWriter::QualifiedName(QString::fromLatin1(GeoDataTypes::GeoDataDocumentType),
24 QString::fromLatin1(kml::kmlTag_nameSpaceOgc22)),
25 new KmlDocumentTagWriter());
26
27KmlDocumentTagWriter::KmlDocumentTagWriter()
28 : KmlFeatureTagWriter(QString::fromLatin1(kml::kmlTag_Document))
29{
30 // nothing to do
31}
32
33bool KmlDocumentTagWriter::writeMid(const GeoNode *node, GeoWriter &writer) const
34{
35 const auto document = static_cast<const GeoDataDocument *>(node);
36
37 for (const GeoDataStyle::ConstPtr &style : document->styles()) {
38 writeElement(style.data(), writer);
39 }
40 for (const GeoDataStyleMap &map : document->styleMaps()) {
41 writeElement(&map, writer);
42 }
43 for (const GeoDataSchema &schema : document->schemas()) {
44 writeElement(&schema, writer);
45 }
46
47 QList<GeoDataFeature *>::ConstIterator it = document->constBegin();
48 QList<GeoDataFeature *>::ConstIterator const end = document->constEnd();
49
50 for (; it != end; ++it) {
51 writeElement(*it, writer);
52 }
53
54 return true;
55}
56
57}
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
QAction * end(const QObject *recvr, const char *slot, QObject *parent)
Binds a QML item to a specific geodetic location in screen coordinates.
QString fromLatin1(QByteArrayView str)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.