Mercurial > pidgin.yaz
diff libpurple/request.h @ 21227:059d6deebee7
propagate from branch 'org.maemo.garage.pidgin.pidgin.dialog-transience' (head 49d0219884ede2c6c571f2df73e29dffa86f54ad)
to branch 'im.pidgin.pidgin.next.minor' (head 6f090c623ea4e9357e5b4238348a888b4c869ab7)
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sat, 13 Oct 2007 23:32:54 +0000 |
parents | e98c08afb706 |
children | 0b67d509a305 ad718740aa71 |
line wrap: on
line diff
--- a/libpurple/request.h Sat Oct 13 23:26:48 2007 +0000 +++ b/libpurple/request.h Sat Oct 13 23:32:54 2007 +0000 @@ -61,7 +61,8 @@ PURPLE_REQUEST_FIELD_LIST, PURPLE_REQUEST_FIELD_LABEL, PURPLE_REQUEST_FIELD_IMAGE, - PURPLE_REQUEST_FIELD_ACCOUNT + PURPLE_REQUEST_FIELD_ACCOUNT, + PURPLE_REQUEST_FIELD_BLIST, } PurpleRequestFieldType; @@ -94,6 +95,17 @@ } PurpleRequestFieldGroup; /** + * Flags that can be used for Buddylist Fields. + */ +typedef enum +{ + PURPLE_REQUEST_BLIST_FLAG_BUDDY = 0x01, /**< Include buddies in the list. */ + PURPLE_REQUEST_BLIST_FLAG_CHAT = 0x02, /**< Include chats in the list. */ + PURPLE_REQUEST_BLIST_FLAG_GROUP = 0x04, /**< Include groups in the list. */ + PURPLE_REQUEST_BLIST_FLAG_ALLOW_OFFLINE = 0x08, /**< Include offline buddies in the list. */ +} PurpleRequestBlistFlags; + +/** * A request field. */ typedef struct @@ -172,6 +184,14 @@ gsize size; } image; + struct + { + GList *default_nodes; + PurpleRequestBlistFlags flags; + GList *selecteds; + PurpleFilterBlistFunc filter; + } blist; + } u; void *ui_data; @@ -1151,6 +1171,98 @@ /*@}*/ /**************************************************************************/ +/** @name Buddylist Field API */ +/**************************************************************************/ +/*@{*/ + +/** + * Creates a buddylist field. + * + * @param id The field ID. + * @param text The label for the field. + * @param flag Flags dictating what kind of blist nodes should be + * included in the request field. + * @param selected A list of PurpleBlistNode's to select by default, or @c NULL. + * + * @return The new field. + * + * @since 2.3.0 + */ +PurpleRequestField *purple_request_field_blist_nodes_new(const char *id, const char *text, + PurpleRequestBlistFlags flag, GList *selected); + +/** + * Set a filter for the request field. + * + * @param field The request field. + * @param filter The filter function. + * + * @return The old filter function, or @c NULL if there was none. + * + * @since 2.3.0 + */ +PurpleFilterBlistFunc purple_request_field_blist_set_filter(PurpleRequestField *field, PurpleFilterBlistFunc filter); + +/** + * Get the filter function for the request field. + * + * @param field The request field. + * + * @return The filter function, or @c NULL if there isn't any. + * + * @since 2.3.0 + */ +PurpleFilterBlistFunc purple_request_field_blist_get_filter(const PurpleRequestField *field); + +/** + * Add a PurpleBlistNode to the selected list. + * + * @param field The request field. + * @param node The buddylist node to add to the list. + * + * @return @c TRUE if the node is added to the list, @c FALSE if it was already in the list. + * + * @since 2.3.0 + */ +gboolean purple_request_field_blist_add(PurpleRequestField *field, PurpleBlistNode *node); + +/** + * Remove a PurpleBlistNode from the selected list. + * + * @param field The request field. + * @param node The buddylist node to remove from the list. + * + * @return @c TRUE if the node is removed from the list, @c FALSE if the node is not in the list. + * + * @since 2.3.0 + */ +gboolean purple_request_field_blist_remove(PurpleRequestField *field, PurpleBlistNode *node); + +/** + * Set the list of selected nodes in the request field. + * + * @param field The request field. + * @param selecteds The list of selected PurpleBlistNode's. Note that the request field + * becomes the owner of the list, and so the caller should not modify it. + * + * @since 2.3.0 + */ +void purple_request_field_blist_set_selection_list(PurpleRequestField *field, GList *selecteds); + +/** + * Get a list of the selected buddylist nodes. + * + * @param field The request field. + * + * @return A GList of PurpleBlistNode's. + * + * @since 2.3.0 + */ +GList *purple_request_field_blist_get_selection_list(const PurpleRequestField *field); + +/*@}*/ + +/**************************************************************************/ /** @name Request API */ /**************************************************************************/ /*@{*/