QXmppArchiveManager.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 QXMPPARCHIVEMANAGER_H
  24. #define QXMPPARCHIVEMANAGER_H
  25. #include <QDateTime>
  26. #include "QXmppClientExtension.h"
  27. #include "QXmppResultSet.h"
  28. class QXmppArchiveChat;
  29. class QXmppArchiveChatIq;
  30. class QXmppArchiveListIq;
  31. class QXmppArchivePrefIq;
  32. /// \brief The QXmppArchiveManager class makes it possible to access message
  33. /// archives as defined by XEP-0136: Message Archiving.
  34. ///
  35. /// To make use of this manager, you need to instantiate it and load it into
  36. /// the QXmppClient instance as follows:
  37. ///
  38. /// \code
  39. /// QXmppArchiveManager *manager = new QXmppArchiveManager;
  40. /// client->addExtension(manager);
  41. /// \endcode
  42. ///
  43. /// \note Few servers support message archiving. Check if the server in use supports
  44. /// this XEP.
  45. ///
  46. /// \ingroup Managers
  47. class QXMPP_EXPORT QXmppArchiveManager : public QXmppClientExtension
  48. {
  49. Q_OBJECT
  50. public:
  51. void listCollections(const QString &jid, const QDateTime &start = QDateTime(), const QDateTime &end = QDateTime(),
  52. const QXmppResultSetQuery &rsm = QXmppResultSetQuery());
  53. void listCollections(const QString &jid, const QDateTime &start, const QDateTime &end, int max);
  54. void removeCollections(const QString &jid, const QDateTime &start = QDateTime(), const QDateTime &end = QDateTime());
  55. void retrieveCollection(const QString &jid, const QDateTime &start, const QXmppResultSetQuery &rsm = QXmppResultSetQuery());
  56. void retrieveCollection(const QString &jid, const QDateTime &start, int max);
  57. /// \cond
  58. QStringList discoveryFeatures() const;
  59. bool handleStanza(const QDomElement &element);
  60. /// \endcond
  61. signals:
  62. /// This signal is emitted when archive list is received
  63. /// after calling listCollections()
  64. void archiveListReceived(const QList<QXmppArchiveChat>&, const QXmppResultSetReply &rsm = QXmppResultSetReply());
  65. /// This signal is emitted when archive chat is received
  66. /// after calling retrieveCollection()
  67. void archiveChatReceived(const QXmppArchiveChat&, const QXmppResultSetReply &rsm = QXmppResultSetReply());
  68. };
  69. #endif