Mercurial > pidgin.yaz
annotate src/gtkblist.h @ 9759:b64ee81c7bcb
[gaim-migrate @ 10626]
A patch from Good Stu to make the gaim_gtkconv_button_new() function
public, which lets plugin authors use it. Plugin authors should
use it to create a button to be added to conversation windows.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 15 Aug 2004 23:09:53 +0000 |
parents | db62420a53a2 |
children | ec6ff57d7b06 |
rev | line source |
---|---|
5228 | 1 /** |
5248 | 2 * @file gtkblist.h GTK+ Buddy List API |
5228 | 3 * @ingroup gtkui |
4 * | |
5 * gaim | |
6 * | |
8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
5906 | 10 * |
5228 | 11 * This program is free software; you can redistribute it and/or modify |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
9713 | 25 #ifndef _GAIM_GTKBLIST_H_ |
26 #define _GAIM_GTKBLIST_H_ | |
5228 | 27 |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5631
diff
changeset
|
28 #include "blist.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5631
diff
changeset
|
29 |
5228 | 30 enum { |
31 STATUS_ICON_COLUMN, | |
32 STATUS_ICON_VISIBLE_COLUMN, | |
33 NAME_COLUMN, | |
34 WARNING_COLUMN, | |
35 IDLE_COLUMN, | |
36 BUDDY_ICON_COLUMN, | |
37 NODE_COLUMN, | |
38 BLIST_COLUMNS | |
39 }; | |
40 | |
41 typedef enum { | |
42 GAIM_STATUS_ICON_LARGE, | |
43 GAIM_STATUS_ICON_SMALL | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
44 |
5228 | 45 } GaimStatusIconSize; |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
46 |
5228 | 47 /************************************************************************** |
48 * @name Structures | |
49 **************************************************************************/ | |
50 /** | |
51 * Like, everything you need to know about the gtk buddy list | |
52 */ | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
53 typedef struct { |
5228 | 54 GtkWidget *window; |
55 GtkWidget *vbox; /**< This is the vbox that everything gets packed into. Your plugin might | |
56 want to pack something in it itself. Go, plugins! */ | |
57 | |
58 GtkWidget *treeview; /**< It's a treeview... d'uh. */ | |
59 GtkTreeStore *treemodel; /**< This is the treemodel. */ | |
6695 | 60 GtkTreeViewColumn *idle_column, |
61 *warning_column, | |
5228 | 62 *buddy_icon_column; |
63 | |
5427 | 64 GtkItemFactory *ift; |
5228 | 65 GtkWidget *bpmenu; /**< The buddy pounce menu. */ |
66 | |
67 GtkWidget *bbox; /**< A Button Box. */ | |
68 GtkTooltips *tooltips; /**< Tooltips for the buttons. */ | |
69 | |
70 guint refresh_timer; /**< The timer for refreshing every 30 seconds */ | |
71 | |
72 guint timeout; /**< The timeout for the tooltip. */ | |
7636 | 73 GdkRectangle tip_rect; /**< This is the bounding rectangle of the |
74 cell we're currently hovering over. This is | |
75 used for tooltips. */ | |
76 GdkRectangle contact_rect; /**< This is the bounding rectangle of the contact node | |
77 and its children. This is used for auto-expand on | |
78 mouseover. */ | |
79 GaimBlistNode *mouseover_contact; /**< This is the contact currently mouse-over expanded */ | |
80 | |
5228 | 81 GtkWidget *tipwindow; /**< The window used by the tooltip */ |
82 | |
83 GaimBlistNode *selected_node; /**< The currently selected node */ | |
84 | |
7304 | 85 GdkPixbuf *east, *south; /**< Drop shadow stuff */ |
86 GdkWindow *east_shadow, *south_shadow; /**< Drop shadow stuff */ | |
87 | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
88 } GaimGtkBuddyList; |
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
89 |
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
90 #define GAIM_GTK_BLIST(list) ((GaimGtkBuddyList *)(list)->ui_data) |
5228 | 91 #define GAIM_IS_GTK_BLIST(list) \ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
92 ((list)->ui_ops == gaim_gtk_blist_get_ui_ops()) |
5228 | 93 |
94 /************************************************************************** | |
5422 | 95 * @name GTK+ Buddy List API |
5228 | 96 **************************************************************************/ |
5906 | 97 |
98 /** | |
8815 | 99 * Get the handle for the GTK+ blist system. |
100 * | |
101 * @return the handle to the blist system | |
102 */ | |
103 void *gaim_gtk_blist_get_handle(); | |
104 | |
105 /** | |
5906 | 106 * Initializes the GTK+ blist system. |
107 */ | |
108 void gaim_gtk_blist_init(void); | |
109 | |
5228 | 110 /** |
8815 | 111 * Uninitializes the GTK+ blist system. |
112 */ | |
113 void gaim_gtk_blist_uninit(void); | |
114 | |
115 /** | |
5228 | 116 * Returns the UI operations structure for the buddy list. |
117 * | |
118 * @return The GTK list operations structure. | |
119 */ | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
120 GaimBlistUiOps *gaim_gtk_blist_get_ui_ops(void); |
5228 | 121 |
122 /** | |
123 * Returns the base image to represent the account, based on the currently selected theme | |
124 * | |
125 * @param account The account. | |
6695 | 126 * |
5228 | 127 * @return The icon |
128 */ | |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5427
diff
changeset
|
129 GdkPixbuf *create_prpl_icon(GaimAccount *account); |
5228 | 130 |
131 /** | |
132 * Refreshes all the nodes of the buddy list. | |
133 * This should only be called when something changes to affect most of the nodes (such as a ui preference changing) | |
134 * | |
135 * @param list This is the core list that gets updated from | |
136 */ | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
137 void gaim_gtk_blist_refresh(GaimBuddyList *list); |
5228 | 138 |
139 /** | |
140 * Tells the buddy list to update its toolbar based on the preferences | |
141 * | |
142 */ | |
143 void gaim_gtk_blist_update_toolbar(); | |
144 | |
145 /** | |
146 * Useful for the docklet plugin and also for the win32 tray icon | |
6695 | 147 * This is called when one of those is clicked--it will show/hide the |
148 * buddy list/login window--depending on which is active | |
5228 | 149 */ |
150 void gaim_gtk_blist_docklet_toggle(); | |
151 void gaim_gtk_blist_docklet_add(); | |
152 void gaim_gtk_blist_docklet_remove(); | |
153 void gaim_gtk_blist_update_columns(); | |
5411 | 154 void gaim_gtk_blist_update_refresh_timeout(); |
5228 | 155 |
156 /** | |
157 * Useful for the buddy ticker | |
158 */ | |
5234 | 159 GdkPixbuf *gaim_gtk_blist_get_status_icon(GaimBlistNode *node, |
5228 | 160 GaimStatusIconSize size); |
161 | |
5422 | 162 /************************************************************************** |
163 * @name GTK+ Buddy List sorting functions | |
164 **************************************************************************/ | |
165 | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
166 typedef GtkTreeIter (*gaim_gtk_blist_sort_function)(GaimBlistNode *new, GaimBuddyList *blist, GtkTreeIter group, GtkTreeIter *cur); |
5422 | 167 |
168 extern GSList *gaim_gtk_blist_sort_methods; | |
169 | |
170 struct gaim_gtk_blist_sort_method { | |
5631 | 171 char *id; |
5422 | 172 char *name; |
173 gaim_gtk_blist_sort_function func; | |
174 }; | |
175 | |
176 /** | |
177 * Registers a buddy list sorting method. | |
178 * | |
5631 | 179 * @param id The unique ID of the sorting method |
5422 | 180 * @param name The method's name. |
181 * @param func A pointer to the function. | |
182 * | |
183 */ | |
5631 | 184 void gaim_gtk_blist_sort_method_reg(const char *id, const char *name, gaim_gtk_blist_sort_function func); |
5422 | 185 |
186 /** | |
187 * Unregisters a buddy list sorting method. | |
188 * | |
5631 | 189 * @param id The method's id |
5422 | 190 */ |
5631 | 191 void gaim_gtk_blist_sort_method_unreg(const char *id); |
5422 | 192 |
193 /** | |
194 * Sets a buddy list sorting method. | |
195 * | |
5631 | 196 * @param id The method's id. |
5422 | 197 */ |
5631 | 198 void gaim_gtk_blist_sort_method_set(const char *id); |
5422 | 199 |
200 /** | |
201 * Sets up the programs default sort methods | |
202 */ | |
203 void gaim_gtk_blist_setup_sort_methods(); | |
204 | |
5936
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
205 /** |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
206 * Updates the protocol actions menu on the GTK+ buddy list window. |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
207 */ |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
208 void gaim_gtk_blist_update_protocol_actions(); |
5422 | 209 |
8305
57bdd25752c1
[gaim-migrate @ 9029]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
210 /** |
8986 | 211 * Updates the plugin actions menu on the GTK+ buddy list window. |
212 */ | |
213 void gaim_gtk_blist_update_plugin_actions(); | |
214 | |
215 /** | |
8940 | 216 * Determines if showing the join chat dialog is a valid action. |
217 * | |
218 * @return Returns TRUE if there are accounts online capable of | |
219 * joining chat rooms. Otherwise returns FALSE. | |
8305
57bdd25752c1
[gaim-migrate @ 9029]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
220 */ |
8940 | 221 gboolean gaim_gtk_blist_joinchat_is_showable(void); |
222 | |
223 /** | |
224 * Shows the join chat dialog. | |
225 */ | |
226 void gaim_gtk_blist_joinchat_show(void); | |
5422 | 227 |
9051 | 228 /** |
229 * Appends the protocol specific menu items for a GaimBlistNode | |
230 */ | |
231 void gaim_gtk_append_blist_node_proto_menu (GtkWidget *menu, GaimConnection *gc, GaimBlistNode *node); | |
232 | |
233 /** | |
234 * Appends the extended menu items for a GaimBlistNode | |
235 */ | |
236 void gaim_gtk_append_blist_node_extended_menu(GtkWidget *menu, GaimBlistNode *node); | |
237 | |
9713 | 238 #endif /* _GAIM_GTKBLIST_H_ */ |