#include <siprofilefthandler.h>
|
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 |
|
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.
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
-
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
-
from | The file transfer requestor. |
to | The file transfer recipient. Usuall oneself. Used in component scenario. |
sid | The requested stream's ID. This sid MUST be supplied to SIProfileFT::acceptFT() and SIProfileFT::declineFT(), respectively. |
name | The file name. |
size | The file size. |
hash | The file content's MD5 sum. |
date | The file's last modification time. |
mimetype | The file's mime-type. |
desc | The file's description. |
stypes | An ORed list of SIProfileFT::StreamType indicating the StreamTypes the initiator supports. |
virtual void handleFTRequestError |
( |
const IQ & |
iq, |
|
|
const std::string & |
sid |
|
) |
| |
|
pure virtual |
This function is called to handle a request error or decline.
- Parameters
-
iq | The complete error stanza. |
sid | The request's SID. |
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
-
from | The remote contact's JID. |
to | The local recipient's JID. Usually oneself. Used in component scenario. |
sid | The stream's ID. |
- Returns
- The file's URL.
The documentation for this class was generated from the following file: