gloox
0.9.9.12
|
#include <vcardmanager.h>
Public Member Functions | |
VCardManager (ClientBase *parent) | |
virtual | ~VCardManager () |
void | fetchVCard (const JID &jid, VCardHandler *vch) |
void | storeVCard (const VCard *vcard, VCardHandler *vch) |
void | cancelVCardOperations (VCardHandler *vch) |
virtual bool | handleIq (Stanza *stanza) |
virtual bool | handleIqID (Stanza *stanza, int context) |
Public Member Functions inherited from IqHandler | |
virtual | ~IqHandler () |
A VCardManager can be used to fetch an entities VCard as well as for setting one's own VCard.
You need only one VCardManager per Client/ClientBase.
Create a VCardManager and have a VCardHandler ready. Then simply call fetchVCard() and wait for the result.
Similar to the above, you need a VCardManager and a VCardHandler. Then construct your VCard and call storeVCard().
This implementation supports more than one address, address label, email address and telephone number.
When cleaning up, delete your VCardManager instance before deleting the Client/ClientBase instance.
Definition at line 100 of file vcardmanager.h.
VCardManager | ( | ClientBase * | parent | ) |
Constructor.
parent | The ClientBase object to use for communication. |
Definition at line 23 of file vcardmanager.cpp.
|
virtual |
Virtual destructor.
Definition at line 33 of file vcardmanager.cpp.
void cancelVCardOperations | ( | VCardHandler * | vch | ) |
Use this function, e.g. from your VCardHandler-derived class's dtor, to cancel any outstanding operations (fetchVCard(), storeVCard()). Calling this function even if no operations are pending is just fine.
vch | The VCardHandler to remove from any queues. |
Definition at line 65 of file vcardmanager.cpp.
void fetchVCard | ( | const JID & | jid, |
VCardHandler * | vch | ||
) |
Use this function to fetch the VCard of a remote entity or yourself. The result will be announced by calling handleVCard() the VCardHandler.
jid | The entity's JID. |
vch | The VCardHandler that will receive the result of the VCard fetch. |
Definition at line 43 of file vcardmanager.cpp.
|
virtual |
Reimplement this function if you want to be notified about incoming IQs.
stanza | The complete Stanza. |
Implements IqHandler.
Definition at line 94 of file vcardmanager.cpp.
|
virtual |
Reimplement this function if you want to be notified about incoming IQs with a specific value of the id
attribute. You have to enable tracking of those IDs using Client::trackID(). This is usually useful for IDs that generate a positive reply, i.e. <iq type='result' id='reg'/> where a namespace filter wouldn't work.
stanza | The complete Stanza. |
context | A value to restore context, stored with ClientBase::trackID(). |
Implements IqHandler.
Definition at line 99 of file vcardmanager.cpp.
void storeVCard | ( | const VCard * | vcard, |
VCardHandler * | vch | ||
) |
Use this function to store or update your own VCard on the server. Remember to always send a full VCard, not a delta of changes. If you, for any reason, pass a foreign VCard to this function, your own will be overwritten.
vcard | Your VCard to store. |
vch | The VCardHandler that will receive the result of the VCard store. |
Definition at line 78 of file vcardmanager.cpp.