QXmppResultSet.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * Copyright (C) 2008-2012 The QXmpp developers
  3. *
  4. * Author:
  5. * Olivier Goffart <ogoffart@woboq.com>
  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 QXMPPRESULTSET_H
  24. #define QXMPPRESULTSET_H
  25. #include <QDateTime>
  26. #include "QXmppStanza.h"
  27. /// \brief The QXmppResultSetQuery class represents a set element in a query
  28. /// as defined by XEP-0059: Result Set Management.
  29. class QXMPP_EXPORT QXmppResultSetQuery
  30. {
  31. public:
  32. QXmppResultSetQuery();
  33. int max() const;
  34. void setMax(int max);
  35. int index() const;
  36. void setIndex(int index);
  37. QString before() const;
  38. void setBefore(const QString &before );
  39. QString after() const;
  40. void setAfter(const QString &after );
  41. bool isNull() const;
  42. /// \cond
  43. void parse(const QDomElement &element);
  44. void toXml(QXmlStreamWriter *writer) const;
  45. /// \endcond
  46. private:
  47. int m_index;
  48. int m_max;
  49. QString m_after;
  50. QString m_before;
  51. };
  52. /// \brief The QXmppResultSetReply class represents a set element in a reply
  53. /// as defined by XEP-0059: Result Set Management.
  54. class QXMPP_EXPORT QXmppResultSetReply
  55. {
  56. public:
  57. QXmppResultSetReply();
  58. QString first() const;
  59. void setFirst(const QString &first );
  60. QString last() const;
  61. void setLast(const QString &last );
  62. int count() const;
  63. void setCount(int count);
  64. int index() const;
  65. void setIndex(int index);
  66. bool isNull() const;
  67. /// \cond
  68. void parse(const QDomElement &element);
  69. void toXml(QXmlStreamWriter *writer) const;
  70. /// \endcond
  71. private:
  72. int m_count;
  73. int m_index;
  74. QString m_first;
  75. QString m_last;
  76. };
  77. #endif // QXMPPRESULTSET_H