QXmpp Version: 1.10.0
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 "QXmppGlobal.h"
9
10#include <optional>
11
12#include <QSharedDataPointer>
13
14class QDateTime;
15class QDomElement;
16class QXmlStreamWriter;
17class QXmppExternalServicePrivate;
18
19class QXMPP_EXPORT QXmppExternalService
20{
21public:
27 enum class Action {
28 Add,
29 Delete,
30 Modify
31 };
32
38 enum class Transport {
39 Tcp,
40 Udp
41 };
42
44
45 QXMPP_PRIVATE_DECLARE_RULE_OF_SIX(QXmppExternalService)
46
47 QString host() const;
48 void setHost(const QString &);
49
50 QString type() const;
51 void setType(const QString &);
52
53 std::optional<Action> action() const;
54 void setAction(std::optional<Action>);
55
56 std::optional<QDateTime> expires() const;
57 void setExpires(std::optional<QDateTime>);
58
59 std::optional<QString> name() const;
60 void setName(std::optional<QString>);
61
62 std::optional<QString> password() const;
63 void setPassword(std::optional<QString>);
64
65 std::optional<int> port() const;
66 void setPort(std::optional<int>);
67
68 std::optional<bool> restricted() const;
69 void setRestricted(std::optional<bool>);
70
71 std::optional<Transport> transport() const;
72 void setTransport(std::optional<Transport>);
73
74 std::optional<QString> username() const;
75 void setUsername(std::optional<QString>);
76
77 static bool isExternalService(const QDomElement &);
78
79 void parse(const QDomElement &);
80 void toXml(QXmlStreamWriter *) const;
81
82private:
83 QSharedDataPointer<QXmppExternalServicePrivate> d;
84};
85
86#endif // QXMPPEXTERNALSERVICE_H
Definition: QXmppExternalService.h:20
Transport
Definition: QXmppExternalService.h:38
Action
Definition: QXmppExternalService.h:27