--- a/libpurple/ft.h Tue Oct 20 21:20:22 2009 +0000 +++ b/libpurple/ft.h Tue Oct 20 22:32:09 2009 +0000 @@ -120,7 +120,12 @@ */ void (*data_not_sent)(PurpleXfer *xfer, const guchar *buffer, gsize size); - void (*_purple_reserved1)(void); + /** + * Op to create a thumbnail image for a file transfer + * + * @param xfer The file transfer structure + */ + void (*add_thumbnail)(PurpleXfer *xfer); } PurpleXferUiOps; /** @@ -178,6 +183,9 @@ void *ui_data; /**< UI-specific data. */ void *data; /**< prpl-specific data. */ + + gpointer thumbnail_data; /**< thumbnail image */ + gsize thumbnail_size; }; #ifdef __cplusplus @@ -684,6 +692,42 @@ */ void purple_xfer_prpl_ready(PurpleXfer *xfer); +/** + * Gets the thumbnail data for a transfer + * + * @param xfer The file transfer to get the thumbnail for + * @return The thumbnail data, or NULL if there is no thumbnail + */ +const void *purple_xfer_get_thumbnail_data(const PurpleXfer *xfer); + +/** + * Gets the thumbnail size for a transfer + * + * @param xfer The file transfer to get the thumbnail size for + * @return The size, in bytes of the file transfer's thumbnail + */ +gsize purple_xfer_get_thumbnail_size(const PurpleXfer *xfer); + + +/** + * Sets the thumbnail data for a transfer + * + * @param xfer The file transfer to set the data for + * @param thumbnail A pointer to the thumbnail data, this will be copied + * @param size The size in bytes of the passed in thumbnail data + */ +void purple_xfer_set_thumbnail(PurpleXfer *xfer, gconstpointer thumbnail, + gsize size); + +/** + * Prepare a thumbnail for a transfer (if the UI supports it) + * will be no-op in case the UI doesn't implement thumbnail creation + * + * @param xfer The file transfer to create a thumbnail for + */ +void purple_xfer_prepare_thumbnail(PurpleXfer *xfer); + + /*@}*/ /**************************************************************************/