Marble

KmlGxTimeStampTagHandler.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Mayank Madan <maddiemadan@gmail.com>
4//
5
6#include "KmlGxTimeStampTagHandler.h"
7
8#include "MarbleDebug.h"
9
10#include "KmlElementDictionary.h"
11#include "KmlObjectTagHandler.h"
12#include "GeoDataTimeStamp.h"
13#include "GeoDataFeature.h"
14#include "GeoParser.h"
15#include <GeoDataAbstractView.h>
16#include "KmlTimeStampTagHandler.h"
17
18namespace Marble
19{
20namespace kml
21{
22namespace gx
23{
24KML_DEFINE_TAG_HANDLER_GX22( TimeStamp )
25
26GeoNode* KmlTimeStampTagHandler::parse( GeoParser& parser ) const
27{
28 Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_TimeStamp)));
29 GeoStackItem parentItem = parser.parentElement();
30 GeoDataTimeStamp timestamp;
31 KmlObjectTagHandler::parseIdentifiers( parser, &timestamp );
32 if ( parentItem.is<GeoDataFeature>() ) {
33 parentItem.nodeAs<GeoDataFeature>()->setTimeStamp( timestamp );
34 return &parentItem.nodeAs<GeoDataFeature>()->timeStamp();
35 } else if ( parentItem.is<GeoDataAbstractView>() ) {
36 parentItem.nodeAs<GeoDataAbstractView>()->setTimeStamp( timestamp );
37 return &parentItem.nodeAs<GeoDataAbstractView>()->timeStamp();
38 }
39 return nullptr;
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 14 2024 11:54:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.