gloox  1.0.28
Public Member Functions | List of all members
SIProfileFTHandler Class Referenceabstract

#include <siprofilefthandler.h>

Public Member Functions

virtual ~SIProfileFTHandler ()
 
virtual void handleFTRequest (const JID &from, const JID &to, const std::string &sid, const std::string &name, long size, const std::string &hash, const std::string &date, const std::string &mimetype, const std::string &desc, int stypes)=0
 
virtual void handleFTRequestError (const IQ &iq, const std::string &sid)=0
 
virtual void handleFTBytestream (Bytestream *bs)=0
 
virtual const std::string handleOOBRequestResult (const JID &from, const JID &to, const std::string &sid)=0
 

Detailed Description

An abstract base class to handle file transfer (FT) requests.

See SIProfileFT for more information regarding file transfer.

Author
Jakob Schröter js@ca.nosp@m.maya.nosp@m..net
Since
0.9

Definition at line 36 of file siprofilefthandler.h.

Constructor & Destructor Documentation

◆ ~SIProfileFTHandler()

virtual ~SIProfileFTHandler ( )
inlinevirtual

Virtual destructor.

Definition at line 43 of file siprofilefthandler.h.

Member Function Documentation

◆ handleFTBytestream()

virtual void handleFTBytestream ( Bytestream bs)
pure virtual

This function is called to pass a negotiated bytestream (SOCKS5 or IBB). The bytestream is not yet open and not ready to send/receive data.

Note
To initialize the bytestream and to prepare it for data transfer do the following, preferable in that order:
  • register a BytestreamDataHandler with the Bytestream,
  • set up a separate thread for the bytestream or integrate it into your main loop,
  • call its connect() method and check the return value. To not block your application while the data transfer and/or the connection attempts last, you most likely want to put the bytestream into its own thread or process (before calling connect() on it). It is safe to do so without additional synchronization.
Parameters
bsThe bytestream.

◆ handleFTRequest()

virtual void handleFTRequest ( const JID from,
const JID to,
const std::string &  sid,
const std::string &  name,
long  size,
const std::string &  hash,
const std::string &  date,
const std::string &  mimetype,
const std::string &  desc,
int  stypes 
)
pure virtual

This function is called to handle incoming file transfer requests, i.e. a remote entity requested to send a file to you. You should use either SIProfileFT::acceptFT() or SIProfileFT::declineFT() to accept or reject the request, respectively.

Parameters
fromThe file transfer requestor.
toThe file transfer recipient. Usuall oneself. Used in component scenario.
sidThe requested stream's ID. This sid MUST be supplied to SIProfileFT::acceptFT() and SIProfileFT::declineFT(), respectively.
nameThe file name.
sizeThe file size.
hashThe file content's MD5 sum.
dateThe file's last modification time.
mimetypeThe file's mime-type.
descThe file's description.
stypesAn ORed list of SIProfileFT::StreamType indicating the StreamTypes the initiator supports.

◆ handleFTRequestError()

virtual void handleFTRequestError ( const IQ iq,
const std::string &  sid 
)
pure virtual

This function is called to handle a request error or decline.

Parameters
iqThe complete error stanza.
sidThe request's SID.

◆ handleOOBRequestResult()

virtual const std::string handleOOBRequestResult ( const JID from,
const JID to,
const std::string &  sid 
)
pure virtual

This function is called if the contact chose OOB as the mechanism.

Parameters
fromThe remote contact's JID.
toThe local recipient's JID. Usually oneself. Used in component scenario.
sidThe stream's ID.
Returns
The file's URL.

The documentation for this class was generated from the following file: