QXmpp  Version:0.4.92
 All Classes Functions Enumerations Enumerator Properties Groups
QXmppStreamFeatures.h
1 /*
2  * Copyright (C) 2008-2011 The QXmpp developers
3  *
4  * Author:
5  * Jeremy LainĂ©
6  *
7  * Source:
8  * http://code.google.com/p/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 "QXmppConfiguration.h"
28 #include "QXmppStanza.h"
29 
30 class QXMPP_EXPORT QXmppStreamFeatures : public QXmppStanza
31 {
32 public:
33  QXmppStreamFeatures();
34 
35  enum Mode
36  {
37  Disabled = 0,
38  Enabled,
39  Required
40  };
41 
42  Mode bindMode() const;
43  void setBindMode(Mode mode);
44 
45  Mode sessionMode() const;
46  void setSessionMode(Mode mode);
47 
48  Mode nonSaslAuthMode() const;
49  void setNonSaslAuthMode(Mode mode);
50 
51  QList<QXmppConfiguration::SASLAuthMechanism> authMechanisms() const;
52  void setAuthMechanisms(QList<QXmppConfiguration::SASLAuthMechanism> &mecanisms);
53 
54  QList<QXmppConfiguration::CompressionMethod> compressionMethods() const;
55  void setCompressionMethods(QList<QXmppConfiguration::CompressionMethod> &methods);
56 
57  Mode tlsMode() const;
58  void setTlsMode(Mode mode);
59 
61  void parse(const QDomElement &element);
62  void toXml(QXmlStreamWriter *writer) const;
64 
65  static bool isStreamFeatures(const QDomElement &element);
66 
67 private:
68  Mode m_bindMode;
69  Mode m_sessionMode;
70  Mode m_nonSaslAuthMode;
71  Mode m_tlsMode;
72  QList<QXmppConfiguration::SASLAuthMechanism> m_authMechanisms;
73  QList<QXmppConfiguration::CompressionMethod> m_compressionMethods;
74 };
75 
76 #endif