Mercurial > pidgin
diff libpurple/ft.h @ 29782:3882d419e628
Added a skeleton for functions to set and get a thumbnail image associated
with a file transfer and provision for a UI op to let a UI "manufacture"
a thumbnail.
Refs #9476
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Tue, 23 Jun 2009 21:33:10 +0000 |
parents | b99d6d21cd79 |
children | 52cb819c6668 |
line wrap: on
line diff
--- a/libpurple/ft.h Mon Jun 22 21:31:54 2009 +0000 +++ b/libpurple/ft.h Tue Jun 23 21:33:10 2009 +0000 @@ -76,11 +76,11 @@ void (*update_progress)(PurpleXfer *xfer, double percent); void (*cancel_local)(PurpleXfer *xfer); void (*cancel_remote)(PurpleXfer *xfer); + void (*add_thumbnail)(PurpleXfer *xfer); void (*_purple_reserved1)(void); void (*_purple_reserved2)(void); void (*_purple_reserved3)(void); - void (*_purple_reserved4)(void); } PurpleXferUiOps; /** @@ -139,6 +139,9 @@ void *ui_data; /**< UI-specific data. */ void *data; /**< prpl-specific data. */ + + gpointer thumbnail_data; /**< thumbnail image */ + gsize thumbnail_size; }; #ifdef __cplusplus @@ -617,6 +620,41 @@ */ void purple_xfer_conversation_write(PurpleXfer *xfer, char *message, gboolean is_error); +/** + * 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); + /*@}*/ /**************************************************************************/