Marble

KmlExtendedDataTagHandler.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010 Harshit Jain <hjain.itbhu@gmail.com>
4//
5
6#include "KmlExtendedDataTagHandler.h"
7
8#include "MarbleDebug.h"
9
10#include "KmlElementDictionary.h"
11#include "GeoDataExtendedData.h"
12#include "GeoDataFeature.h"
13#include "GeoDataTrack.h"
14
15#include "GeoParser.h"
16
17namespace Marble
18{
19namespace kml
20{
21KML_DEFINE_TAG_HANDLER( ExtendedData )
22
23GeoNode* KmlExtendedDataTagHandler::parse( GeoParser& parser ) const
24{
25 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_ExtendedData)));
26
27 GeoStackItem parentItem = parser.parentElement();
28
29 if( parentItem.is<GeoDataFeature>() ) {
30 GeoDataExtendedData extendedData;
31 parentItem.nodeAs<GeoDataFeature>()->setExtendedData( extendedData );
32 return static_cast<GeoDataExtendedData*>( &parentItem.nodeAs<GeoDataFeature>()->extendedData() );
33 } else if( parentItem.is<GeoDataTrack>() ) {
34 GeoDataExtendedData extendedData;
35 parentItem.nodeAs<GeoDataTrack>()->setExtendedData( extendedData );
36 return static_cast<GeoDataExtendedData*>( &parentItem.nodeAs<GeoDataTrack>()->extendedData() );
37 } else {
38 return nullptr;
39 }
40
41}
42
43}
44}
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 Fri Jun 21 2024 12:00:07 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.