76 void (*update_progress)(
PurpleXfer *xfer,
double percent);
128 void (*add_thumbnail)(
PurpleXfer *xfer,
const gchar *formats);
180 gssize (*read)(guchar **buffer,
PurpleXfer *xfer);
181 gssize (*write)(
const guchar *buffer,
size_t size,
PurpleXfer *xfer);
508 gssize (*fnc)(
const guchar *,
size_t,
PurpleXfer *));
517 void (*fnc)(
PurpleXfer *,
const guchar *,
size_t));
756 gsize size,
const gchar *mimetype);
const char * purple_xfer_get_local_filename(const PurpleXfer *xfer)
Returns the file's destination filename,.
void purple_xfers_init(void)
Initializes the file transfer subsystem.
void purple_xfer_conversation_write(PurpleXfer *xfer, char *message, gboolean is_error)
Displays a file transfer-related message in the conversation window.
PurpleAccount * purple_xfer_get_account(const PurpleXfer *xfer)
Returns the account the file transfer is using.
void purple_xfer_prepare_thumbnail(PurpleXfer *xfer, const gchar *formats)
Prepare a thumbnail for a transfer (if the UI supports it) will be no-op in case the UI doesn't imple...
PurpleXferUiOps * purple_xfer_get_ui_ops(const PurpleXfer *xfer)
Returns the UI operations structure for a file transfer.
unsigned int purple_xfer_get_local_port(const PurpleXfer *xfer)
Returns the local port number in the file transfer.
gssize purple_xfer_read_file(PurpleXfer *xfer, guchar *buffer, gsize size)
Writes chunk of file being sent.
void purple_xfers_uninit(void)
Uninitializes the file transfer subsystem.
void purple_xfer_set_end_fnc(PurpleXfer *xfer, void(*fnc)(PurpleXfer *))
Sets the end transfer function for the file transfer.
void purple_xfer_set_ack_fnc(PurpleXfer *xfer, void(*fnc)(PurpleXfer *, const guchar *, size_t))
Sets the acknowledge function for the file transfer.
PurpleXferStatusType
The different states of the xfer.
@ PURPLE_XFER_STATUS_STARTED
purple_xfer_start has been called.
@ PURPLE_XFER_STATUS_NOT_STARTED
It hasn't started yet.
@ PURPLE_XFER_STATUS_UNKNOWN
Unknown, the xfer may be null.
@ PURPLE_XFER_STATUS_CANCEL_REMOTE
The xfer was cancelled by the other end, or we couldn't connect.
@ PURPLE_XFER_STATUS_DONE
The xfer completed successfully.
@ PURPLE_XFER_STATUS_ACCEPTED
Receive accepted, but destination file not selected yet.
@ PURPLE_XFER_STATUS_CANCEL_LOCAL
The xfer was cancelled by us.
size_t purple_xfer_get_size(const PurpleXfer *xfer)
Returns the size of the file being sent or received.
void purple_xfer_set_init_fnc(PurpleXfer *xfer, void(*fnc)(PurpleXfer *))
Sets the transfer initialization function for the file transfer.
void purple_xfer_request(PurpleXfer *xfer)
Requests confirmation for a file transfer from the user.
gssize purple_xfer_write(PurpleXfer *xfer, const guchar *buffer, gsize size)
Writes data to a file transfer stream.
PurpleXferType purple_xfer_get_type(const PurpleXfer *xfer)
Returns the type of file transfer.
size_t purple_xfer_get_bytes_sent(const PurpleXfer *xfer)
Returns the number of bytes sent (or received) so far.
size_t purple_xfer_get_bytes_remaining(const PurpleXfer *xfer)
Returns the number of bytes remaining to send or receive.
const gchar * purple_xfer_get_thumbnail_mimetype(const PurpleXfer *xfer)
Gets the mimetype of the thumbnail preview for a transfer.
unsigned int purple_xfer_get_remote_port(const PurpleXfer *xfer)
Returns the remote port number in the file transfer.
void purple_xfer_set_completed(PurpleXfer *xfer, gboolean completed)
Sets the completed state for the file transfer.
const char * purple_xfer_get_remote_user(const PurpleXfer *xfer)
Returns the name of the remote user.
gconstpointer purple_xfer_get_thumbnail(const PurpleXfer *xfer, gsize *len)
Gets the thumbnail data for a transfer.
PurpleXferStatusType purple_xfer_get_status(const PurpleXfer *xfer)
Returns the status of the xfer.
void purple_xfer_set_write_fnc(PurpleXfer *xfer, gssize(*fnc)(const guchar *, size_t, PurpleXfer *))
Sets the write function for the file transfer.
const char * purple_xfer_get_remote_ip(const PurpleXfer *xfer)
Returns the remote IP address in the file transfer.
PurpleXferType
Types of file transfers.
@ PURPLE_XFER_UNKNOWN
Unknown file transfer type.
@ PURPLE_XFER_RECEIVE
File receiving.
@ PURPLE_XFER_SEND
File sending.
void purple_xfer_set_cancel_send_fnc(PurpleXfer *xfer, void(*fnc)(PurpleXfer *))
Sets the cancel send function for the file transfer.
GList * purple_xfers_get_all(void)
Returns all xfers.
void purple_xfer_cancel_remote(PurpleXfer *xfer)
Cancels a file transfer from the remote end.
void purple_xfer_unref(PurpleXfer *xfer)
Decreases the reference count on a PurpleXfer.
void purple_xfer_request_accepted(PurpleXfer *xfer, const char *filename)
Called if the user accepts the file transfer request.
gssize purple_xfer_read(PurpleXfer *xfer, guchar **buffer)
Reads in data from a file transfer stream.
void purple_xfer_set_local_filename(PurpleXfer *xfer, const char *filename)
Sets the local filename for the file transfer.
time_t purple_xfer_get_end_time(const PurpleXfer *xfer)
Returns the time the transfer of a file ended.
void purple_xfer_set_thumbnail(PurpleXfer *xfer, gconstpointer thumbnail, gsize size, const gchar *mimetype)
Sets the thumbnail data for a transfer.
double purple_xfer_get_progress(const PurpleXfer *xfer)
Returns the current percentage of progress of the transfer.
void purple_xfer_ref(PurpleXfer *xfer)
Increases the reference count on a PurpleXfer.
void * purple_xfers_get_handle(void)
Returns the handle to the file transfer subsystem.
PurpleXferUiOps * purple_xfers_get_ui_ops(void)
Returns the UI operations structure to be used in all purple file transfers.
PurpleXfer * purple_xfer_new(PurpleAccount *account, PurpleXferType type, const char *who)
Creates a new file transfer handle.
gboolean purple_xfer_is_completed(const PurpleXfer *xfer)
Returns the completed state for a file transfer.
void purple_xfer_set_request_denied_fnc(PurpleXfer *xfer, void(*fnc)(PurpleXfer *))
Sets the function to be called if the request is denied.
void purple_xfer_add(PurpleXfer *xfer)
Adds a new file transfer to the list of file transfers.
gboolean purple_xfer_write_file(PurpleXfer *xfer, const guchar *buffer, gsize size)
Writes chunk of received file.
void purple_xfer_set_filename(PurpleXfer *xfer, const char *filename)
Sets the filename for the file transfer.
time_t purple_xfer_get_start_time(const PurpleXfer *xfer)
Returns the time the transfer of a file started.
void purple_xfer_ui_ready(PurpleXfer *xfer)
Allows the UI to signal it's ready to send/receive data (depending on the direction of the file trans...
void purple_xfer_end(PurpleXfer *xfer)
Ends a file transfer.
void purple_xfer_set_size(PurpleXfer *xfer, size_t size)
Sets the size of the file in a file transfer.
void purple_xfer_set_start_fnc(PurpleXfer *xfer, void(*fnc)(PurpleXfer *))
Sets the start transfer function for the file transfer.
void purple_xfer_request_denied(PurpleXfer *xfer)
Called if the user rejects the file transfer request.
void purple_xfer_start(PurpleXfer *xfer, int fd, const char *ip, unsigned int port)
Starts a file transfer.
void purple_xfer_prpl_ready(PurpleXfer *xfer)
Allows the prpl to signal it's ready to send/receive data (depending on the direction of the file tra...
void purple_xfer_set_message(PurpleXfer *xfer, const char *message)
Sets the filename for the file transfer.
void purple_xfer_update_progress(PurpleXfer *xfer)
Updates file transfer progress.
void purple_xfer_cancel_local(PurpleXfer *xfer)
Cancels a file transfer on the local end.
void purple_xfer_set_read_fnc(PurpleXfer *xfer, gssize(*fnc)(guchar **, PurpleXfer *))
Sets the read function for the file transfer.
gboolean purple_xfer_is_canceled(const PurpleXfer *xfer)
Returns true if the file transfer was cancelled.
void purple_xfer_error(PurpleXferType type, PurpleAccount *account, const char *who, const char *msg)
Displays a file transfer-related error message.
void purple_xfer_set_bytes_sent(PurpleXfer *xfer, size_t bytes_sent)
Sets the current working position in the active file transfer.
void purple_xfers_set_ui_ops(PurpleXferUiOps *ops)
Sets the UI operations structure to be used in all purple file transfers.
const char * purple_xfer_get_filename(const PurpleXfer *xfer)
Returns the name of the file being sent or received.
void purple_xfer_set_cancel_recv_fnc(PurpleXfer *xfer, void(*fnc)(PurpleXfer *))
Sets the cancel receive function for the file transfer.
File transfer UI operations.
Structure representing an account.
A core representation of a file transfer.
PurpleXferType type
The type of transfer.
size_t current_buffer_size
This gradually increases for fast network connections.
size_t bytes_sent
The number of bytes sent.
char * local_filename
The name on the local hard drive.
char * filename
The name sent over the network.
PurpleAccount * account
The account.
void * data
prpl-specific data.
int fd
The socket file descriptor.
int remote_port
The remote port.
time_t start_time
When the transfer of data began.
size_t bytes_remaining
The number of bytes remaining.
guint ref
The reference count.
struct _PurpleXfer::@2 ops
I/O operations, which should be set by the prpl using purple_xfer_set_init_fnc() and friends.
char * who
The person on the other end of the transfer.
PurpleXferUiOps * ui_ops
UI-specific operations.
char * remote_ip
The remote IP address.
FILE * dest_fp
The destination file pointer.
PurpleXferStatusType status
File Transfer's status.
int local_port
The local port.
void * ui_data
UI-specific data.
size_t size
The size of the file.
char * message
A message sent with the request
time_t end_time
When the transfer of data ended.