QXmpp  Version:0.9.3
QXmppStreamFeatures.h
00001 /*
00002  * Copyright (C) 2008-2014 The QXmpp developers
00003  *
00004  * Author:
00005  *  Jeremy Lainé
00006  *
00007  * Source:
00008  *  https://github.com/qxmpp-project/qxmpp
00009  *
00010  * This file is a part of QXmpp library.
00011  *
00012  * This library is free software; you can redistribute it and/or
00013  * modify it under the terms of the GNU Lesser General Public
00014  * License as published by the Free Software Foundation; either
00015  * version 2.1 of the License, or (at your option) any later version.
00016  *
00017  * This library is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020  * Lesser General Public License for more details.
00021  *
00022  */
00023 
00024 #ifndef QXMPPSTREAMFEATURES_H
00025 #define QXMPPSTREAMFEATURES_H
00026 
00027 #include "QXmppStanza.h"
00028 
00029 class QXMPP_EXPORT QXmppStreamFeatures : public QXmppStanza
00030 {
00031 public:
00032     QXmppStreamFeatures();
00033 
00034     enum Mode
00035     {
00036         Disabled = 0,
00037         Enabled,
00038         Required
00039     };
00040 
00041     Mode bindMode() const;
00042     void setBindMode(Mode mode);
00043 
00044     Mode sessionMode() const;
00045     void setSessionMode(Mode mode);
00046 
00047     Mode nonSaslAuthMode() const;
00048     void setNonSaslAuthMode(Mode mode);
00049 
00050     QStringList authMechanisms() const;
00051     void setAuthMechanisms(const QStringList &mechanisms);
00052 
00053     QStringList compressionMethods() const;
00054     void setCompressionMethods(const QStringList &methods);
00055 
00056     Mode tlsMode() const;
00057     void setTlsMode(Mode mode);
00058 
00060     void parse(const QDomElement &element);
00061     void toXml(QXmlStreamWriter *writer) const;
00063 
00064     static bool isStreamFeatures(const QDomElement &element);
00065 
00066 private:
00067     Mode m_bindMode;
00068     Mode m_sessionMode;
00069     Mode m_nonSaslAuthMode;
00070     Mode m_tlsMode;
00071     QStringList m_authMechanisms;
00072     QStringList m_compressionMethods;
00073 };
00074 
00075 #endif
 All Classes Functions Enumerations Enumerator Properties