PurpleXferUiOps Struct Reference

File transfer UI operations. More...

#include <ft.h>


Data Fields

void(* new_xfer )(PurpleXfer *xfer)
void(* destroy )(PurpleXfer *xfer)
void(* add_xfer )(PurpleXfer *xfer)
void(* update_progress )(PurpleXfer *xfer, double percent)
void(* cancel_local )(PurpleXfer *xfer)
void(* cancel_remote )(PurpleXfer *xfer)
gssize(* ui_write )(PurpleXfer *xfer, const guchar *buffer, gssize size)
 UI op to write data received from the prpl.
gssize(* ui_read )(PurpleXfer *xfer, guchar **buffer, gssize size)
 UI op to read data to send to the prpl for a file transfer.
void(* data_not_sent )(PurpleXfer *xfer, const guchar *buffer, gsize size)
 Op to notify the UI that not all the data read in was written.
void(* add_thumbnail )(PurpleXfer *xfer, const gchar *formats)
 Op to create a thumbnail image for a file transfer.


Detailed Description

File transfer UI operations.

Any UI representing a file transfer must assign a filled-out PurpleXferUiOps structure to the purple_xfer.

Definition at line 71 of file ft.h.


Field Documentation

void(* PurpleXferUiOps::add_thumbnail)(PurpleXfer *xfer, const gchar *formats)

Op to create a thumbnail image for a file transfer.

Parameters:
xfer The file transfer structure

void(* PurpleXferUiOps::data_not_sent)(PurpleXfer *xfer, const guchar *buffer, gsize size)

Op to notify the UI that not all the data read in was written.

The UI should re-enqueue this data and return it the next time read is called.

This MUST be implemented if read and write are implemented.

Parameters:
xfer The file transfer structure
buffer A pointer to the beginning of the unwritten data.
size The amount of unwritten data.
Since:
2.6.0

gssize(* PurpleXferUiOps::ui_read)(PurpleXfer *xfer, guchar **buffer, gssize size)

UI op to read data to send to the prpl for a file transfer.

Parameters:
xfer The file transfer structure
buffer A pointer to a buffer. The UI must allocate this buffer. libpurple will free the data.
size The maximum amount of data to put in the buffer.
Returns:
The amount of data in the buffer, 0 if nothing is available, and a negative value if an error occurred and the transfer should be cancelled (libpurple will cancel).
Since:
2.6.0

gssize(* PurpleXferUiOps::ui_write)(PurpleXfer *xfer, const guchar *buffer, gssize size)

UI op to write data received from the prpl.

The UI must deal with the entire buffer and return size, or it is treated as an error.

Parameters:
xfer The file transfer structure
buffer The buffer to write
size The size of the buffer
Returns:
size if the write was successful, or a value between 0 and size on error.
Since:
2.6.0


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