gloox
0.9.9.12
|
#include <simanager.h>
Public Types | |
enum | SIError { NoValidStreams, BadProfile, RequestRejected } |
Public Member Functions | |
SIManager (ClientBase *parent, bool advertise=true) | |
virtual | ~SIManager () |
const std::string | requestSI (SIHandler *sih, const JID &to, const std::string &profile, Tag *child1, Tag *child2=0, const std::string &mimetype="binary/octet-stream") |
void | acceptSI (const JID &to, const std::string &id, Tag *child1, Tag *child2=0) |
void | declineSI (const JID &to, const std::string &id, SIError reason, const std::string &text="") |
void | registerProfile (const std::string &profile, SIProfileHandler *sih) |
void | removeProfile (const std::string &profile) |
virtual bool | handleIq (Stanza *stanza) |
virtual bool | handleIqID (Stanza *stanza, int context) |
Public Member Functions inherited from IqHandler | |
virtual | ~IqHandler () |
This class manages streams initiated using XEP-0095.
You need only one SIManager object per ClientBase instance.
Definition at line 34 of file simanager.h.
enum SIError |
SI error conditions.
NoValidStreams |
None of the stream types are acceptable |
BadProfile |
Profile is not understood. |
RequestRejected |
SI request was rejected. |
Definition at line 41 of file simanager.h.
SIManager | ( | ClientBase * | parent, |
bool | advertise = true |
||
) |
Constructor.
parent | The ClientBase to use for communication. |
advertise | Whether to advertise SI capabilities by disco. Defaults to true. |
Definition at line 24 of file simanager.cpp.
|
virtual |
Virtual destructor.
Definition at line 35 of file simanager.cpp.
Call this function to accept an SI request previously announced by means of SIProfileHandler::handleSIRequest().
to | The requestor. |
id | The request's id, as passed to SIProfileHandler::handleSIRequest(). |
child1 | The <feature/> child of the SI request. See XEP-0095 for details. |
child2 | The profile-specific child of the SI request. May be 0. See XEP-0095 for details. |
Definition at line 82 of file simanager.cpp.
void declineSI | ( | const JID & | to, |
const std::string & | id, | ||
SIError | reason, | ||
const std::string & | text = "" |
||
) |
Call this function to decline an SI request previously announced by means of SIProfileHandler::handleSIRequest().
to | The requestor. |
id | The request's id, as passed to SIProfileHandler::handleSIRequest(). |
reason | The reason for the reject. |
text | An optional human-readable text explaining the decline. |
Definition at line 97 of file simanager.cpp.
|
virtual |
Reimplement this function if you want to be notified about incoming IQs.
stanza | The complete Stanza. |
Implements IqHandler.
Definition at line 151 of file simanager.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 174 of file simanager.cpp.
void registerProfile | ( | const std::string & | profile, |
SIProfileHandler * | sih | ||
) |
Registers the given SIProfileHandler to handle requests for the given SI profile namespace. The profile will be advertised by disco (unless disabled in the ctor).
profile | The complete profile namespace, e.g. http://jabber.org/protocol/si/profile/file-transfer. |
sih | The profile handler. |
Definition at line 129 of file simanager.cpp.
void removeProfile | ( | const std::string & | profile | ) |
Un-registers the given profile.
profile | The profile's namespace to un-register. |
Definition at line 140 of file simanager.cpp.
const std::string requestSI | ( | SIHandler * | sih, |
const JID & | to, | ||
const std::string & | profile, | ||
Tag * | child1, | ||
Tag * | child2 = 0 , |
||
const std::string & | mimetype = "binary/octet-stream" |
||
) |
Starts negotiating a stream with a remote entity.
sih | The SIHandler to handle the result of this request. |
to | The entity to talk to. |
profile | The SI profile to use. See XEP-0095 for more info. |
child1 | The first of the two allowed children of the SI offer. See XEP-0095 for more info. |
child2 | The second of the two allowed children of the SI offer. See XEP-0095 for more info. Defaults to 0. |
mimetype | The stream's/file's mime-type. Defaults to 'binary/octet-stream'. |
Definition at line 46 of file simanager.cpp.