| libempathy Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Signals | ||||
EmpathyFTFactoryEmpathyFTFactory — creates EmpathyFTHandler objects |
#include <libempathy/empathy-ft-factory.h>
EmpathyFTFactory;
EmpathyFTFactory* empathy_ft_factory_dup_singleton (void);
void empathy_ft_factory_new_transfer_outgoing
(EmpathyFTFactory *factory,
EmpathyContact *contact,
GFile *source);
void empathy_ft_factory_claim_channel (EmpathyFTFactory *factory,
EmpathyDispatchOperation *operation);
void empathy_ft_factory_set_destination_for_incoming_handler
(EmpathyFTFactory *factory,
EmpathyFTHandler *handler,
GFile *destination);
EmpathyFTFactory takes care of the creation of the EmpathyFTHandler
objects used for file transfer. As the creation of the handlers is
async, a client will have to connect to the ::new-ft-handler signal
to receive the handler.
In case of an incoming file transfer, the handler will need the destination
file before being useful; as this is usually decided by the user (e.g. with
a file selector), a ::new-incoming-transfer is emitted by the factory when
a destination file is needed, which can be set later with
empathy_ft_factory_set_destination_for_incoming_handler().
EmpathyFTFactory* empathy_ft_factory_dup_singleton (void);
Gives the caller a reference to the EmpathyFTFactory singleton, (creating it if necessary).
Returns : |
an EmpathyFTFactory object |
void empathy_ft_factory_new_transfer_outgoing
(EmpathyFTFactory *factory,
EmpathyContact *contact,
GFile *source);
Trigger the creation of an EmpathyFTHandler object to send source to
the specified contact.
|
an EmpathyFTFactory |
|
the EmpathyContact destination of the transfer |
|
the GFile to be transferred to contact
|
void empathy_ft_factory_claim_channel (EmpathyFTFactory *factory, EmpathyDispatchOperation *operation);
Let the factory claim the channel, starting the creation of a new
incoming EmpathyFTHandler.
|
an EmpathyFTFactory |
|
the EmpathyDispatchOperation wrapping the channel |
void empathy_ft_factory_set_destination_for_incoming_handler
(EmpathyFTFactory *factory,
EmpathyFTHandler *handler,
GFile *destination);
Sets destination as destination file for the transfer. After the call of
this method, the ::new-ft-handler will be emitted for the incoming handler.
|
an EmpathyFTFactory |
|
the EmpathyFTHandler to set the destination of |
|
the GFile destination of the transfer |
"new-ft-handler" signalvoid user_function (EmpathyFTFactory *factory, EmpathyFTHandler *handler, gpointer error, gpointer user_data) : Run Last
The signal is emitted when a new EmpathyFTHandler is available.
Note that handler is never NULL even if error is set, as you might want
to display the error in an UI; in that case, the handler won't support
any transfer.
"new-incoming-transfer" signalvoid user_function (EmpathyFTFactory *factory, EmpathyFTHandler *handler, gpointer error, gpointer user_data) : Run Last
The signal is emitted when a new incoming EmpathyFTHandler is being
constructed, and needs a destination GFile to be useful.
Clients that connect to this signal will have to call
empathy_ft_factory_set_destination_for_incoming_handler() when they
have a GFile.
Note that handler is never NULL even if error is set, as you might want
to display the error in an UI; in that case, the handler won't support
any transfer.