QXmppVCardManager.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 QXMPPVCARDMANAGER_H
  24. #define QXMPPVCARDMANAGER_H
  25. #include "QXmppClientExtension.h"
  26. class QXmppVCardIq;
  27. class QXmppVCardManagerPrivate;
  28. /// \brief The QXmppVCardManager class gets/sets XMPP vCards. It is an
  29. /// implementation of XEP-0054: vcard-temp.
  30. ///
  31. /// \note It's object should not be created using it's constructor. Instead
  32. /// QXmppClient::vCardManager() should be used to get the reference of instantiated
  33. /// object this class.
  34. ///
  35. /// <B>Getting vCards of entries in Roster:</B><BR>
  36. /// It doesn't store vCards of the JIDs in the roster of connected user. Instead
  37. /// client has to request for a particular vCard using requestVCard(). And connect to
  38. /// the signal vCardReceived() to get the requested vCard.
  39. ///
  40. /// <B>Getting vCard of the connected client:</B><BR>
  41. /// For getting the vCard of the connected user itself. Client can call requestClientVCard()
  42. /// and on the signal clientVCardReceived() it can get its vCard using clientVCard().
  43. ///
  44. /// <B>Setting vCard of the client:</B><BR>
  45. /// Using setClientVCard() client can set its vCard.
  46. ///
  47. /// \note Client can't set/change vCards of roster entries.
  48. ///
  49. /// \ingroup Managers
  50. class QXMPP_EXPORT QXmppVCardManager : public QXmppClientExtension
  51. {
  52. Q_OBJECT
  53. public:
  54. QXmppVCardManager();
  55. ~QXmppVCardManager();
  56. QString requestVCard(const QString& bareJid = "");
  57. const QXmppVCardIq& clientVCard() const;
  58. void setClientVCard(const QXmppVCardIq&);
  59. QString requestClientVCard();
  60. bool isClientVCardReceived() const;
  61. /// \cond
  62. QStringList discoveryFeatures() const;
  63. bool handleStanza(const QDomElement &element);
  64. /// \endcond
  65. signals:
  66. /// This signal is emitted when the requested vCard is received
  67. /// after calling the requestVCard() function.
  68. void vCardReceived(const QXmppVCardIq&);
  69. /// This signal is emitted when the client's vCard is received
  70. /// after calling the requestClientVCard() function.
  71. void clientVCardReceived();
  72. private:
  73. QXmppVCardManagerPrivate *d;
  74. };
  75. #endif // QXMPPVCARDMANAGER_H