QXmpp: QXmppGeolocItem.h Source File

QXmpp Version: 1.14.3

Loading...
Searching...
No Matches
QXmppGeolocItem.h
1// SPDX-FileCopyrightText: 2022 Cochise César <cochisecesar@zoho.com>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPGEOLOCITEM_H
6#define QXMPPGEOLOCITEM_H
7
8#include "QXmppConstants_p.h"
9#include "QXmppPubSubBaseItem.h"
10
11#include <optional>
12
13#include <QSharedDataPointer>
14
15class QXmppGeolocItemPrivate;
16
17 class QXMPP_EXPORT QXmppGeolocItem : public QXmppPubSubBaseItem
18{
19public:
20 QXmppGeolocItem();
21 QXmppGeolocItem(const QXmppGeolocItem &other);
22 QXmppGeolocItem(QXmppGeolocItem &&);
23 ~QXmppGeolocItem() override;
24
25 QXmppGeolocItem &operator=(const QXmppGeolocItem &other);
26 QXmppGeolocItem &operator=(QXmppGeolocItem &&);
27
28 std::optional<double> accuracy() const;
29 void setAccuracy(std::optional<double> accuracy);
30
31 QString country() const;
32 void setCountry(QString country);
33
34 std::optional<double> latitude() const;
35 void setLatitude(std::optional<double> lat);
36
37 QString locality() const;
38 void setLocality(QString locality);
39
40 std::optional<double> longitude() const;
41 void setLongitude(std::optional<double> lon);
42
43 static bool isItem(const QDomElement &itemElement);
45 static constexpr std::tuple XmlTag = { u"geoloc", QXmpp::Private::ns_geoloc };
46
47protected:
48 void parsePayload(const QDomElement &payloadElement) override;
49 void serializePayload(QXmlStreamWriter *writer) const override;
51
52private:
53 QSharedDataPointer<QXmppGeolocItemPrivate> d;
54};
55
56Q_DECLARE_METATYPE(QXmppGeolocItem)
57
58#endif // QXMPPGEOLOCITEM_H
QXmppGeolocItem
Definition QXmppGeolocItem.h:18
QXmppGeolocItem::country
QString country() const
Definition QXmppGeolocItem.cpp:75
QXmppGeolocItem::QXmppGeolocItem
QXmppGeolocItem(QXmppGeolocItem &&)
Move-constructor.
QXmppGeolocItem::accuracy
std::optional< double > accuracy() const
Definition QXmppGeolocItem.cpp:59
QXmppGeolocItem::setLongitude
void setLongitude(std::optional< double > lon)
Definition QXmppGeolocItem.cpp:135
QXmppGeolocItem::operator=
QXmppGeolocItem & operator=(const QXmppGeolocItem &other)
Assignment operator.
QXmppGeolocItem::latitude
std::optional< double > latitude() const
Definition QXmppGeolocItem.cpp:91
QXmppGeolocItem::setAccuracy
void setAccuracy(std::optional< double > accuracy)
Definition QXmppGeolocItem.cpp:67
QXmppGeolocItem::QXmppGeolocItem
QXmppGeolocItem(const QXmppGeolocItem &other)
Copy-constructor.
QXmppGeolocItem::longitude
std::optional< double > longitude() const
Definition QXmppGeolocItem.cpp:127
QXmppGeolocItem::setCountry
void setCountry(QString country)
Definition QXmppGeolocItem.cpp:83
QXmppGeolocItem::setLatitude
void setLatitude(std::optional< double > lat)
Definition QXmppGeolocItem.cpp:99
QXmppGeolocItem::setLocality
void setLocality(QString locality)
Definition QXmppGeolocItem.cpp:119
QXmppGeolocItem::operator=
QXmppGeolocItem & operator=(QXmppGeolocItem &&)
Move-assignment operator.
QXmppGeolocItem::QXmppGeolocItem
QXmppGeolocItem()
Definition QXmppGeolocItem.cpp:41
QXmppGeolocItem::locality
QString locality() const
Definition QXmppGeolocItem.cpp:111
QXmppPubSubBaseItem::serializePayload
virtual void serializePayload(QXmlStreamWriter *writer) const
Definition QXmppPubSubBaseItem.cpp:154
QXmppPubSubBaseItem::QXmppPubSubBaseItem
QXmppPubSubBaseItem(const QString &id={}, const QString &publisher={})
Definition QXmppPubSubBaseItem.cpp:62
QXmppPubSubBaseItem::parsePayload
virtual void parsePayload(const QDomElement &payloadElement)
Definition QXmppPubSubBaseItem.cpp:144
QXmppPubSubBaseItem::isItem
static bool isItem(const QDomElement &element)
Definition QXmppPubSubBaseItem.cpp:134