digiKam
kmlgpsdataparser.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2006-05-16
7  * Description : a tool to export GPS data to KML file.
8  *
9  * Copyright (C) 2006-2007 by Stephane Pontier <shadow dot walker at free dot fr>
10  * Copyright (C) 2008-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_KML_GPS_DATA_PARSER_H
25 #define DIGIKAM_KML_GPS_DATA_PARSER_H
26 
27 // Qt includes
28 
29 #include <QDomDocument>
30 
31 // Local includes
32 
33 #include "geodataparser.h"
34 
36 {
37 
42 {
43 
44 public:
45 
46  explicit KMLGeoDataParser();
48 
52  QString lineString();
53 
59  void CreateTrackLine(QDomElement& parent, QDomDocument& root, int altitudeMode);
60 
67  void CreateTrackPoints(QDomElement& parent, QDomDocument& root, int timeZone, int altitudeMode);
68 
69 private:
70 
77  QDomElement addKmlElement(QDomElement& target, const QString& tag)
78  {
79  QDomElement kmlElement = kmlDocument->createElement( tag );
80  target.appendChild( kmlElement );
81 
82  return kmlElement;
83  }
84 
92  QDomElement addKmlTextElement(QDomElement& target, const QString& tag, const QString& text)
93  {
94  QDomElement kmlElement = kmlDocument->createElement( tag );
95  target.appendChild( kmlElement );
96  QDomText kmlTextElement = kmlDocument->createTextNode( text );
97  kmlElement.appendChild( kmlTextElement );
98 
99  return kmlElement;
100  }
101 
102 private:
103 
106  QDomDocument* kmlDocument;
107 };
108 
109 } // namespace DigikamGenericGeolocationEditPlugin
110 
111 #endif // DIGIKAM_KML_GPS_DATA_PARSER_H
a class derivated from GeoDataParser mainly to transform GPS data to KML
Definition: kmlgpsdataparser.h:42
~KMLGeoDataParser()
Definition: kmlgpsdataparser.cpp:39
void CreateTrackPoints(QDomElement &parent, QDomDocument &root, int timeZone, int altitudeMode)
Create a KML Element that will contain the points and of the GPS.
Definition: kmlgpsdataparser.cpp:85
QString lineString()
KMLGeoDataParser::KMLGeoDataParser::lineString()
Definition: kmlgpsdataparser.cpp:43
KMLGeoDataParser()
Definition: kmlgpsdataparser.cpp:33
void CreateTrackLine(QDomElement &parent, QDomDocument &root, int altitudeMode)
Create a KML Element that will contain the linetrace of the GPS.
Definition: kmlgpsdataparser.cpp:59
Definition: geolocationedit.cpp:97