QXmppDiscoveryManager.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Copyright (C) 2008-2012 The QXmpp developers
  3. *
  4. * Author:
  5. * Manjeet Dahiya
  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 QXMPPDISCOVERYMANAGER_H
  24. #define QXMPPDISCOVERYMANAGER_H
  25. #include "QXmppClientExtension.h"
  26. class QXmppDataForm;
  27. class QXmppDiscoveryIq;
  28. class QXmppDiscoveryManagerPrivate;
  29. /// \brief The QXmppDiscoveryManager class makes it possible to discover information
  30. /// about other entities as defined by XEP-0030: Service Discovery.
  31. ///
  32. /// \ingroup Managers
  33. class QXMPP_EXPORT QXmppDiscoveryManager : public QXmppClientExtension
  34. {
  35. Q_OBJECT
  36. public:
  37. QXmppDiscoveryManager();
  38. ~QXmppDiscoveryManager();
  39. QXmppDiscoveryIq capabilities();
  40. QString requestInfo(const QString& jid, const QString& node = "");
  41. QString requestItems(const QString& jid, const QString& node = "");
  42. QString clientCapabilitiesNode() const;
  43. void setClientCapabilitiesNode(const QString&);
  44. // http://xmpp.org/registrar/disco-categories.html#client
  45. QString clientCategory() const;
  46. void setClientCategory(const QString&);
  47. void setClientName(const QString&);
  48. QString clientName() const;
  49. QString clientType() const;
  50. void setClientType(const QString&);
  51. QXmppDataForm clientInfoForm() const;
  52. void setClientInfoForm(const QXmppDataForm &form);
  53. /// \cond
  54. QStringList discoveryFeatures() const;
  55. bool handleStanza(const QDomElement &element);
  56. /// \endcond
  57. signals:
  58. /// This signal is emitted when an information response is received.
  59. void infoReceived(const QXmppDiscoveryIq&);
  60. /// This signal is emitted when an items response is received.
  61. void itemsReceived(const QXmppDiscoveryIq&);
  62. private:
  63. QXmppDiscoveryManagerPrivate *d;
  64. };
  65. #endif // QXMPPDISCOVERYMANAGER_H