| libempathy Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | ||||
#include <libempathy/empathy-tp-file.h>
EmpathyTpFile;
EmpathyTpFile * empathy_tp_file_new (TpChannel *channel,
gboolean incoming);
void empathy_tp_file_accept (EmpathyTpFile *tp_file,
guint64 offset,
GFile *gfile,
GCancellable *cancellable,
EmpathyTpFileProgressCallback progress_callback,
gpointer progress_user_data,
EmpathyTpFileOperationCallback op_callback,
gpointer op_user_data);
void empathy_tp_file_cancel (EmpathyTpFile *tp_file);
void empathy_tp_file_close (EmpathyTpFile *tp_file);
void empathy_tp_file_offer (EmpathyTpFile *tp_file,
GFile *gfile,
GCancellable *cancellable,
EmpathyTpFileProgressCallback progress_callback,
gpointer progress_user_data,
EmpathyTpFileOperationCallback op_callback,
gpointer op_user_data);
gboolean empathy_tp_file_is_incoming (EmpathyTpFile *tp_file);
"channel" TpChannel* : Read / Write / Construct Only "incoming" gboolean : Read / Write / Construct Only
EmpathyTpFile is an object which represents a Telepathy file channel. Usually, clients do not need to deal with EmpathyTpFile objects directly, and are supposed to use EmpathyFTHandler and EmpathyFTFactory for transferring files using libempathy.
EmpathyTpFile * empathy_tp_file_new (TpChannel *channel, gboolean incoming);
Creates a new EmpathyTpFile wrapping channel, with the direction
specified by incoming. The returned EmpathyTpFile should be unrefed
with g_object_unref() when finished with.
|
a TpChannel |
|
whether the file transfer is incoming or not |
Returns : |
a new EmpathyTpFile |
void empathy_tp_file_accept (EmpathyTpFile *tp_file, guint64 offset, GFile *gfile, GCancellable *cancellable, EmpathyTpFileProgressCallback progress_callback, gpointer progress_user_data, EmpathyTpFileOperationCallback op_callback, gpointer op_user_data);
Accepts an incoming file transfer, saving the result into gfile.
The callback op_callback will be called both when the transfer is
successful and in case of an error. Note that cancelling cancellable,
closes the socket of the file operation in progress, but doesn't
guarantee that the transfer channel will be closed as well. Thus,
empathy_tp_file_cancel() or empathy_tp_file_close() should be used to
actually cancel an ongoing EmpathyTpFile.
|
an incoming EmpathyTpFile |
|
the offset of gfile where we should start writing
|
|
the destination GFile for the transfer |
|
a GCancellable |
|
function to callback with progress information |
|
user_data to pass to progress_callback
|
|
function to callback when the transfer ends |
|
user_data to pass to op_callback
|
void empathy_tp_file_cancel (EmpathyTpFile *tp_file);
Cancels an ongoing EmpathyTpFile, first closing the channel and then cancelling any I/O operation and closing the socket.
|
an EmpathyTpFile |
void empathy_tp_file_close (EmpathyTpFile *tp_file);
Closes the channel for an ongoing EmpathyTpFile. It's safe to call this method after the transfer has ended.
|
an EmpathyTpFile |
void empathy_tp_file_offer (EmpathyTpFile *tp_file, GFile *gfile, GCancellable *cancellable, EmpathyTpFileProgressCallback progress_callback, gpointer progress_user_data, EmpathyTpFileOperationCallback op_callback, gpointer op_user_data);
Offers an outgoing file transfer, reading data from gfile.
The callback op_callback will be called both when the transfer is
successful and in case of an error. Note that cancelling cancellable,
closes the socket of the file operation in progress, but doesn't
guarantee that the transfer channel will be closed as well. Thus,
empathy_tp_file_cancel() or empathy_tp_file_close() should be used to
actually cancel an ongoing EmpathyTpFile.
|
an outgoing EmpathyTpFile |
|
the source GFile for the transfer |
|
a GCancellable |
|
function to callback with progress information |
|
user_data to pass to progress_callback
|
|
function to callback when the transfer ends |
|
user_data to pass to op_callback
|
gboolean empathy_tp_file_is_incoming (EmpathyTpFile *tp_file);
Returns whether tp_file is incoming.
|
an EmpathyTpFile |
Returns : |
TRUE if the tp_file is incoming, otherwise FALSE
|