QXmpp Version: 1.5.6
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 "QXmppPubSubBaseItem.h"
9
10#include <optional>
11
12#include <QSharedDataPointer>
13
14class QXmppGeolocItemPrivate;
15
16class QXMPP_EXPORT QXmppGeolocItem : public QXmppPubSubBaseItem
17{
18public:
23
26
27 std::optional<double> accuracy() const;
28 void setAccuracy(std::optional<double> accuracy);
29
30 QString country() const;
31 void setCountry(QString country);
32
33 std::optional<double> latitude() const;
34 void setLatitude(std::optional<double> lat);
35
36 QString locality() const;
37 void setLocality(QString locality);
38
39 std::optional<double> longitude() const;
40 void setLongitude(std::optional<double> lon);
41
42 static bool isItem(const QDomElement &itemElement);
43
44protected:
46 void parsePayload(const QDomElement &payloadElement) override;
47 void serializePayload(QXmlStreamWriter *writer) const override;
49
50private:
51 QSharedDataPointer<QXmppGeolocItemPrivate> d;
52};
53
54Q_DECLARE_METATYPE(QXmppGeolocItem)
55
56#endif // QXMPPGEOLOCITEM_H
Definition QXmppGeolocItem.h:17
QXmppGeolocItem(QXmppGeolocItem &&)
Move-constructor.
QXmppGeolocItem & operator=(const QXmppGeolocItem &other)
Assignment operator.
QXmppGeolocItem(const QXmppGeolocItem &other)
Copy-constructor.
QXmppGeolocItem & operator=(QXmppGeolocItem &&)
Move-assignment operator.
Definition QXmppPubSubBaseItem.h:19
virtual void serializePayload(QXmlStreamWriter *writer) const
Definition QXmppPubSubBaseItem.cpp:150
virtual void parsePayload(const QDomElement &payloadElement)
Definition QXmppPubSubBaseItem.cpp:140
static bool isItem(const QDomElement &element)
Definition QXmppPubSubBaseItem.cpp:130