Mercurial > pidgin
changeset 22004:f9dcdc0e89a5
A list of accessor functions to the roomlist API.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sun, 06 Jan 2008 18:52:15 +0000 |
parents | af0426c34c27 |
children | 829d054f4f1a |
files | ChangeLog.API libpurple/roomlist.c libpurple/roomlist.h |
diffstat | 3 files changed, 121 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog.API Sat Jan 05 11:08:48 2008 +0000 +++ b/ChangeLog.API Sun Jan 06 18:52:15 2008 +0000 @@ -9,6 +9,15 @@ purple_micro_version variables are exported by version.h, giving the version of libpurple in use at runtime. * purple_util_set_current_song, purple_util_format_song_info + * Some accessor functions to the Roomlist API: + * purple_roomlist_get_fields + * purple_roomlist_room_get_type + * purple_roomlist_room_get_name + * purple_roomlist_room_get_parent + * purple_roomlist_room_get_fields + * purple_roomlist_field_get_type + * purple_roomlist_field_get_label + * purple_roomlist_field_get_hidden Pidgin: Added:
--- a/libpurple/roomlist.c Sat Jan 05 11:08:48 2008 +0000 +++ b/libpurple/roomlist.c Sun Jan 06 18:52:15 2008 +0000 @@ -218,6 +218,11 @@ prpl_info->roomlist_expand_category(list, category); } +GList * purple_roomlist_get_fields(PurpleRoomlist *list) +{ + return list->fields; +} + /*@}*/ /**************************************************************************/ @@ -293,6 +298,26 @@ g_hash_table_destroy(components); } +PurpleRoomlistRoomType purple_roomlist_room_get_type(PurpleRoomlistRoom *room) +{ + return room->type; +} + +const char * purple_roomlist_room_get_name(PurpleRoomlistRoom *room) +{ + return room->name; +} + +PurpleRoomlistRoom * purple_roomlist_room_get_parent(PurpleRoomlistRoom *room) +{ + return room->parent; +} + +GList * purple_roomlist_room_get_fields(PurpleRoomlistRoom *room) +{ + return room->fields; +} + /*@}*/ /**************************************************************************/ @@ -319,6 +344,21 @@ return f; } +PurpleRoomlistFieldType purple_roomlist_field_get_type(PurpleRoomlistField *field) +{ + return field->type; +} + +const char * purple_roomlist_field_get_label(PurpleRoomlistField *field) +{ + return field->label; +} + +gboolean purple_roomlist_field_get_hidden(PurpleRoomlistField *field) +{ + return field->hidden; +} + /*@}*/ /**************************************************************************/
--- a/libpurple/roomlist.h Sat Jan 05 11:08:48 2008 +0000 +++ b/libpurple/roomlist.h Sun Jan 06 18:52:15 2008 +0000 @@ -237,6 +237,15 @@ */ void purple_roomlist_expand_category(PurpleRoomlist *list, PurpleRoomlistRoom *category); +/** + * Get the list of fields for a roomlist. + * + * @param roomlist The roomlist, which must not be @c NULL. + * @constreturn A list of fields + * @since 2.4.0 + */ +GList * purple_roomlist_get_fields(PurpleRoomlist *roomlist); + /*@}*/ /**************************************************************************/ @@ -273,6 +282,39 @@ */ void purple_roomlist_room_join(PurpleRoomlist *list, PurpleRoomlistRoom *room); +/** + * Get the type of a room. + * @param room The room, which must not be @c NULL. + * @return The type of the room. + * @since 2.4.0 + */ +PurpleRoomlistRoomType purple_roomlist_room_get_type(PurpleRoomlistRoom *room); + +/** + * Get the name of a room. + * @param room The room, which must not be @c NULL. + * @return The name of the room. + * @since 2.4.0 + */ +const char * purple_roomlist_room_get_name(PurpleRoomlistRoom *room); + +/** + * Get the parent of a room. + * @param room The room, which must not be @c NULL. + * @return The parent of the room, which can be @c NULL. + * @since 2.4.0 + */ +PurpleRoomlistRoom * purple_roomlist_room_get_parent(PurpleRoomlistRoom *room); + +/** + * Get the list of fields for a room. + * + * @param room The room, which must not be @c NULL. + * @constreturn A list of fields + * @since 2.4.0 + */ +GList * purple_roomlist_room_get_fields(PurpleRoomlistRoom *room); + /*@}*/ /**************************************************************************/ @@ -294,6 +336,36 @@ PurpleRoomlistField *purple_roomlist_field_new(PurpleRoomlistFieldType type, const gchar *label, const gchar *name, gboolean hidden); + +/** + * Get the type of a field. + * + * @param field A PurpleRoomlistField, which must not be @c NULL. + * + * @return The type of the field. + * @since 2.4.0 + */ +PurpleRoomlistFieldType purple_roomlist_field_get_type(PurpleRoomlistField *field); + +/** + * Get the label of a field. + * + * @param field A PurpleRoomlistField, which must not be @c NULL. + * + * @return The label of the field. + * @since 2.4.0 + */ +const char * purple_roomlist_field_get_label(PurpleRoomlistField *field); + +/** + * Check whether a roomlist-field is hidden. + * @param field A PurpleRoomlistField, which must not be @c NULL. + * + * @return @c TRUE if the field is hidden, @c FALSE otherwise. + * @since 2.4.0 + */ +gboolean purple_roomlist_field_get_hidden(PurpleRoomlistField *field); + /*@}*/ /**************************************************************************/