Mercurial > pidgin.yaz
annotate src/gtkblist.h @ 7274:448e39ace278
[gaim-migrate @ 7851]
Added a parameter to gaim_ssl_connect() to specify an optional error
callback. MSN takes advantage of it, but since I can't reproduce the errors
here, I'm not positive it works. It should though! Famous last words.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Wed, 15 Oct 2003 06:32:13 +0000 |
parents | 770233dad86c |
children | 52cf473a0103 |
rev | line source |
---|---|
5228 | 1 /** |
5248 | 2 * @file gtkblist.h GTK+ Buddy List API |
5228 | 3 * @ingroup gtkui |
4 * | |
5 * gaim | |
6 * | |
7 * Copyright (C) 2002-2003, Sean Egan <sean.egan@binghamton.edu> | |
5906 | 8 * |
5228 | 9 * This program is free software; you can redistribute it and/or modify |
10 * it under the terms of the GNU General Public License as published by | |
11 * the Free Software Foundation; either version 2 of the License, or | |
12 * (at your option) any later version. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program; if not, write to the Free Software | |
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 */ | |
23 | |
24 #ifndef _GAIM_GTK_LIST_H_ | |
25 #define _GAIM_GTK_LIST_H_ | |
26 | |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5631
diff
changeset
|
27 #include "blist.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5631
diff
changeset
|
28 |
5228 | 29 enum { |
30 STATUS_ICON_COLUMN, | |
31 STATUS_ICON_VISIBLE_COLUMN, | |
32 NAME_COLUMN, | |
33 WARNING_COLUMN, | |
34 IDLE_COLUMN, | |
35 BUDDY_ICON_COLUMN, | |
36 NODE_COLUMN, | |
37 BLIST_COLUMNS | |
38 }; | |
39 | |
40 typedef enum { | |
41 GAIM_STATUS_ICON_LARGE, | |
42 GAIM_STATUS_ICON_SMALL | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
43 |
5228 | 44 } GaimStatusIconSize; |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
45 |
5228 | 46 /************************************************************************** |
47 * @name Structures | |
48 **************************************************************************/ | |
49 /** | |
50 * Like, everything you need to know about the gtk buddy list | |
51 */ | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
52 typedef struct { |
5228 | 53 GtkWidget *window; |
54 GtkWidget *vbox; /**< This is the vbox that everything gets packed into. Your plugin might | |
55 want to pack something in it itself. Go, plugins! */ | |
56 | |
57 GtkWidget *treeview; /**< It's a treeview... d'uh. */ | |
58 GtkTreeStore *treemodel; /**< This is the treemodel. */ | |
6695 | 59 GtkTreeViewColumn *idle_column, |
60 *warning_column, | |
5228 | 61 *buddy_icon_column; |
62 | |
5427 | 63 GtkItemFactory *ift; |
5228 | 64 GtkWidget *bpmenu; /**< The buddy pounce menu. */ |
65 | |
66 GtkWidget *bbox; /**< A Button Box. */ | |
67 GtkTooltips *tooltips; /**< Tooltips for the buttons. */ | |
68 | |
69 guint refresh_timer; /**< The timer for refreshing every 30 seconds */ | |
70 | |
71 guint timeout; /**< The timeout for the tooltip. */ | |
72 GdkRectangle rect; /**< This is the bounding rectangle of the | |
6695 | 73 cell we're currently hovering over. This is |
5228 | 74 used for tooltips. */ |
75 GtkWidget *tipwindow; /**< The window used by the tooltip */ | |
76 | |
77 GaimBlistNode *selected_node; /**< The currently selected node */ | |
78 | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
79 } GaimGtkBuddyList; |
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
80 |
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
81 #define GAIM_GTK_BLIST(list) ((GaimGtkBuddyList *)(list)->ui_data) |
5228 | 82 #define GAIM_IS_GTK_BLIST(list) \ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
83 ((list)->ui_ops == gaim_gtk_blist_get_ui_ops()) |
5228 | 84 |
85 /************************************************************************** | |
5422 | 86 * @name GTK+ Buddy List API |
5228 | 87 **************************************************************************/ |
5906 | 88 |
89 /** | |
90 * Initializes the GTK+ blist system. | |
91 */ | |
92 void gaim_gtk_blist_init(void); | |
93 | |
5228 | 94 /** |
95 * Returns the UI operations structure for the buddy list. | |
96 * | |
97 * @return The GTK list operations structure. | |
98 */ | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
99 GaimBlistUiOps *gaim_gtk_blist_get_ui_ops(void); |
5228 | 100 |
101 /** | |
102 * Returns the base image to represent the account, based on the currently selected theme | |
103 * | |
104 * @param account The account. | |
6695 | 105 * |
5228 | 106 * @return The icon |
107 */ | |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5427
diff
changeset
|
108 GdkPixbuf *create_prpl_icon(GaimAccount *account); |
5228 | 109 |
110 /** | |
111 * Refreshes all the nodes of the buddy list. | |
112 * This should only be called when something changes to affect most of the nodes (such as a ui preference changing) | |
113 * | |
114 * @param list This is the core list that gets updated from | |
115 */ | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
116 void gaim_gtk_blist_refresh(GaimBuddyList *list); |
5228 | 117 |
118 /** | |
119 * Tells the buddy list to update its toolbar based on the preferences | |
120 * | |
121 */ | |
122 void gaim_gtk_blist_update_toolbar(); | |
123 | |
124 /** | |
125 * Useful for the docklet plugin and also for the win32 tray icon | |
6695 | 126 * This is called when one of those is clicked--it will show/hide the |
127 * buddy list/login window--depending on which is active | |
5228 | 128 */ |
129 void gaim_gtk_blist_docklet_toggle(); | |
130 void gaim_gtk_blist_docklet_add(); | |
131 void gaim_gtk_blist_docklet_remove(); | |
132 void gaim_gtk_blist_update_columns(); | |
5411 | 133 void gaim_gtk_blist_update_refresh_timeout(); |
5228 | 134 |
135 /** | |
136 * Useful for the buddy ticker | |
137 */ | |
5234 | 138 GdkPixbuf *gaim_gtk_blist_get_status_icon(GaimBlistNode *node, |
5228 | 139 GaimStatusIconSize size); |
140 | |
5422 | 141 /************************************************************************** |
142 * @name GTK+ Buddy List sorting functions | |
143 **************************************************************************/ | |
144 | |
7098
770233dad86c
[gaim-migrate @ 7663]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
145 typedef GtkTreeIter (*gaim_gtk_blist_sort_function)(GaimBlistNode *new, GaimBuddyList *blist, GtkTreeIter group, GtkTreeIter *cur); |
5422 | 146 |
147 extern GSList *gaim_gtk_blist_sort_methods; | |
148 | |
149 struct gaim_gtk_blist_sort_method { | |
5631 | 150 char *id; |
5422 | 151 char *name; |
152 gaim_gtk_blist_sort_function func; | |
153 }; | |
154 | |
155 /** | |
156 * Registers a buddy list sorting method. | |
157 * | |
5631 | 158 * @param id The unique ID of the sorting method |
5422 | 159 * @param name The method's name. |
160 * @param func A pointer to the function. | |
161 * | |
162 */ | |
5631 | 163 void gaim_gtk_blist_sort_method_reg(const char *id, const char *name, gaim_gtk_blist_sort_function func); |
5422 | 164 |
165 /** | |
166 * Unregisters a buddy list sorting method. | |
167 * | |
5631 | 168 * @param id The method's id |
5422 | 169 */ |
5631 | 170 void gaim_gtk_blist_sort_method_unreg(const char *id); |
5422 | 171 |
172 /** | |
173 * Sets a buddy list sorting method. | |
174 * | |
5631 | 175 * @param id The method's id. |
5422 | 176 */ |
5631 | 177 void gaim_gtk_blist_sort_method_set(const char *id); |
5422 | 178 |
179 /** | |
180 * Sets up the programs default sort methods | |
181 */ | |
182 void gaim_gtk_blist_setup_sort_methods(); | |
183 | |
5936
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
184 /** |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
185 * Updates the protocol actions menu on the GTK+ buddy list window. |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
186 */ |
1b56a833d665
[gaim-migrate @ 6376]
Christian Hammond <chipx86@chipx86.com>
parents:
5906
diff
changeset
|
187 void gaim_gtk_blist_update_protocol_actions(); |
5422 | 188 |
189 | |
5228 | 190 #endif /* _GAIM_GTK_LIST_H_ */ |