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

KDE's Doxygen guidelines are available online.