QXmpp  Version:1.3.1
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 
35 class QXMPP_EXPORT QXmppStartTlsPacket : public QXmppStanza
36 {
37 public:
39  enum Type {
42  Failure
43  };
44 
45  QXmppStartTlsPacket(Type type = StartTls);
46  ~QXmppStartTlsPacket() override;
47 
48  Type type() const;
49  void setType(Type type);
50 
52  void parse(const QDomElement &element) override;
53  void toXml(QXmlStreamWriter *writer) const override;
55 
56  static bool isStartTlsPacket(const QDomElement &element);
57  static bool isStartTlsPacket(const QDomElement &element, Type type);
58 
59 private:
60  Type m_type;
61 };
62 
63 Q_DECLARE_METATYPE(QXmppStartTlsPacket::Type);
64 
65 #endif // QXMPPSTARTTLSPACKET_H
QXmppStartTlsPacket
The QXmppStartTlsPacket represents packets used for initiating STARTTLS negotiation when connecting.
Definition: QXmppStartTlsPacket.h:35
QXmppStartTlsPacket::StartTls
@ StartTls
Used by the client to initiate STARTTLS.
Definition: QXmppStartTlsPacket.h:40
QXmppStartTlsPacket::Type
Type
The type of the STARTTLS packet.
Definition: QXmppStartTlsPacket.h:39
QXmppStanza
The QXmppStanza class is the base class for all XMPP stanzas.
Definition: QXmppStanza.h:99
QXmppStartTlsPacket::Proceed
@ Proceed
Used by the server to accept STARTTLS.
Definition: QXmppStartTlsPacket.h:41