Marble

KmlNetworkLinkTagWriter.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Adrian Draghici <draghici.adrian.b@gmail.com>
4//
5
6#include "KmlNetworkLinkTagWriter.h"
7
8#include "GeoDataLink.h"
9#include "GeoDataNetworkLink.h"
10#include "GeoDataTypes.h"
11#include "GeoWriter.h"
12#include "KmlElementDictionary.h"
13
14namespace Marble
15{
16
17static GeoTagWriterRegistrar s_writerNetworkLink(GeoTagWriter::QualifiedName(QString::fromLatin1(GeoDataTypes::GeoDataNetworkLinkType),
18 QString::fromLatin1(kml::kmlTag_nameSpaceOgc22)),
19 new KmlNetworkLinkTagWriter);
20
21bool KmlNetworkLinkTagWriter::write(const GeoNode *node, GeoWriter &writer) const
22{
23 const auto networkLink = static_cast<const GeoDataNetworkLink *>(node);
24
25 writer.writeStartElement(QString::fromUtf8(kml::kmlTag_NetworkLink));
26
27 writer.writeOptionalElement(QLatin1String(kml::kmlTag_name), networkLink->name());
28
29 writer.writeOptionalElement(QLatin1String(kml::kmlTag_visibility), QString::number(networkLink->isVisible()), QStringLiteral("1"));
30
31 writer.writeOptionalElement(QLatin1String(kml::kmlTag_refreshVisibility), QString::number(networkLink->refreshVisibility()), QStringLiteral("0"));
32
33 writer.writeOptionalElement(QLatin1String(kml::kmlTag_flyToView), QString::number(networkLink->flyToView()), QStringLiteral("0"));
34
35 writeElement(&networkLink->link(), writer);
36
37 writer.writeEndElement();
38
39 return true;
40}
41
42}
QPair< QString, QString > QualifiedName
Object Name and Namespace Pair This type is intended to be used in a similar way to.
Binds a QML item to a specific geodetic location in screen coordinates.
QString fromLatin1(QByteArrayView str)
QString fromUtf8(QByteArrayView str)
QString number(double n, char format, int precision)
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.