Marble

GeoUriParser.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2014 Levente Kurusa <levex@linux.com>
4//
5
6#ifndef MARBLE_GEOURIPARSER_H
7#define MARBLE_GEOURIPARSER_H
8
9#include "GeoDataCoordinates.h"
10#include "Planet.h"
11#include "marble_export.h"
12
13namespace Marble
14{
15
16/**
17 * A class for parsing Geo: URIs.
18 * Wikipage: https://en.wikipedia.org/wiki/Geo_URI
19 * RFC: 5870 (8 June 2010)
20 */
21class MARBLE_EXPORT GeoUriParser
22{
23public:
24 /**
25 * Constructs a new GeoUriParser with the given Geo URI
26 */
27 explicit GeoUriParser(const QString &geoUri = QString());
28
29 /**
30 * Returns the Geo URI stored in this parser
31 */
32 QString geoUri() const;
33 /**
34 * Set the Geo URI to be parsed.
35 */
36 void setGeoUri(const QString &geoUri);
37
38 /**
39 * Returns the coordinates parsed.
40 * null is returned when parsing was not successful.
41 */
42 GeoDataCoordinates coordinates() const;
43
44 /**
45 * Returns the Planet on which the coordinates are valid.
46 */
47 Planet planet() const;
48
49 /**
50 * Parse the given Geo URI
51 *
52 * \returns true iff the GeoURI is valid and was successfully parsed
53 */
54 bool parse();
55
56private:
57 static QString queryValue(const QUrl &url, const QString &key, const QString &secondaryKey = QString());
58
59 QString m_geoUri;
60 GeoDataCoordinates m_coordinates;
61 Planet m_planet;
62};
63
64}
65
66#endif
A 3d point representation.
A class for parsing Geo: URIs.
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 Nov 8 2024 12:02:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.