KOSMIndoorMap

osmelement.h
1/*
2 SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KOSMINDOORMAP_OSMELEMENT_H
8#define KOSMINDOORMAP_OSMELEMENT_H
9
10#include <osm/element.h>
11
12#include <QJSValue>
13#include <QMetaType>
14#include <QPointF>
15#include <QUrl>
16
17namespace KOSMIndoorMap {
18
19/** QML wrapper around an OSM element. */
21{
22 Q_GADGET
23 Q_PROPERTY(bool isNull READ isNull)
24 Q_PROPERTY(qint64 id READ id)
25 Q_PROPERTY(QString name READ name)
26 Q_PROPERTY(QString url READ url)
27 Q_PROPERTY(OSM::Element element READ element)
28 Q_PROPERTY(QPointF center READ center)
29public:
30 OSMElement();
31 explicit OSMElement(OSM::Element e);
33
34 [[nodiscard]] bool operator==(const OSMElement&) const = default;
35
36 [[nodiscard]] bool isNull() const;
37 [[nodiscard]] qint64 id() const;
38 [[nodiscard]] QString name() const;
39 [[nodiscard]] QString url() const;
40 [[nodiscard]] QPointF center() const;
41
42 [[nodiscard]] Q_INVOKABLE QString tagValue(const QJSValue &key) const;
43
44 // @internal
45 [[nodiscard]] OSM::Element element() const;
46
47private:
48 OSM::Element m_element;
49};
50
51}
52
53Q_DECLARE_METATYPE(KOSMIndoorMap::OSMElement)
54
55#endif // KOSMINDOORMAP_OSMELEMENT_H
QML wrapper around an OSM element.
Definition osmelement.h:21
A reference to any of OSM::Node/OSM::Way/OSM::Relation.
Definition element.h:24
OSM-based multi-floor indoor maps for buildings.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.