• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • geodata
  • handlers
  • dgml
DgmlPaletteTagHandler.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
3  Copyright (C) 2008 Torsten Rahn <tackat@kde.org>
4  Copyright (C) 2008 Henry de Valence <hdevalence@gmail.com>
5 
6  This file is part of the KDE project
7 
8  This library is free software you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public
10  License as published by the Free Software Foundation either
11  version 2 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public License
19  aint with this library see the file COPYING.LIB. If not, write to
20  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  Boston, MA 02110-1301, USA.
22 */
23 
24 #include "DgmlPaletteTagHandler.h"
25 
26 #include "MarbleDebug.h"
27 
28 #include "DgmlElementDictionary.h"
29 #include "DgmlAttributeDictionary.h"
30 #include "DgmlAuxillaryDictionary.h"
31 #include "GeoParser.h"
32 #include "GeoSceneFilter.h"
33 #include "GeoScenePalette.h"
34 
35 namespace Marble
36 {
37 namespace dgml
38 {
39 DGML_DEFINE_TAG_HANDLER(Palette)
40 
41 GeoNode* DgmlPaletteTagHandler::parse(GeoParser& parser) const
42 {
43  // Check whether the tag is valid
44  Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Palette));
45 
46  QString type = parser.attribute(dgmlAttr_type).toLower().trimmed();
47  QString file = parser.readElementText().trimmed();
48 
49  GeoScenePalette *palette = 0;
50 
51  // Checking for parent palette
52  GeoStackItem parentItem = parser.parentElement();
53  if (parentItem.represents(dgmlTag_Filter)) {
54  palette = new GeoScenePalette( type, file );
55  parentItem.nodeAs<GeoSceneFilter>()->addPalette( palette );
56  }
57 
58  return palette;
59 }
60 
61 }
62 }
DgmlAttributeDictionary.h
Marble::dgml::dgmlTag_Palette
const char * dgmlTag_Palette
Definition: DgmlElementDictionary.cpp:60
GeoScenePalette.h
DGML_DEFINE_TAG_HANDLER
#define DGML_DEFINE_TAG_HANDLER(Name)
Definition: DgmlElementDictionary.h:85
Marble::GeoStackItem::nodeAs
T * nodeAs()
Definition: GeoParser.h:120
DgmlAuxillaryDictionary.h
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
GeoParser.h
DgmlPaletteTagHandler.h
Marble::dgml::DgmlPaletteTagHandler
Definition: DgmlPaletteTagHandler.h:34
MarbleDebug.h
Marble::GeoParser
Definition: GeoParser.h:40
Marble::GeoStackItem::represents
bool represents(const char *tagName) const
Definition: GeoParser.h:113
Marble::dgml::dgmlTag_Filter
const char * dgmlTag_Filter
Definition: DgmlElementDictionary.cpp:45
GeoSceneFilter.h
QString::trimmed
QString trimmed() const
DgmlElementDictionary.h
Marble::GeoStackItem
Definition: GeoParser.h:97
QString
QString::toLower
QString toLower() const
Marble::GeoSceneFilter
Filter of a GeoScene document.
Definition: GeoSceneFilter.h:39
Marble::GeoScenePalette
Palette of a GeoScene document.
Definition: GeoScenePalette.h:36
Marble::dgml::dgmlAttr_type
const char * dgmlAttr_type
Definition: DgmlAttributeDictionary.cpp:69
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:38 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal