Mercurial > pidgin
annotate src/conversation.h @ 4617:858979ab3867
[gaim-migrate @ 4908]
Big Changes:
-Rewrote some of the perl stuff so perl scripts can change a few of their
parameters
-Receiving a file with AIM over oscar works pretty well
Now, the "nitty gritty":
Very minor change to prefs.c: In the plugins details tab, I changed "URL"
to "Web Site." I was just going to fix the tabbing, but silvestrij
suggested changing it to "Web site," and I thought that sounded good.
I think it fits better, too. I dunno, maybe that's just me.
"Get Capabilities" has stopped working for some reason. I'm just going to
blame AOL. It's really not important anyway, and some people wanted it
taken off. It is now #ifdef 0'ed out. I'll remove it completely if it
continues to no longer function.
I took out a few plugin_event calls from oscar.c and put them in core code.
"event_error" should be, uh, "evented" when there is an error signing on.
Hopefully no one was using this. It's really pretty useless. The parameter
is now the reason for not being able to connect rather than the archaic
toc error code.
I screwed around with how perl functions are called some. There was way the
hell too much malloc'ing going on here. I think all in all it's an
improvement, though I'm still not a big fan of how changes to parameters
propagate to the actual memory.
I really think it would be nice if the perl stuff was made into a C plugin.
It's just so much cleaner. Especially if someone wanted to write, say, a
python or tcl interpreter. That's how xchat2 does it. I just think that
would be really slick. Like butter. Or ice. Very unlike Velcro.
I added a "Change Password" Protocol Action for ICQ over oscar. This was
really pretty easy. I'd like to thank my housemate Andrew for complaining
a lot that having to use Windows ICQ to change his password was a pain.
I rewrote a lot of the oscar file transfer stuff to use Christian's new
xfer interface. This involved moving a few functions from ft.c to im.c,
where they belong. I also removed all the #if 0'ed getfile functions.
I'll be rewritting them soonish. Receiving a file should work perfectly,
aside from maybe a small memleak when stuff is canceled. Sending a file is
currently disabled. No ETA on when I'll have that working.
I renamed pretty much all of the functions in im.c so they have kind of a
scheme now. They should all be aim_im_bleh, since "im" is the family
name. There comes a time when you must break the crap out of any clients
that might be using libfaim in order to make stuff cleaner. Maybe.
I got rid of the snac destructor stuff for now. I'll probably add it back
later. I wasn't entirely comfortable with how it was done.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 26 Feb 2003 05:01:37 +0000 |
parents | 3196d9044a45 |
children | 9567b13d0e98 |
rev | line source |
---|---|
4359 | 1 /** |
2 * @file conversation.h Conversation API | |
3 * | |
4 * gaim | |
5 * | |
6 * Copyright (C) 2002-2003, Christian Hammond <chipx86@gnupdate.org> | |
7 * | |
8 * This program is free software; you can redistribute it and/or modify | |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 * | |
22 */ | |
23 | |
24 #ifndef _CONVERSATION_H_ | |
25 #define _CONVERSATION_H_ | |
26 | |
27 /**************************************************************************/ | |
28 /** Data Structures */ | |
29 /**************************************************************************/ | |
30 | |
31 typedef enum _GaimConversationType GaimConversationType; | |
32 typedef enum _GaimUnseenState GaimUnseenState; | |
33 typedef enum _GaimConvUpdateType GaimConvUpdateType; | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
34 struct gaim_window_ui_ops; |
4359 | 35 struct gaim_window; |
36 struct gaim_conversation; | |
37 struct gaim_im; | |
38 struct gaim_chat; | |
39 | |
40 /** | |
41 * A type of conversation. | |
42 */ | |
43 enum _GaimConversationType | |
44 { | |
45 GAIM_CONV_UNKNOWN = 0, /**< Unknown conversation type. */ | |
46 GAIM_CONV_IM, /**< Instant Message. */ | |
4378
194507c83612
[gaim-migrate @ 4644]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
47 GAIM_CONV_CHAT, /**< Chat room. */ |
194507c83612
[gaim-migrate @ 4644]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
48 GAIM_CONV_MISC /**< A misc. conversation. */ |
4359 | 49 }; |
50 | |
51 /** | |
52 * Unseen text states. | |
53 */ | |
54 enum _GaimUnseenState | |
55 { | |
56 GAIM_UNSEEN_NONE = 0, /**< No unseen text in the conversation. */ | |
57 GAIM_UNSEEN_TEXT, /**< Unseen text in the conversation. */ | |
58 GAIM_UNSEEN_NICK, /**< Unseen text and the nick was said. */ | |
59 }; | |
60 | |
61 /** | |
62 * Conversation update type. | |
63 */ | |
64 enum _GaimConvUpdateType | |
65 { | |
66 GAIM_CONV_UPDATE_ADD = 0, /**< The buddy associated with the conversation | |
67 was added. */ | |
68 GAIM_CONV_UPDATE_REMOVE, /**< The buddy associated with the conversation | |
69 was removed. */ | |
4491 | 70 GAIM_CONV_UPDATE_ACCOUNT, /**< The gaim_account was changed. */ |
4359 | 71 GAIM_CONV_UPDATE_TYPING, /**< The typing state was updated. */ |
72 GAIM_CONV_UPDATE_UNSEEN, /**< The unseen state was updated. */ | |
73 GAIM_CONV_UPDATE_LOGGING, /**< Logging for this conversation was | |
74 enabled or disabled. */ | |
75 GAIM_CONV_UPDATE_TOPIC, /**< The topic for a chat was updated. */ | |
76 | |
77 /* | |
78 * XXX These need to go when we implement a more generic core/UI event | |
79 * system. | |
80 */ | |
4378
194507c83612
[gaim-migrate @ 4644]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
81 GAIM_CONV_ACCOUNT_ONLINE, /**< One of the user's accounts went online. */ |
194507c83612
[gaim-migrate @ 4644]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
82 GAIM_CONV_ACCOUNT_OFFLINE, /**< One of the user's accounts went offline. */ |
194507c83612
[gaim-migrate @ 4644]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
83 GAIM_CONV_UPDATE_AWAY /**< The other user went away. */ |
4359 | 84 }; |
85 | |
86 /* Yeah, this has to be included here. Ugh. */ | |
87 #include "gaim.h" | |
88 | |
89 /** | |
90 * Conversation window operations. | |
91 * | |
92 * Any UI representing a window must assign a filled-out gaim_window_ops | |
93 * structure to the gaim_window. | |
94 */ | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
95 struct gaim_window_ui_ops |
4359 | 96 { |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
97 struct gaim_conversation_ui_ops *(*get_conversation_ui_ops)(void); |
4359 | 98 |
99 void (*new_window)(struct gaim_window *win); | |
100 void (*destroy_window)(struct gaim_window *win); | |
101 | |
102 void (*show)(struct gaim_window *win); | |
103 void (*hide)(struct gaim_window *win); | |
104 void (*raise)(struct gaim_window *win); | |
105 void (*flash)(struct gaim_window *win); | |
106 | |
107 void (*switch_conversation)(struct gaim_window *win, unsigned int index); | |
108 void (*add_conversation)(struct gaim_window *win, | |
109 struct gaim_conversation *conv); | |
110 void (*remove_conversation)(struct gaim_window *win, | |
111 struct gaim_conversation *conv); | |
112 void (*move_conversation)(struct gaim_window *win, | |
113 struct gaim_conversation *conv, | |
114 unsigned int newIndex); | |
115 int (*get_active_index)(const struct gaim_window *win); | |
116 }; | |
117 | |
118 /** | |
119 * Conversation operations and events. | |
120 * | |
121 * Any UI representing a conversation must assign a filled-out | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
122 * gaim_conversation_ui_ops structure to the gaim_conversation. |
4359 | 123 */ |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
124 struct gaim_conversation_ui_ops |
4359 | 125 { |
126 void (*destroy_conversation)(struct gaim_conversation *conv); | |
127 void (*write_chat)(struct gaim_conversation *conv, const char *who, | |
128 const char *message, int flags, time_t mtime); | |
129 void (*write_im)(struct gaim_conversation *conv, const char *who, | |
130 const char *message, size_t len, int flags, time_t mtime); | |
131 void (*write_conv)(struct gaim_conversation *conv, const char *who, | |
132 const char *message, size_t length, int flags, | |
133 time_t mtime); | |
134 | |
135 void (*chat_add_user)(struct gaim_conversation *conv, const char *user); | |
136 void (*chat_rename_user)(struct gaim_conversation *conv, | |
137 const char *old_name, const char *new_name); | |
138 void (*chat_remove_user)(struct gaim_conversation *conv, const char *user); | |
139 | |
140 void (*set_title)(struct gaim_conversation *conv, | |
141 const char *title); | |
142 void (*update_progress)(struct gaim_conversation *conv, float percent); | |
143 | |
144 /* Events */ | |
145 void (*updated)(struct gaim_conversation *conv, GaimConvUpdateType type); | |
146 }; | |
147 | |
148 /** | |
149 * A core representation of a graphical window containing one or more | |
150 * conversations. | |
151 */ | |
152 struct gaim_window | |
153 { | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
154 GList *conversations; /**< The conversations in the window. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
155 size_t conversation_count; /**< The number of conversations. */ |
4359 | 156 |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
157 struct gaim_window_ui_ops *ui_ops; /**< UI-specific window operations. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
158 void *ui_data; /**< UI-specific data. */ |
4359 | 159 }; |
160 | |
161 /** | |
162 * Data specific to Instant Messages. | |
163 */ | |
164 struct gaim_im | |
165 { | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
166 struct gaim_conversation *conv; /**< The parent conversation. */ |
4359 | 167 |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
168 int typing_state; /**< The current typing state. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
169 guint typing_timeout; /**< The typing timer handle. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
170 time_t type_again; /**< The type again time. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
171 guint type_again_timeout; /**< The type again timer handle. */ |
4359 | 172 |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
173 GSList *images; /**< A list of images in the IM. */ |
4359 | 174 }; |
175 | |
176 /** | |
177 * Data specific to Chats. | |
178 */ | |
179 struct gaim_chat | |
180 { | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
181 struct gaim_conversation *conv; /**< The parent conversation. */ |
4359 | 182 |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
183 GList *in_room; /**< The users in the room. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
184 GList *ignored; /**< Ignored users. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
185 char *who; /**< The person who set the topic. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
186 char *topic; /**< The topic. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
187 int id; /**< The chat ID. */ |
4359 | 188 }; |
189 | |
190 /** | |
191 * A core representation of a conversation between two or more people. | |
192 * | |
193 * The conversation can be an IM or a chat. Each conversation is kept | |
194 * in a gaim_window and has a UI representation. | |
195 */ | |
196 struct gaim_conversation | |
197 { | |
198 GaimConversationType type; /**< The type of conversation. */ | |
199 | |
4491 | 200 struct gaim_account *account; /**< The user using this conversation. */ |
4359 | 201 struct gaim_window *window; /**< The parent window. */ |
202 | |
203 int conversation_pos; /**< The position in the window's list. */ | |
204 | |
205 char *name; /**< The name of the conversation. */ | |
206 char *title; /**< The window title. */ | |
207 | |
208 gboolean logging; /**< The status of logging. */ | |
209 | |
210 GList *send_history; /**< The send history. */ | |
211 GString *history; /**< The conversation history. */ | |
212 | |
213 GaimUnseenState unseen; /**< The unseen tab state. */ | |
214 | |
215 union | |
216 { | |
217 struct gaim_im *im; /**< IM-specific data. */ | |
218 struct gaim_chat *chat; /**< Chat-specific data. */ | |
4378
194507c83612
[gaim-migrate @ 4644]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
219 void *misc; /**< Misc. data. */ |
4359 | 220 |
221 } u; | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
222 |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
223 struct gaim_conversation_ui_ops *ui_ops; /**< UI-specific operations. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
224 void *ui_data; /**< UI-specific data. */ |
4359 | 225 }; |
226 | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
227 typedef void (*gaim_conv_placement_fnc)(struct gaim_conversation *); |
4359 | 228 |
229 /**************************************************************************/ | |
230 /** @name Conversation Window API */ | |
231 /**************************************************************************/ | |
232 /*@{*/ | |
233 | |
234 /** | |
235 * Creates a new conversation window. | |
236 * | |
237 * This window is added to the list of windows, but is not shown until | |
238 * gaim_window_show() is called. | |
239 * | |
240 * @return The new conversation window. | |
241 */ | |
242 struct gaim_window *gaim_window_new(void); | |
243 | |
244 /** | |
245 * Destroys the specified conversation window and all conversations in it. | |
246 * | |
247 * @param win The window to destroy. | |
248 */ | |
249 void gaim_window_destroy(struct gaim_window *win); | |
250 | |
251 /** | |
252 * Shows the specified conversation window. | |
253 * | |
254 * @param win The window. | |
255 */ | |
256 void gaim_window_show(struct gaim_window *win); | |
257 | |
258 /** | |
259 * Hides the specified conversation window. | |
260 * | |
261 * @param win The window. | |
262 */ | |
263 void gaim_window_hide(struct gaim_window *win); | |
264 | |
265 /** | |
266 * Raises the specified conversation window. | |
267 * | |
268 * @param win The window. | |
269 */ | |
270 void gaim_window_raise(struct gaim_window *win); | |
271 | |
272 /** | |
273 * Causes the window to flash for IM notification, if the UI supports this. | |
274 * | |
275 * @param win The window. | |
276 */ | |
277 void gaim_window_flash(struct gaim_window *win); | |
278 | |
279 /** | |
280 * Sets the specified window's UI window operations structure. | |
281 * | |
282 * @param win The window. | |
283 * @param ops The UI window operations structure. | |
284 */ | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
285 void gaim_window_set_ui_ops(struct gaim_window *win, |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
286 struct gaim_window_ui_ops *ops); |
4359 | 287 |
288 /** | |
289 * Returns the specified window's UI window operations structure. | |
290 * | |
291 * @param win The window. | |
292 * | |
293 * @return The UI window operations structure. | |
294 */ | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
295 struct gaim_window_ui_ops *gaim_window_get_ui_ops( |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
296 const struct gaim_window *win); |
4359 | 297 |
298 /** | |
299 * Adds a conversation to this window. | |
300 * | |
301 * If the conversation already has a parent window, this will do nothing. | |
302 * | |
303 * @param win The window. | |
304 * @param conv The conversation. | |
305 * | |
306 * @return The new index of the conversation in the window. | |
307 */ | |
308 int gaim_window_add_conversation(struct gaim_window *win, | |
309 struct gaim_conversation *conv); | |
310 | |
311 /** | |
312 * Removes the conversation at the specified index from the window. | |
313 * | |
314 * If there is no conversation at this index, this will do nothing. | |
315 * | |
316 * @param win The window. | |
317 * @param index The index of the conversation. | |
318 * | |
319 * @return The conversation removed. | |
320 */ | |
321 struct gaim_conversation *gaim_window_remove_conversation( | |
322 struct gaim_window *win, unsigned int index); | |
323 | |
324 /** | |
325 * Moves the conversation at the specified index in a window to a new index. | |
326 * | |
327 * @param win The window. | |
328 * @param index The index of the conversation to move. | |
329 * @param new_index The new index. | |
330 */ | |
331 void gaim_window_move_conversation(struct gaim_window *win, | |
332 unsigned int index, unsigned int new_index); | |
333 | |
334 /** | |
335 * Returns the conversation in the window at the specified index. | |
336 * | |
337 * If the index is out of range, this returns @c NULL. | |
338 * | |
339 * @param win The window. | |
340 * @param index The index containing a conversation. | |
341 * | |
342 * @return The conversation at the specified index. | |
343 */ | |
344 struct gaim_conversation *gaim_window_get_conversation_at( | |
345 const struct gaim_window *win, unsigned int index); | |
346 | |
347 /** | |
348 * Returns the number of conversations in the window. | |
349 * | |
350 * @param win The window. | |
351 * | |
352 * @return The number of conversations. | |
353 */ | |
354 size_t gaim_window_get_conversation_count(const struct gaim_window *win); | |
355 | |
356 /** | |
357 * Switches the active conversation to the one at the specified index. | |
358 * | |
359 * If @a index is out of range, this does nothing. | |
360 * | |
361 * @param win The window. | |
362 * @param index The new index. | |
363 */ | |
364 void gaim_window_switch_conversation(struct gaim_window *win, | |
365 unsigned int index); | |
366 | |
367 /** | |
368 * Returns the active conversation in the window. | |
369 * | |
370 * @param win The window. | |
371 * | |
372 * @return The active conversation. | |
373 */ | |
374 struct gaim_conversation *gaim_window_get_active_conversation( | |
375 const struct gaim_window *win); | |
376 | |
377 /** | |
378 * Returns the list of conversations in the specified window. | |
379 * | |
380 * @param win The window. | |
381 * | |
382 * @return The list of conversations. | |
383 */ | |
384 GList *gaim_window_get_conversations(const struct gaim_window *win); | |
385 | |
386 /** | |
387 * Returns a list of all windows. | |
388 * | |
389 * @return A list of windows. | |
390 */ | |
391 GList *gaim_get_windows(void); | |
392 | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
393 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
394 * Returns the first window containing a conversation of the specified type. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
395 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
396 * @param type The conversation type. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
397 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
398 * @return The window if found, or @c NULL if not found. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
399 */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
400 struct gaim_window *gaim_get_first_window_with_type(GaimConversationType type); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
401 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
402 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
403 * Returns the last window containing a conversation of the specified type. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
404 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
405 * @param type The conversation type. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
406 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
407 * @return The window if found, or @c NULL if not found. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
408 */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
409 struct gaim_window *gaim_get_last_window_with_type(GaimConversationType type); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
410 |
4359 | 411 /*@}*/ |
412 | |
413 /**************************************************************************/ | |
414 /** @name Conversation API */ | |
415 /**************************************************************************/ | |
416 /*@{*/ | |
417 | |
418 /** | |
419 * Creates a new conversation of the specified type. | |
420 * | |
421 * @param type The type of conversation. | |
4476
62c1e5e656d0
[gaim-migrate @ 4751]
Christian Hammond <chipx86@chipx86.com>
parents:
4469
diff
changeset
|
422 * @param user The account opening the conversation window on the gaim |
62c1e5e656d0
[gaim-migrate @ 4751]
Christian Hammond <chipx86@chipx86.com>
parents:
4469
diff
changeset
|
423 * user's end. |
4359 | 424 * @param name The name of the conversation. |
425 * | |
426 * @return The new conversation. | |
427 */ | |
428 struct gaim_conversation *gaim_conversation_new(GaimConversationType type, | |
4491 | 429 struct gaim_account *account, |
4359 | 430 const char *name); |
431 | |
432 /** | |
433 * Destroys the specified conversation and removes it from the parent | |
434 * window. | |
435 * | |
436 * If this conversation is the only one contained in the parent window, | |
437 * that window is also destroyed. | |
438 * | |
439 * @param conv The conversation to destroy. | |
440 */ | |
441 void gaim_conversation_destroy(struct gaim_conversation *conv); | |
442 | |
443 /** | |
444 * Returns the specified conversation's type. | |
445 * | |
446 * @param conv The conversation. | |
447 * | |
448 * @return The conversation's type. | |
449 */ | |
450 GaimConversationType gaim_conversation_get_type( | |
451 const struct gaim_conversation *conv); | |
452 | |
453 /** | |
454 * Sets the specified conversation's UI operations structure. | |
455 * | |
456 * @param conv The conversation. | |
457 * @param ops The UI conversation operations structure. | |
458 */ | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
459 void gaim_conversation_set_ui_ops(struct gaim_conversation *conv, |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
460 struct gaim_conversation_ui_ops *ops); |
4359 | 461 |
462 /** | |
463 * Returns the specified conversation's UI operations structure. | |
464 * | |
465 * @param conv The conversation. | |
466 * | |
467 * @return The operations structure. | |
468 */ | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
469 struct gaim_conversation_ui_ops *gaim_conversation_get_ui_ops( |
4359 | 470 struct gaim_conversation *conv); |
471 | |
472 /** | |
4491 | 473 * Sets the specified conversation's gaim_account. |
4359 | 474 * |
4491 | 475 * This gaim_account represents the user using gaim, not the person the user |
4359 | 476 * is having a conversation/chat/flame with. |
477 * | |
478 * @param conv The conversation. | |
4491 | 479 * @param account The gaim_account. |
4359 | 480 */ |
4491 | 481 void gaim_conversation_set_account(struct gaim_conversation *conv, |
482 struct gaim_account *account); | |
4359 | 483 |
484 /** | |
4491 | 485 * Returns the specified conversation's gaim_account. |
4359 | 486 * |
4491 | 487 * This gaim_account represents the user using gaim, not the person the user |
4359 | 488 * is having a conversation/chat/flame with. |
489 * | |
490 * @param conv The conversation. | |
491 * | |
4491 | 492 * @return The conversation's gaim_account. |
4359 | 493 */ |
4491 | 494 struct gaim_account *gaim_conversation_get_account( |
4359 | 495 const struct gaim_conversation *conv); |
496 | |
497 /** | |
498 * Returns the specified conversation's gaim_connection. | |
499 * | |
500 * This is the same as gaim_conversation_get_user(conv)->gc. | |
501 * | |
502 * @param conv The conversation. | |
503 * | |
504 * @return The conversation's gaim_connection. | |
505 */ | |
506 struct gaim_connection *gaim_conversation_get_gc( | |
507 const struct gaim_conversation *conv); | |
508 | |
509 /** | |
510 * Sets the specified conversation's title. | |
511 * | |
512 * @param conv The conversation. | |
513 * @param title The title. | |
514 */ | |
515 void gaim_conversation_set_title(struct gaim_conversation *conv, | |
516 const char *title); | |
517 | |
518 /** | |
519 * Returns the specified conversation's title. | |
520 * | |
521 * @param win The conversation. | |
522 * | |
523 * @return The title. | |
524 */ | |
525 const char *gaim_conversation_get_title(const struct gaim_conversation *conv); | |
526 | |
527 /** | |
528 * Automatically sets the specified conversation's title. | |
529 * | |
530 * This function takes OPT_IM_ALIAS_TAB into account, as well as the | |
531 * user's alias. | |
532 * | |
533 * @param conv The conversation. | |
534 */ | |
535 void gaim_conversation_autoset_title(struct gaim_conversation *conv); | |
536 | |
537 /** | |
538 * Returns the specified conversation's index in the parent window. | |
539 * | |
540 * @param conv The conversation. | |
541 * | |
542 * @return The current index in the parent window. | |
543 */ | |
544 int gaim_conversation_get_index(const struct gaim_conversation *conv); | |
545 | |
546 /** | |
547 * Sets the conversation's unseen state. | |
548 * | |
549 * @param conv The conversation. | |
550 * @param state The new unseen state. | |
551 */ | |
552 void gaim_conversation_set_unseen(struct gaim_conversation *conv, | |
553 GaimUnseenState state); | |
554 | |
555 /** | |
556 * Returns the conversation's unseen state. | |
557 * | |
558 * @param conv The conversation. | |
559 * | |
560 * @param The conversation's unseen state. | |
561 */ | |
562 GaimUnseenState gaim_conversation_get_unseen( | |
563 const struct gaim_conversation *conv); | |
564 | |
565 /** | |
566 * Returns the specified conversation's name. | |
567 * | |
568 * @param conv The conversation. | |
569 * | |
570 * @return The conversation's name. | |
571 */ | |
572 const char *gaim_conversation_get_name(const struct gaim_conversation *conv); | |
573 | |
574 /** | |
575 * Enables or disables logging for this conversation. | |
576 * | |
577 * @param log @c TRUE if logging should be enabled, or @c FALSE otherwise. | |
578 */ | |
579 void gaim_conversation_set_logging(struct gaim_conversation *conv, | |
580 gboolean log); | |
581 | |
582 /** | |
583 * Returns whether or not logging is enabled for this conversation. | |
584 * | |
585 * @return @c TRUE if logging is enabled, or @c FALSE otherwise. | |
586 */ | |
587 gboolean gaim_conversation_is_logging(const struct gaim_conversation *conv); | |
588 | |
589 /** | |
590 * Returns the specified conversation's send history. | |
591 * | |
592 * @param conv The conversation. | |
593 * | |
594 * @return The conversation's send history. | |
595 */ | |
596 GList *gaim_conversation_get_send_history( | |
597 const struct gaim_conversation *conv); | |
598 | |
599 /** | |
600 * Sets the specified conversation's history. | |
601 * | |
602 * @param conv The conversation. | |
603 * @param history The history. | |
604 */ | |
605 void gaim_conversation_set_history(struct gaim_conversation *conv, | |
606 GString *history); | |
607 | |
608 /** | |
609 * Returns the specified conversation's history. | |
610 * | |
611 * @param conv The conversation. | |
612 * | |
613 * @return The conversation's history. | |
614 */ | |
615 GString *gaim_conversation_get_history(const struct gaim_conversation *conv); | |
616 | |
617 /** | |
618 * Returns the specified conversation's parent window. | |
619 * | |
620 * @param conv The conversation. | |
621 * | |
622 * @return The conversation's parent window. | |
623 */ | |
624 struct gaim_window *gaim_conversation_get_window( | |
625 const struct gaim_conversation *conv); | |
626 | |
627 /** | |
628 * Returns the specified conversation's IM-specific data. | |
629 * | |
630 * If the conversation type is not GAIM_CONV_IM, this will return @c NULL. | |
631 * | |
632 * @param conv The conversation. | |
633 * | |
634 * @return The IM-specific data. | |
635 */ | |
636 struct gaim_im *gaim_conversation_get_im_data( | |
637 const struct gaim_conversation *conv); | |
638 | |
639 #define GAIM_IM(c) (gaim_conversation_get_im_data(c)) | |
640 | |
641 /** | |
642 * Returns the specified conversation's chat-specific data. | |
643 * | |
644 * If the conversation type is not GAIM_CONV_CHAT, this will return @c NULL. | |
645 * | |
646 * @param conv The conversation. | |
647 * | |
648 * @return The chat-specific data. | |
649 */ | |
650 struct gaim_chat *gaim_conversation_get_chat_data( | |
651 const struct gaim_conversation *conv); | |
652 | |
653 #define GAIM_CHAT(c) (gaim_conversation_get_chat_data(c)) | |
654 | |
655 /** | |
656 * Returns a list of all conversations. | |
657 * | |
658 * This list includes both IMs and chats. | |
659 * | |
660 * @return A GList of all conversations. | |
661 */ | |
662 GList *gaim_get_conversations(void); | |
663 | |
664 /** | |
665 * Returns a list of all IMs. | |
666 * | |
667 * @return A GList of all IMs. | |
668 */ | |
669 GList *gaim_get_ims(void); | |
670 | |
671 /** | |
672 * Returns a list of all chats. | |
673 * | |
674 * @return A GList of all chats. | |
675 */ | |
676 GList *gaim_get_chats(void); | |
677 | |
678 /** | |
679 * Finds the conversation with the specified name. | |
680 * | |
681 * @param name The name of the conversation. | |
682 * | |
683 * @return The conversation if found, or @c NULL otherwise. | |
684 */ | |
685 struct gaim_conversation *gaim_find_conversation(const char *name); | |
686 | |
687 /** | |
688 * Finds a conversation with the specified name and user. | |
689 * | |
690 * @param name The name of the conversation. | |
4491 | 691 * @param account The gaim_account associated with the conversation. |
4359 | 692 * |
693 * @return The conversation if found, or @c NULL otherwise. | |
694 */ | |
4491 | 695 struct gaim_conversation *gaim_find_conversation_with_account( |
696 const char *name, const struct gaim_account *account); | |
4359 | 697 |
698 /** | |
699 * Writes to a conversation window. | |
700 * | |
701 * This function should not be used to write IM or chat messages. Use | |
702 * gaim_im_write() and gaim_chat_write() instead. Those functions will | |
703 * most likely call this anyway, but they may do their own formatting, | |
704 * sound playback, etc. | |
705 * | |
706 * This can be used to write generic messages, such as "so and so closed | |
707 * the conversation window." | |
708 * | |
709 * @param conv The conversation. | |
710 * @param who The user who sent the message. | |
711 * @param message The message. | |
712 * @param length The length of the message. | |
713 * @param flags The flags. | |
714 * @param mtime The time the message was sent. | |
715 * | |
716 * @see gaim_im_write() | |
717 * @see gaim_chat_write() | |
718 */ | |
719 void gaim_conversation_write(struct gaim_conversation *conv, const char *who, | |
720 const char *message, size_t length, int flags, | |
721 time_t mtime); | |
722 | |
723 /** | |
724 * Updates the progress bar on a conversation window | |
725 * (if one exists in the UI). | |
726 * | |
727 * This is used for loading images typically. | |
728 * | |
729 * @param conv The conversation. | |
730 * @param percent The percentage. | |
731 */ | |
732 void gaim_conversation_update_progress(struct gaim_conversation *conv, | |
733 float percent); | |
734 | |
735 /** | |
736 * Updates the visual status and UI of a conversation. | |
737 * | |
738 * @param conv The conversation. | |
739 * @param type The update type. | |
740 */ | |
741 void gaim_conversation_update(struct gaim_conversation *conv, | |
742 GaimConvUpdateType type); | |
743 | |
744 /** | |
745 * Calls a function on each conversation. | |
746 * | |
747 * @param func The function. | |
748 */ | |
749 void gaim_conversation_foreach(void (*func)(struct gaim_conversation *conv)); | |
750 | |
751 /*@}*/ | |
752 | |
753 | |
754 /**************************************************************************/ | |
755 /** @name IM Conversation API */ | |
756 /**************************************************************************/ | |
757 /*@{*/ | |
758 | |
759 /** | |
760 * Gets an IM's parent conversation. | |
761 * | |
762 * @param im The IM. | |
763 * | |
764 * @return The parent conversation. | |
765 */ | |
766 struct gaim_conversation *gaim_im_get_conversation(struct gaim_im *im); | |
767 | |
768 /** | |
769 * Sets the IM's typing state. | |
770 * | |
771 * @param im The IM. | |
772 * @param state The typing state. | |
773 */ | |
774 void gaim_im_set_typing_state(struct gaim_im *im, int state); | |
775 | |
776 /** | |
777 * Returns the IM's typing state. | |
778 * | |
779 * @param im The IM. | |
780 * | |
781 * @return The IM's typing state. | |
782 */ | |
783 int gaim_im_get_typing_state(const struct gaim_im *im); | |
784 | |
785 /** | |
786 * Starts the IM's typing timeout. | |
787 * | |
788 * @param im The IM. | |
789 * @param timeout The timeout. | |
790 */ | |
791 void gaim_im_start_typing_timeout(struct gaim_im *im, int timeout); | |
792 | |
793 /** | |
794 * Stops the IM's typing timeout. | |
795 * | |
796 * @param im The IM. | |
797 */ | |
798 void gaim_im_stop_typing_timeout(struct gaim_im *im); | |
799 | |
800 /** | |
801 * Returns the IM's typing timeout. | |
802 * | |
803 * @param im The IM. | |
804 * | |
805 * @return The timeout. | |
806 */ | |
807 guint gaim_im_get_typing_timeout(const struct gaim_im *im); | |
808 | |
809 /** | |
810 * Sets the IM's time until it should send another typing notification. | |
811 * | |
812 * @param im The IM. | |
813 * @param val The time. | |
814 */ | |
815 void gaim_im_set_type_again(struct gaim_im *im, time_t val); | |
816 | |
817 /** | |
818 * Returns the IM's time until it should send another typing notification. | |
819 * | |
820 * @param im The IM. | |
821 * | |
822 * @return The time. | |
823 */ | |
824 time_t gaim_im_get_type_again(const struct gaim_im *im); | |
825 | |
826 /** | |
827 * Starts the IM's type again timeout. | |
828 * | |
829 * @param im The IM. | |
830 */ | |
831 void gaim_im_start_type_again_timeout(struct gaim_im *im); | |
832 | |
833 /** | |
834 * Stops the IM's type again timeout. | |
835 * | |
836 * @param im The IM. | |
837 */ | |
838 void gaim_im_stop_type_again_timeout(struct gaim_im *im); | |
839 | |
840 /** | |
841 * Returns the IM's type again timeout interval. | |
842 * | |
843 * @param im The IM. | |
844 * | |
845 * @return The type again timeout interval. | |
846 */ | |
847 guint gaim_im_get_type_again_timeout(const struct gaim_im *im); | |
848 | |
849 /** | |
850 * Updates the visual typing notification for an IM conversation. | |
851 * | |
852 * @param im The IM. | |
853 */ | |
854 void gaim_im_update_typing(struct gaim_im *im); | |
855 | |
856 /** | |
857 * Writes to an IM. | |
858 * | |
859 * The @a len parameter is used for writing binary data, such as an | |
860 * image. If @c message is text, specify -1 for @a len. | |
861 * | |
862 * @param im The IM. | |
863 * @param who The user who sent the message. | |
864 * @param message The message to write. | |
865 * @param len The length of the message, or -1 to specify the length | |
866 * of @a message. | |
867 * @param flag The flags. | |
868 * @param mtime The time the message was sent. | |
869 */ | |
870 void gaim_im_write(struct gaim_im *im, const char *who, | |
871 const char *message, size_t len, int flag, time_t mtime); | |
872 | |
873 /** | |
874 * Sends a message to this IM conversation. | |
875 * | |
876 * @param im The IM. | |
877 * @param message The message to send. | |
878 */ | |
879 void gaim_im_send(struct gaim_im *im, const char *message); | |
880 | |
881 /*@}*/ | |
882 | |
883 | |
884 /**************************************************************************/ | |
885 /** @name Chat Conversation API */ | |
886 /**************************************************************************/ | |
887 /*@{*/ | |
888 | |
889 /** | |
890 * Gets a chat's parent conversation. | |
891 * | |
892 * @param chat The chat. | |
893 * | |
894 * @return The parent conversation. | |
895 */ | |
896 struct gaim_conversation *gaim_chat_get_conversation(struct gaim_chat *chat); | |
897 | |
898 /** | |
899 * Sets the list of users in the chat room. | |
900 * | |
901 * @param chat The chat. | |
902 * @param users The list of users. | |
903 * | |
904 * @return The list passed. | |
905 */ | |
906 GList *gaim_chat_set_users(struct gaim_chat *chat, GList *users); | |
907 | |
908 /** | |
909 * Returns a list of users in the chat room. | |
910 * | |
911 * @param chat The chat. | |
912 * | |
913 * @return The list of users. | |
914 */ | |
915 GList *gaim_chat_get_users(const struct gaim_chat *chat); | |
916 | |
917 /** | |
918 * Ignores a user in a chat room. | |
919 * | |
920 * @param chat The chat. | |
921 * @param name The name of the user. | |
922 */ | |
923 void gaim_chat_ignore(struct gaim_chat *chat, const char *name); | |
924 | |
925 /** | |
926 * Unignores a user in a chat room. | |
927 * | |
928 * @param chat The chat. | |
929 * @param name The name of the user. | |
930 */ | |
931 void gaim_chat_unignore(struct gaim_chat *chat, const char *name); | |
932 | |
933 /** | |
934 * Sets the list of ignored users in the chat room. | |
935 * | |
936 * @param chat The chat. | |
937 * @param ignored The list of ignored users. | |
938 * | |
939 * @return The list passed. | |
940 */ | |
941 GList *gaim_chat_set_ignored(struct gaim_chat *chat, GList *ignored); | |
942 | |
943 /** | |
944 * Returns the list of ignored users in the chat room. | |
945 * | |
946 * @param chat The chat. | |
947 * | |
948 * @return The list of ignored users. | |
949 */ | |
950 GList *gaim_chat_get_ignored(const struct gaim_chat *chat); | |
951 | |
952 /** | |
953 * Returns the actual name of the specified ignored user, if it exists in | |
954 * the ignore list. | |
955 * | |
956 * If the user found contains a prefix, such as '+' or '\@', this is also | |
957 * returned. The username passed to the function does not have to have this | |
958 * formatting. | |
959 * | |
960 * @param chat The chat. | |
961 * @param user The user to check in the ignore list. | |
962 * | |
963 * @return The ignored user if found, complete with prefixes, or @c NULL | |
964 * if not found. | |
965 */ | |
966 const char *gaim_chat_get_ignored_user(const struct gaim_chat *chat, | |
967 const char *user); | |
968 | |
969 /** | |
970 * Returns @c TRUE if the specified user is ignored. | |
971 * | |
972 * @param chat The chat. | |
973 * @param user The user. | |
974 * | |
975 * @return @c TRUE if the user is in the ignore list; @c FALSE otherwise. | |
976 */ | |
977 gboolean gaim_chat_is_user_ignored(const struct gaim_chat *chat, | |
978 const char *user); | |
979 | |
980 /** | |
981 * Sets the chat room's topic. | |
982 * | |
983 * @param chat The chat. | |
984 * @param who The user that set the topic. | |
985 * @param topic The topic. | |
986 */ | |
987 void gaim_chat_set_topic(struct gaim_chat *chat, const char *who, | |
988 const char *topic); | |
989 | |
990 /** | |
991 * Returns the chat room's topic. | |
992 * | |
993 * @param chat The chat. | |
994 * | |
995 * @return The chat's topic. | |
996 */ | |
997 const char *gaim_chat_get_topic(const struct gaim_chat *chat); | |
998 | |
999 /** | |
1000 * Sets the chat room's ID. | |
1001 * | |
1002 * @param chat The chat. | |
1003 * @param id The ID. | |
1004 */ | |
1005 void gaim_chat_set_id(struct gaim_chat *chat, int id); | |
1006 | |
1007 /** | |
1008 * Returns the chat room's ID. | |
1009 * | |
1010 * @param chat The chat. | |
1011 * | |
1012 * @return The ID. | |
1013 */ | |
1014 int gaim_chat_get_id(const struct gaim_chat *chat); | |
1015 | |
1016 /** | |
1017 * Writes to a chat. | |
1018 * | |
1019 * @param chat The chat. | |
1020 * @param who The user who sent the message. | |
1021 * @param message The message to write. | |
1022 * @param flag The flags. | |
1023 * @param mtime The time the message was sent. | |
1024 */ | |
1025 void gaim_chat_write(struct gaim_chat *chat, const char *who, | |
1026 const char *message, int flag, time_t mtime); | |
1027 | |
1028 /** | |
1029 * Sends a message to this chat conversation. | |
1030 * | |
1031 * @param chat The chat. | |
1032 * @param message The message to send. | |
1033 */ | |
1034 void gaim_chat_send(struct gaim_chat *chat, const char *message); | |
1035 | |
1036 /** | |
1037 * Adds a user to a chat. | |
1038 * | |
1039 * @param chat The chat. | |
1040 * @param user The user to add. | |
1041 * @param extra_msg An extra message to display with the join message. | |
1042 */ | |
1043 void gaim_chat_add_user(struct gaim_chat *chat, const char *user, | |
1044 const char *extra_msg); | |
1045 | |
1046 /** | |
1047 * Renames a user in a chat. | |
1048 * | |
1049 * @param chat The chat. | |
1050 * @param old_user The old username. | |
1051 * @param new_user The new username. | |
1052 */ | |
1053 void gaim_chat_rename_user(struct gaim_chat *chat, const char *old_user, | |
1054 const char *new_user); | |
1055 | |
1056 /** | |
1057 * Removes a user from a chat, optionally with a reason. | |
1058 * | |
1059 * @param chat The chat. | |
1060 * @param user The user that is being removed. | |
1061 * @param reason The optional reason given for the removal. Can be @c NULL. | |
1062 */ | |
1063 void gaim_chat_remove_user(struct gaim_chat *chat, const char *user, | |
1064 const char *reason); | |
1065 | |
1066 /** | |
1067 * Finds a chat with the specified chat ID. | |
1068 * | |
1069 * @param gc The gaim_connection. | |
1070 * @param id The chat ID. | |
1071 * | |
1072 * @return The chat conversation. | |
1073 */ | |
1074 struct gaim_conversation *gaim_find_chat(struct gaim_connection *gc, int id); | |
1075 | |
1076 /*@}*/ | |
1077 | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1078 /**************************************************************************/ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1079 /** @name Conversation Placement Functions */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1080 /**************************************************************************/ |
4481
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1081 /*@{*/ |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1082 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1083 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1084 * Adds a conversation placement function to the list of possible functions. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1085 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1086 * @param name The name of the function. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1087 * @param fnc A pointer to the function. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1088 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1089 * @return The index of this entry. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1090 */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1091 int gaim_conv_placement_add_fnc(const char *name, gaim_conv_placement_fnc fnc); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1092 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1093 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1094 * Removes a conversation placement function from the list of possible |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1095 * functions. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1096 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1097 * @param index The index of the function. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1098 */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1099 void gaim_conv_placement_remove_fnc(int index); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1100 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1101 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1102 * Returns the number of conversation placement functions. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1103 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1104 * @return The number of registered functions. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1105 */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1106 int gaim_conv_placement_get_fnc_count(void); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1107 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1108 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1109 * Returns the name of the conversation placement function at the |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1110 * specified index. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1111 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1112 * @param index The index. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1113 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1114 * @return The name of the function, or @c NULL if this index is out of |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1115 * range. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1116 */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1117 const char *gaim_conv_placement_get_name(int index); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1118 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1119 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1120 * Returns a pointer to the conversation placement function at the |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1121 * specified index. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1122 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1123 * @param index The index. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1124 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1125 * @return A pointer to the function. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1126 */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1127 gaim_conv_placement_fnc gaim_conv_placement_get_fnc(int index); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1128 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1129 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1130 * Returns the index of the specified conversation placement function. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1131 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1132 * @param fnc A pointer to the registered function. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1133 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1134 * @return The index of the conversation, or -1 if the function is not |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1135 * registered. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1136 */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1137 int gaim_conv_placement_get_fnc_index(gaim_conv_placement_fnc fnc); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1138 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1139 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1140 * Returns the index of the active conversation placement function. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1141 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1142 * @param index The index of the active function. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1143 */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1144 int gaim_conv_placement_get_active(void); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1145 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1146 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1147 * Sets the active conversation placement function. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1148 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1149 * @param index The index of the function. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1150 */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1151 void gaim_conv_placement_set_active(int index); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1152 |
4481
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1153 /*@}*/ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1154 |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1155 /**************************************************************************/ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1156 /** @name UI Registration Functions */ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1157 /**************************************************************************/ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1158 /*@{*/ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1159 |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1160 /** |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1161 * Sets the UI operations structure to be used in all gaim conversation |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1162 * windows. |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1163 * |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1164 * @param fnc The function. |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1165 */ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1166 void gaim_set_win_ui_ops(struct gaim_window_ui_ops *ops); |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1167 |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1168 /** |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1169 * Returns the gaim window UI operations structure to be used in |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1170 * new windows. |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1171 * |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1172 * @return A filled-out gaim_window_ui_ops structure. |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1173 */ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1174 struct gaim_window_ui_ops *gaim_get_win_ui_ops(void); |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1175 |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1176 /*@}*/ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1177 |
4359 | 1178 #endif /* _CONVERSATION_H_ */ |