QXmpp  Version:1.0.0
QXmppStreamFeatures.h
1 /*
2  * Copyright (C) 2008-2019 The QXmpp developers
3  *
4  * Author:
5  * Jeremy LainĂ©
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 QXMPPSTREAMFEATURES_H
25 #define QXMPPSTREAMFEATURES_H
26 
27 #include "QXmppStanza.h"
28 
29 class QXMPP_EXPORT QXmppStreamFeatures : public QXmppStanza
30 {
31 public:
32  QXmppStreamFeatures();
33 
34  enum Mode
35  {
36  Disabled = 0,
37  Enabled,
38  Required
39  };
40 
41  Mode bindMode() const;
42  void setBindMode(Mode mode);
43 
44  Mode sessionMode() const;
45  void setSessionMode(Mode mode);
46 
47  Mode nonSaslAuthMode() const;
48  void setNonSaslAuthMode(Mode mode);
49 
50  QStringList authMechanisms() const;
51  void setAuthMechanisms(const QStringList &mechanisms);
52 
53  QStringList compressionMethods() const;
54  void setCompressionMethods(const QStringList &methods);
55 
56  Mode tlsMode() const;
57  void setTlsMode(Mode mode);
58 
61  Mode streamManagementMode() const;
62 
66  void setStreamManagementMode(Mode mode);
67 
69  Mode clientStateIndicationMode() const;
70 
74  void setClientStateIndicationMode(Mode mode);
75 
77  void parse(const QDomElement &element);
78  void toXml(QXmlStreamWriter *writer) const;
80 
81  static bool isStreamFeatures(const QDomElement &element);
82 
83 private:
84  Mode m_bindMode;
85  Mode m_sessionMode;
86  Mode m_nonSaslAuthMode;
87  Mode m_tlsMode;
88  Mode m_streamManagementMode;
89  Mode m_csiMode;
90  QStringList m_authMechanisms;
91  QStringList m_compressionMethods;
92 };
93 
94 #endif
The QXmppStanza class is the base class for all XMPP stanzas.
Definition: QXmppStanza.h:90