QXmpp: QXmppExternalService.h Source File

QXmpp Version: 1.14.2

Loading...
Searching...
No Matches
QXmppExternalService.h
1// SPDX-FileCopyrightText: 2023 Tibor Csötönyi <work@taibsu.de>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPEXTERNALSERVICE_H
6#define QXMPPEXTERNALSERVICE_H
7
8#include "QXmppConstants_p.h"
9#include "QXmppGlobal.h"
10
11#include <optional>
12
13#include <QSharedDataPointer>
14
15class QDateTime;
16class QDomElement;
17class QXmlStreamWriter;
18class QXmppExternalServicePrivate;
19
20 class QXMPP_EXPORT QXmppExternalService
21{
22public:
28 enum class Action {
29 Add,
30 Delete,
31 Modify
32 };
33
39 enum class Transport {
40 Tcp,
41 Udp
42 };
43
44 QXmppExternalService();
45
46 QXMPP_PRIVATE_DECLARE_RULE_OF_SIX(QXmppExternalService)
47
48 QString host() const;
49 void setHost(const QString &);
50
51 QString type() const;
52 void setType(const QString &);
53
54 std::optional<Action> action() const;
55 void setAction(std::optional<Action>);
56
57 std::optional<QDateTime> expires() const;
58 void setExpires(std::optional<QDateTime>);
59
60 std::optional<QString> name() const;
61 void setName(std::optional<QString>);
62
63 std::optional<QString> password() const;
64 void setPassword(std::optional<QString>);
65
66 std::optional<quint16> port() const;
67 void setPort(std::optional<quint16>);
68
69 std::optional<bool> restricted() const;
70 void setRestricted(std::optional<bool>);
71
72 std::optional<Transport> transport() const;
73 void setTransport(std::optional<Transport>);
74
75 std::optional<QString> username() const;
76 void setUsername(std::optional<QString>);
77
78 static bool isExternalService(const QDomElement &);
79
81 static constexpr std::tuple XmlTag = { u"service", QXmpp::Private::ns_external_service_discovery };
83 void parse(const QDomElement &);
84 void toXml(QXmlStreamWriter *) const;
85
86private:
87 QSharedDataPointer<QXmppExternalServicePrivate> d;
88};
89
90#endif // QXMPPEXTERNALSERVICE_H
QXmppExternalService
Definition QXmppExternalService.h:21
QXmppExternalService::Transport
Transport
Definition QXmppExternalService.h:39
QXmppExternalService::Action
Action
Definition QXmppExternalService.h:28