Marble

KmlUpdateTagHandler.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Mohammed Nafees <nafees.technocool@gmail.com>
4//
5
6#include "KmlUpdateTagHandler.h"
7
8#include "GeoDataAnimatedUpdate.h"
9#include "GeoDataNetworkLinkControl.h"
10#include "GeoDataParser.h"
11#include "GeoDataUpdate.h"
12#include "KmlElementDictionary.h"
13#include "KmlObjectTagHandler.h"
14
15namespace Marble
16{
17namespace kml
18{
19KML_DEFINE_TAG_HANDLER(Update)
20
21GeoNode *KmlUpdateTagHandler::parse(GeoParser &parser) const
22{
23 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1StringView(kmlTag_Update)));
24
25 auto update = new GeoDataUpdate;
26 KmlObjectTagHandler::parseIdentifiers(parser, update);
27 GeoStackItem parentItem = parser.parentElement();
28
29 if (parentItem.represents(kmlTag_NetworkLinkControl)) {
30 return &parentItem.nodeAs<GeoDataNetworkLinkControl>()->update();
31 } else if (parentItem.represents(kmlTag_AnimatedUpdate)) {
32 parentItem.nodeAs<GeoDataAnimatedUpdate>()->setUpdate(update);
33 return update;
34 }
35 return nullptr;
36}
37
38}
39}
void update(Part *part, const QByteArray &data, qint64 dataSize)
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.