Loading...
Searching...
No Matches
QXmppGeolocItem.h
// SPDX-FileCopyrightText: 2022 Cochise César <cochisecesar@zoho.com>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPGEOLOCITEM_H
#define QXMPPGEOLOCITEM_H
#include "QXmppConstants_p.h"
#include "QXmppPubSubBaseItem.h"
#include <optional>
#include <QSharedDataPointer>
class QXmppGeolocItemPrivate;
class QXMPP_EXPORT QXmppGeolocItem : public QXmppPubSubBaseItem
{
public:
QXmppGeolocItem();
QXmppGeolocItem(const QXmppGeolocItem &other);
QXmppGeolocItem(QXmppGeolocItem &&);
~QXmppGeolocItem() override;
QXmppGeolocItem &operator=(const QXmppGeolocItem &other);
QXmppGeolocItem &operator=(QXmppGeolocItem &&);
std::optional<double> accuracy() const;
void setAccuracy(std::optional<double> accuracy);
QString country() const;
void setCountry(QString country);
std::optional<double> latitude() const;
void setLatitude(std::optional<double> lat);
QString locality() const;
void setLocality(QString locality);
std::optional<double> longitude() const;
void setLongitude(std::optional<double> lon);
static bool isItem(const QDomElement &itemElement);
static constexpr std::tuple XmlTag = { u"geoloc", QXmpp::Private::ns_geoloc };
protected:
void parsePayload(const QDomElement &payloadElement) override;
void serializePayload(QXmlStreamWriter *writer) const override;
private:
QSharedDataPointer<QXmppGeolocItemPrivate> d;
};
Q_DECLARE_METATYPE(QXmppGeolocItem)
#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