QXmpp  Version: 1.6.0
QXmppStartTlsPacket.h
1 // SPDX-FileCopyrightText: 2019 Linus Jahn <lnj@kaidan.im>
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 
5 #ifndef QXMPPSTARTTLSPACKET_H
6 #define QXMPPSTARTTLSPACKET_H
7 
8 #include "QXmppStanza.h"
9 
16 class QXMPP_EXPORT QXmppStartTlsPacket : public QXmppNonza
17 {
18 public:
20  enum Type {
25  };
26 
27  QXmppStartTlsPacket(Type type = StartTls);
28  ~QXmppStartTlsPacket() override;
29 
30  Type type() const;
31  void setType(Type type);
32 
34  void parse(const QDomElement &element) override;
35  void toXml(QXmlStreamWriter *writer) const override;
37 
38  static bool isStartTlsPacket(const QDomElement &element);
39  static bool isStartTlsPacket(const QDomElement &element, Type type);
40 
41 private:
42  Type m_type;
43 };
44 
45 Q_DECLARE_METATYPE(QXmppStartTlsPacket::Type);
46 
47 #endif // QXMPPSTARTTLSPACKET_H
Used by the server to accept STARTTLS.
Definition: QXmppStartTlsPacket.h:22
virtual void parse(const QDomElement &)=0
Invalid type.
Definition: QXmppStartTlsPacket.h:24
Used by the server to reject STARTTLS.
Definition: QXmppStartTlsPacket.h:23
Used by the client to initiate STARTTLS.
Definition: QXmppStartTlsPacket.h:21
Definition: QXmppNonza.h:13
virtual void toXml(QXmlStreamWriter *writer) const =0
Type
The type of the STARTTLS packet.
Definition: QXmppStartTlsPacket.h:20
The QXmppStartTlsPacket represents packets used for initiating STARTTLS negotiation when connecting...
Definition: QXmppStartTlsPacket.h:16