QXmpp  Version:1.2.0
QXmppStartTlsPacket.h
1 /*
2  * Copyright (C) 2008-2020 The QXmpp developers
3  *
4  * Authors:
5  * Linus Jahn
6  *
7  * Source:
8  * https://github.com/qxmpp-project/qxmpp
9  *
10  * This file is a part of QXmpp library.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  */
23 
24 #ifndef QXMPPSTARTTLSPACKET_H
25 #define QXMPPSTARTTLSPACKET_H
26 
27 #include "QXmppStanza.h"
28 
31 
32 class QXMPP_EXPORT QXmppStartTlsPacket : public QXmppStanza
33 {
34 public:
36  enum Type {
39  Failure
40  };
41 
42  QXmppStartTlsPacket(Type type = StartTls);
43  ~QXmppStartTlsPacket() override;
44 
45  Type type() const;
46  void setType(Type type);
47 
49  void parse(const QDomElement &element) override;
50  void toXml(QXmlStreamWriter *writer) const override;
52 
53  static bool isStartTlsPacket(const QDomElement &element);
54  static bool isStartTlsPacket(const QDomElement &element, Type type);
55 
56 private:
57  Type m_type;
58 };
59 
60 Q_DECLARE_METATYPE(QXmppStartTlsPacket::Type);
61 
62 #endif // QXMPPSTARTTLSPACKET_H
QXmppStartTlsPacket
The QXmppStartTlsPacket represents packets used for initiating STARTTLS negotiation when connecting.
Definition: QXmppStartTlsPacket.h:32
QXmppStartTlsPacket::StartTls
Used by the client to initiate STARTTLS.
Definition: QXmppStartTlsPacket.h:37
QXmppStartTlsPacket::Type
Type
The type of the STARTTLS packet.
Definition: QXmppStartTlsPacket.h:36
QXmppStanza
The QXmppStanza class is the base class for all XMPP stanzas.
Definition: QXmppStanza.h:96
QXmppStartTlsPacket::Proceed
Used by the server to accept STARTTLS.
Definition: QXmppStartTlsPacket.h:38