3 * Finch is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
26 * @section_id: finch-gntblist
27 * @short_description: <filename>gntblist.h</filename>
28 * @title: Buddy List API
31 #include "buddylist.h"
35 #define FINCH_TYPE_BUDDY_LIST (finch_buddy_list_get_type())
36 #define FINCH_TYPE_BLIST_MANAGER (finch_blist_manager_get_type())
38 /**********************************************************************
40 **********************************************************************/
42 typedef struct _FinchBlistManager FinchBlistManager
;
46 * @id: An identifier for the manager.
47 * @name: Displayable name for the manager.
48 * @init: Called right before it's being used.
49 * @uninit: Called right after it's not being used any more.
50 * @can_add_node: Whether a node should be added to the view.
51 * @find_parent: Find the parent row for a node.
52 * @create_tooltip: Create tooltip for a selected row.
54 * Buddylist manager for finch. This decides the visility, ordering and hierarchy
55 * of the buddylist nodes. This also manages the creation of tooltips.
57 struct _FinchBlistManager
61 gboolean (*init
)(void);
62 gboolean (*uninit
)(void);
63 gboolean (*can_add_node
)(PurpleBlistNode
*node
);
64 gpointer (*find_parent
)(PurpleBlistNode
*node
);
65 gboolean (*create_tooltip
)(gpointer selected_row
, GString
**body
, char **title
);
72 * finch_blist_manager_get_type:
74 * Returns: The #GType for the #FinchBlistManager boxed structure.
76 GType
finch_blist_manager_get_type(void);
78 G_DECLARE_FINAL_TYPE(FinchBuddyList
, finch_buddy_list
, FINCH
, BUDDY_LIST
,
84 * Perform necessary initializations.
86 void finch_blist_init(void);
91 * Perform necessary uninitializations.
93 void finch_blist_uninit(void);
98 * Show the buddy list.
100 void finch_blist_show(void);
103 * finch_blist_get_position:
104 * @x: The x-coordinate is set here if not %NULL.
105 * @y: The y-coordinate is set here if not %NULL.
107 * Get the position of the buddy list.
109 * Returns: Returns %TRUE if the values were set, %FALSE otherwise.
111 gboolean
finch_blist_get_position(int *x
, int *y
);
114 * finch_blist_set_position:
115 * @x: The x-coordinate of the buddy list.
116 * @y: The y-coordinate of the buddy list.
118 * Set the position of the buddy list.
120 void finch_blist_set_position(int x
, int y
);
123 * finch_blist_get_size:
124 * @width: The width is set here if not %NULL.
125 * @height: The height is set here if not %NULL.
127 * Get the size of the buddy list.
129 * Returns: Returns %TRUE if the values were set, %FALSE otherwise.
131 gboolean
finch_blist_get_size(int *width
, int *height
);
134 * finch_blist_set_size:
135 * @width: The width of the buddy list.
136 * @height: The height of the buddy list.
138 * Set the size of the buddy list.
140 void finch_blist_set_size(int width
, int height
);
143 * finch_retrieve_user_info:
144 * @conn: The connection to get information from
145 * @name: The user to get information about.
147 * Get information about a user. Show immediate feedback.
149 * Returns: (transfer none): Returns the ui-handle for the userinfo
152 gpointer
finch_retrieve_user_info(PurpleConnection
*conn
, const char *name
);
155 * finch_blist_get_tree:
157 * Get the tree list of the buddy list.
159 * Returns: (transfer none): The GntTree widget.
161 GntTree
* finch_blist_get_tree(void);
164 * finch_blist_install_manager:
165 * @manager: The alternate buddylist manager.
167 * Add an alternate buddy list manager.
169 void finch_blist_install_manager(const FinchBlistManager
*manager
);
172 * finch_blist_uninstall_manager:
173 * @manager: The buddy list manager to remove.
175 * Remove an alternate buddy list manager.
177 void finch_blist_uninstall_manager(const FinchBlistManager
*manager
);
180 * finch_blist_manager_find:
181 * @id: The identifier for the desired buddy list manager.
183 * Find a buddy list manager.
185 * Returns: The manager with the requested identifier, if available. %NULL
188 FinchBlistManager
* finch_blist_manager_find(const char *id
);
191 * finch_blist_manager_add_node:
192 * @node: The node to add
194 * Request the active buddy list manager to add a node.
196 void finch_blist_manager_add_node(PurpleBlistNode
*node
);