# HG changeset patch # User Sadrul Habib Chowdhury # Date 1199645535 0 # Node ID f9dcdc0e89a55415510a4e64d5e2431ad5cca89c # Parent af0426c34c27e12e3f2a6474a56b4081e846427f A list of accessor functions to the roomlist API. diff -r af0426c34c27 -r f9dcdc0e89a5 ChangeLog.API --- 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: diff -r af0426c34c27 -r f9dcdc0e89a5 libpurple/roomlist.c --- 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; +} + /*@}*/ /**************************************************************************/ diff -r af0426c34c27 -r f9dcdc0e89a5 libpurple/roomlist.h --- 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); + /*@}*/ /**************************************************************************/