QXmppStreamFeatures.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (C) 2008-2012 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. #ifndef QXMPPSTREAMFEATURES_H
  24. #define QXMPPSTREAMFEATURES_H
  25. #include "QXmppStanza.h"
  26. class QXMPP_EXPORT QXmppStreamFeatures : public QXmppStanza
  27. {
  28. public:
  29. QXmppStreamFeatures();
  30. enum Mode
  31. {
  32. Disabled = 0,
  33. Enabled,
  34. Required
  35. };
  36. Mode bindMode() const;
  37. void setBindMode(Mode mode);
  38. Mode sessionMode() const;
  39. void setSessionMode(Mode mode);
  40. Mode nonSaslAuthMode() const;
  41. void setNonSaslAuthMode(Mode mode);
  42. QStringList authMechanisms() const;
  43. void setAuthMechanisms(const QStringList &mechanisms);
  44. QStringList compressionMethods() const;
  45. void setCompressionMethods(const QStringList &methods);
  46. Mode tlsMode() const;
  47. void setTlsMode(Mode mode);
  48. /// \cond
  49. void parse(const QDomElement &element);
  50. void toXml(QXmlStreamWriter *writer) const;
  51. /// \endcond
  52. static bool isStreamFeatures(const QDomElement &element);
  53. private:
  54. Mode m_bindMode;
  55. Mode m_sessionMode;
  56. Mode m_nonSaslAuthMode;
  57. Mode m_tlsMode;
  58. QStringList m_authMechanisms;
  59. QStringList m_compressionMethods;
  60. };
  61. #endif