QXmppElement.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 QXMPPELEMENT_H
  24. #define QXMPPELEMENT_H
  25. #include <QMap>
  26. #include <QStringList>
  27. #include <QXmlStreamWriter>
  28. #include "QXmppGlobal.h"
  29. class QDomElement;
  30. class QXmppElement;
  31. class QXmppElementPrivate;
  32. typedef QList<QXmppElement> QXmppElementList;
  33. class QXMPP_EXPORT QXmppElement
  34. {
  35. public:
  36. QXmppElement();
  37. QXmppElement(const QXmppElement &other);
  38. QXmppElement(const QDomElement &element);
  39. ~QXmppElement();
  40. QStringList attributeNames() const;
  41. QString attribute(const QString &name) const;
  42. void setAttribute(const QString &name, const QString &value);
  43. void appendChild(const QXmppElement &child);
  44. QXmppElement firstChildElement(const QString &name = QString()) const;
  45. QXmppElement nextSiblingElement(const QString &name = QString()) const;
  46. void removeChild(const QXmppElement &child);
  47. QString tagName() const;
  48. void setTagName(const QString &type);
  49. QString value() const;
  50. void setValue(const QString &text);
  51. bool isNull() const;
  52. void toXml(QXmlStreamWriter *writer) const;
  53. QXmppElement &operator=(const QXmppElement &other);
  54. private:
  55. QXmppElement(QXmppElementPrivate *other);
  56. QXmppElementPrivate *d;
  57. };
  58. #endif