Marble

KmlSchemaTagHandler.cpp
1 /*
2  SPDX-FileCopyrightText: 2008 Patrick Spendrin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "KmlSchemaTagHandler.h"
8 
9 #include "MarbleDebug.h"
10 
11 #include "KmlElementDictionary.h"
12 #include "KmlObjectTagHandler.h"
13 #include "GeoDataDocument.h"
14 #include "GeoDataSchema.h"
15 
16 #include "GeoParser.h"
17 
18 namespace Marble
19 {
20 namespace kml
21 {
22 KML_DEFINE_TAG_HANDLER( Schema )
23 
24 GeoNode* KmlSchemaTagHandler::parse( GeoParser& parser ) const
25 {
26  Q_ASSERT(parser.isStartElement() && parser.isValidElement(QLatin1String(kmlTag_Schema)));
27 
28  GeoStackItem parentItem = parser.parentElement();
29 
30  if( parentItem.represents( kmlTag_Document ) ) {
31  GeoDataSchema schema;
32  KmlObjectTagHandler::parseIdentifiers( parser, &schema );
33  QString name = parser.attribute( "name" ).trimmed();
34 
35  schema.setSchemaName( name );
36  parentItem.nodeAs<GeoDataDocument>()->addSchema( schema );
37  return &parentItem.nodeAs<GeoDataDocument>()->schema( schema.id() );
38  }
39  return nullptr;
40 
41 }
42 
43 }
44 }
QString trimmed() const const
Binds a QML item to a specific geodetic location in screen coordinates.
QString name(StandardShortcut id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Sep 25 2023 03:50:19 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.