Mercurial > pidgin.yaz
comparison src/conversation.h @ 5676:dae79aefac8d
[gaim-migrate @ 6094]
I've been meaning to do this for a LONG time. The conversation API now
follows the naming convention of the rest of the new APIs. I'll get some
g_return_*_if_fail() checks in there soon.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 02 Jun 2003 21:51:06 +0000 |
parents | 9eb5b13fd412 |
children | 1d140b31d4b3 |
comparison
equal
deleted
inserted
replaced
5675:17e345ffeddb | 5676:dae79aefac8d |
---|---|
26 | 26 |
27 /**************************************************************************/ | 27 /**************************************************************************/ |
28 /** Data Structures */ | 28 /** Data Structures */ |
29 /**************************************************************************/ | 29 /**************************************************************************/ |
30 | 30 |
31 typedef enum _GaimConversationType GaimConversationType; | 31 typedef enum _GaimConversationType GaimConversationType; |
32 typedef enum _GaimUnseenState GaimUnseenState; | 32 typedef enum _GaimUnseenState GaimUnseenState; |
33 typedef enum _GaimConvUpdateType GaimConvUpdateType; | 33 typedef enum _GaimConvUpdateType GaimConvUpdateType; |
34 struct gaim_window_ui_ops; | 34 typedef struct _GaimWindowUiOps GaimWindowUiOps; |
35 struct gaim_window; | 35 typedef struct _GaimWindow GaimWindow; |
36 struct gaim_conversation; | 36 typedef struct _GaimConversationUiOps GaimConversationUiOps; |
37 struct gaim_im; | 37 typedef struct _GaimConversation GaimConversation; |
38 struct gaim_chat; | 38 typedef struct _GaimIm GaimIm; |
39 typedef struct _GaimChat GaimChat; | |
39 | 40 |
40 /** | 41 /** |
41 * A type of conversation. | 42 * A type of conversation. |
42 */ | 43 */ |
43 enum _GaimConversationType | 44 enum _GaimConversationType |
88 | 89 |
89 /** | 90 /** |
90 * Conversation window operations. | 91 * Conversation window operations. |
91 * | 92 * |
92 * Any UI representing a window must assign a filled-out gaim_window_ops | 93 * Any UI representing a window must assign a filled-out gaim_window_ops |
93 * structure to the gaim_window. | 94 * structure to the GaimWindow. |
94 */ | 95 */ |
95 struct gaim_window_ui_ops | 96 struct _GaimWindowUiOps |
96 { | 97 { |
97 struct gaim_conversation_ui_ops *(*get_conversation_ui_ops)(void); | 98 GaimConversationUiOps *(*get_conversation_ui_ops)(void); |
98 | 99 |
99 void (*new_window)(struct gaim_window *win); | 100 void (*new_window)(GaimWindow *win); |
100 void (*destroy_window)(struct gaim_window *win); | 101 void (*destroy_window)(GaimWindow *win); |
101 | 102 |
102 void (*show)(struct gaim_window *win); | 103 void (*show)(GaimWindow *win); |
103 void (*hide)(struct gaim_window *win); | 104 void (*hide)(GaimWindow *win); |
104 void (*raise)(struct gaim_window *win); | 105 void (*raise)(GaimWindow *win); |
105 void (*flash)(struct gaim_window *win); | 106 void (*flash)(GaimWindow *win); |
106 | 107 |
107 void (*switch_conversation)(struct gaim_window *win, unsigned int index); | 108 void (*switch_conversation)(GaimWindow *win, unsigned int index); |
108 void (*add_conversation)(struct gaim_window *win, | 109 void (*add_conversation)(GaimWindow *win, GaimConversation *conv); |
109 struct gaim_conversation *conv); | 110 void (*remove_conversation)(GaimWindow *win, GaimConversation *conv); |
110 void (*remove_conversation)(struct gaim_window *win, | 111 void (*move_conversation)(GaimWindow *win, GaimConversation *conv, |
111 struct gaim_conversation *conv); | |
112 void (*move_conversation)(struct gaim_window *win, | |
113 struct gaim_conversation *conv, | |
114 unsigned int newIndex); | 112 unsigned int newIndex); |
115 int (*get_active_index)(const struct gaim_window *win); | 113 int (*get_active_index)(const GaimWindow *win); |
116 }; | 114 }; |
117 | 115 |
118 /** | 116 /** |
119 * Conversation operations and events. | 117 * Conversation operations and events. |
120 * | 118 * |
121 * Any UI representing a conversation must assign a filled-out | 119 * Any UI representing a conversation must assign a filled-out |
122 * gaim_conversation_ui_ops structure to the gaim_conversation. | 120 * GaimConversationUiOps structure to the GaimConversation. |
123 */ | 121 */ |
124 struct gaim_conversation_ui_ops | 122 struct _GaimConversationUiOps |
125 { | 123 { |
126 void (*destroy_conversation)(struct gaim_conversation *conv); | 124 void (*destroy_conversation)(GaimConversation *conv); |
127 void (*write_chat)(struct gaim_conversation *conv, const char *who, | 125 void (*write_chat)(GaimConversation *conv, const char *who, |
128 const char *message, int flags, time_t mtime); | 126 const char *message, int flags, time_t mtime); |
129 void (*write_im)(struct gaim_conversation *conv, const char *who, | 127 void (*write_im)(GaimConversation *conv, const char *who, |
130 const char *message, size_t len, int flags, time_t mtime); | 128 const char *message, size_t len, int flags, time_t mtime); |
131 void (*write_conv)(struct gaim_conversation *conv, const char *who, | 129 void (*write_conv)(GaimConversation *conv, const char *who, |
132 const char *message, size_t length, int flags, | 130 const char *message, size_t length, int flags, |
133 time_t mtime); | 131 time_t mtime); |
134 | 132 |
135 void (*chat_add_user)(struct gaim_conversation *conv, const char *user); | 133 void (*chat_add_user)(GaimConversation *conv, const char *user); |
136 void (*chat_rename_user)(struct gaim_conversation *conv, | 134 void (*chat_rename_user)(GaimConversation *conv, |
137 const char *old_name, const char *new_name); | 135 const char *old_name, const char *new_name); |
138 void (*chat_remove_user)(struct gaim_conversation *conv, const char *user); | 136 void (*chat_remove_user)(GaimConversation *conv, const char *user); |
139 | 137 |
140 void (*set_title)(struct gaim_conversation *conv, | 138 void (*set_title)(GaimConversation *conv, const char *title); |
141 const char *title); | 139 void (*update_progress)(GaimConversation *conv, float percent); |
142 void (*update_progress)(struct gaim_conversation *conv, float percent); | |
143 | 140 |
144 /* Events */ | 141 /* Events */ |
145 void (*updated)(struct gaim_conversation *conv, GaimConvUpdateType type); | 142 void (*updated)(GaimConversation *conv, GaimConvUpdateType type); |
146 }; | 143 }; |
147 | 144 |
148 /** | 145 /** |
149 * A core representation of a graphical window containing one or more | 146 * A core representation of a graphical window containing one or more |
150 * conversations. | 147 * conversations. |
151 */ | 148 */ |
152 struct gaim_window | 149 struct _GaimWindow |
153 { | 150 { |
154 GList *conversations; /**< The conversations in the window. */ | 151 GList *conversations; /**< The conversations in the window. */ |
155 size_t conversation_count; /**< The number of conversations. */ | 152 size_t conversation_count; /**< The number of conversations. */ |
156 | 153 |
157 struct gaim_window_ui_ops *ui_ops; /**< UI-specific window operations. */ | 154 GaimWindowUiOps *ui_ops; /**< UI-specific window operations. */ |
158 void *ui_data; /**< UI-specific data. */ | 155 void *ui_data; /**< UI-specific data. */ |
159 }; | 156 }; |
160 | 157 |
161 /** | 158 /** |
162 * Data specific to Instant Messages. | 159 * Data specific to Instant Messages. |
163 */ | 160 */ |
164 struct gaim_im | 161 struct _GaimIm |
165 { | 162 { |
166 struct gaim_conversation *conv; /**< The parent conversation. */ | 163 GaimConversation *conv; /**< The parent conversation. */ |
167 | 164 |
168 int typing_state; /**< The current typing state. */ | 165 int typing_state; /**< The current typing state. */ |
169 guint typing_timeout; /**< The typing timer handle. */ | 166 guint typing_timeout; /**< The typing timer handle. */ |
170 time_t type_again; /**< The type again time. */ | 167 time_t type_again; /**< The type again time. */ |
171 guint type_again_timeout; /**< The type again timer handle. */ | 168 guint type_again_timeout; /**< The type again timer handle. */ |
174 }; | 171 }; |
175 | 172 |
176 /** | 173 /** |
177 * Data specific to Chats. | 174 * Data specific to Chats. |
178 */ | 175 */ |
179 struct gaim_chat | 176 struct _GaimChat |
180 { | 177 { |
181 struct gaim_conversation *conv; /**< The parent conversation. */ | 178 GaimConversation *conv; /**< The parent conversation. */ |
182 | 179 |
183 GList *in_room; /**< The users in the room. */ | 180 GList *in_room; /**< The users in the room. */ |
184 GList *ignored; /**< Ignored users. */ | 181 GList *ignored; /**< Ignored users. */ |
185 char *who; /**< The person who set the topic. */ | 182 char *who; /**< The person who set the topic. */ |
186 char *topic; /**< The topic. */ | 183 char *topic; /**< The topic. */ |
189 | 186 |
190 /** | 187 /** |
191 * A core representation of a conversation between two or more people. | 188 * A core representation of a conversation between two or more people. |
192 * | 189 * |
193 * The conversation can be an IM or a chat. Each conversation is kept | 190 * The conversation can be an IM or a chat. Each conversation is kept |
194 * in a gaim_window and has a UI representation. | 191 * in a GaimWindow and has a UI representation. |
195 */ | 192 */ |
196 struct gaim_conversation | 193 struct _GaimConversation |
197 { | 194 { |
198 GaimConversationType type; /**< The type of conversation. */ | 195 GaimConversationType type; /**< The type of conversation. */ |
199 | 196 |
200 GaimAccount *account; /**< The user using this conversation. */ | 197 GaimAccount *account; /**< The user using this conversation. */ |
201 struct gaim_window *window; /**< The parent window. */ | 198 GaimWindow *window; /**< The parent window. */ |
202 | 199 |
203 int conversation_pos; /**< The position in the window's list. */ | 200 int conversation_pos; /**< The position in the window's list. */ |
204 | 201 |
205 char *name; /**< The name of the conversation. */ | 202 char *name; /**< The name of the conversation. */ |
206 char *title; /**< The window title. */ | 203 char *title; /**< The window title. */ |
212 | 209 |
213 GaimUnseenState unseen; /**< The unseen tab state. */ | 210 GaimUnseenState unseen; /**< The unseen tab state. */ |
214 | 211 |
215 union | 212 union |
216 { | 213 { |
217 struct gaim_im *im; /**< IM-specific data. */ | 214 GaimIm *im; /**< IM-specific data. */ |
218 struct gaim_chat *chat; /**< Chat-specific data. */ | 215 GaimChat *chat; /**< Chat-specific data. */ |
219 void *misc; /**< Misc. data. */ | 216 void *misc; /**< Misc. data. */ |
220 | 217 |
221 } u; | 218 } u; |
222 | 219 |
223 struct gaim_conversation_ui_ops *ui_ops; /**< UI-specific operations. */ | 220 GaimConversationUiOps *ui_ops; /**< UI-specific operations. */ |
224 void *ui_data; /**< UI-specific data. */ | 221 void *ui_data; /**< UI-specific data. */ |
225 | 222 |
226 GHashTable *data; /**< Plugin-specific data. */ | 223 GHashTable *data; /**< Plugin-specific data. */ |
227 }; | 224 }; |
228 | 225 |
229 typedef void (*gaim_conv_placement_fnc)(struct gaim_conversation *); | 226 typedef void (*GaimConvPlacementFunc)(GaimConversation *); |
230 | 227 |
231 /**************************************************************************/ | 228 /**************************************************************************/ |
232 /** @name Conversation Window API */ | 229 /** @name Conversation Window API */ |
233 /**************************************************************************/ | 230 /**************************************************************************/ |
234 /*@{*/ | 231 /*@{*/ |
239 * This window is added to the list of windows, but is not shown until | 236 * This window is added to the list of windows, but is not shown until |
240 * gaim_window_show() is called. | 237 * gaim_window_show() is called. |
241 * | 238 * |
242 * @return The new conversation window. | 239 * @return The new conversation window. |
243 */ | 240 */ |
244 struct gaim_window *gaim_window_new(void); | 241 GaimWindow *gaim_window_new(void); |
245 | 242 |
246 /** | 243 /** |
247 * Destroys the specified conversation window and all conversations in it. | 244 * Destroys the specified conversation window and all conversations in it. |
248 * | 245 * |
249 * @param win The window to destroy. | 246 * @param win The window to destroy. |
250 */ | 247 */ |
251 void gaim_window_destroy(struct gaim_window *win); | 248 void gaim_window_destroy(GaimWindow *win); |
252 | 249 |
253 /** | 250 /** |
254 * Shows the specified conversation window. | 251 * Shows the specified conversation window. |
255 * | 252 * |
256 * @param win The window. | 253 * @param win The window. |
257 */ | 254 */ |
258 void gaim_window_show(struct gaim_window *win); | 255 void gaim_window_show(GaimWindow *win); |
259 | 256 |
260 /** | 257 /** |
261 * Hides the specified conversation window. | 258 * Hides the specified conversation window. |
262 * | 259 * |
263 * @param win The window. | 260 * @param win The window. |
264 */ | 261 */ |
265 void gaim_window_hide(struct gaim_window *win); | 262 void gaim_window_hide(GaimWindow *win); |
266 | 263 |
267 /** | 264 /** |
268 * Raises the specified conversation window. | 265 * Raises the specified conversation window. |
269 * | 266 * |
270 * @param win The window. | 267 * @param win The window. |
271 */ | 268 */ |
272 void gaim_window_raise(struct gaim_window *win); | 269 void gaim_window_raise(GaimWindow *win); |
273 | 270 |
274 /** | 271 /** |
275 * Causes the window to flash for IM notification, if the UI supports this. | 272 * Causes the window to flash for IM notification, if the UI supports this. |
276 * | 273 * |
277 * @param win The window. | 274 * @param win The window. |
278 */ | 275 */ |
279 void gaim_window_flash(struct gaim_window *win); | 276 void gaim_window_flash(GaimWindow *win); |
280 | 277 |
281 /** | 278 /** |
282 * Sets the specified window's UI window operations structure. | 279 * Sets the specified window's UI window operations structure. |
283 * | 280 * |
284 * @param win The window. | 281 * @param win The window. |
285 * @param ops The UI window operations structure. | 282 * @param ops The UI window operations structure. |
286 */ | 283 */ |
287 void gaim_window_set_ui_ops(struct gaim_window *win, | 284 void gaim_window_set_ui_ops(GaimWindow *win, GaimWindowUiOps *ops); |
288 struct gaim_window_ui_ops *ops); | |
289 | 285 |
290 /** | 286 /** |
291 * Returns the specified window's UI window operations structure. | 287 * Returns the specified window's UI window operations structure. |
292 * | 288 * |
293 * @param win The window. | 289 * @param win The window. |
294 * | 290 * |
295 * @return The UI window operations structure. | 291 * @return The UI window operations structure. |
296 */ | 292 */ |
297 struct gaim_window_ui_ops *gaim_window_get_ui_ops( | 293 GaimWindowUiOps *gaim_window_get_ui_ops(const GaimWindow *win); |
298 const struct gaim_window *win); | |
299 | 294 |
300 /** | 295 /** |
301 * Adds a conversation to this window. | 296 * Adds a conversation to this window. |
302 * | 297 * |
303 * If the conversation already has a parent window, this will do nothing. | 298 * If the conversation already has a parent window, this will do nothing. |
305 * @param win The window. | 300 * @param win The window. |
306 * @param conv The conversation. | 301 * @param conv The conversation. |
307 * | 302 * |
308 * @return The new index of the conversation in the window. | 303 * @return The new index of the conversation in the window. |
309 */ | 304 */ |
310 int gaim_window_add_conversation(struct gaim_window *win, | 305 int gaim_window_add_conversation(GaimWindow *win, GaimConversation *conv); |
311 struct gaim_conversation *conv); | |
312 | 306 |
313 /** | 307 /** |
314 * Removes the conversation at the specified index from the window. | 308 * Removes the conversation at the specified index from the window. |
315 * | 309 * |
316 * If there is no conversation at this index, this will do nothing. | 310 * If there is no conversation at this index, this will do nothing. |
318 * @param win The window. | 312 * @param win The window. |
319 * @param index The index of the conversation. | 313 * @param index The index of the conversation. |
320 * | 314 * |
321 * @return The conversation removed. | 315 * @return The conversation removed. |
322 */ | 316 */ |
323 struct gaim_conversation *gaim_window_remove_conversation( | 317 GaimConversation *gaim_window_remove_conversation(GaimWindow *win, |
324 struct gaim_window *win, unsigned int index); | 318 unsigned int index); |
325 | 319 |
326 /** | 320 /** |
327 * Moves the conversation at the specified index in a window to a new index. | 321 * Moves the conversation at the specified index in a window to a new index. |
328 * | 322 * |
329 * @param win The window. | 323 * @param win The window. |
330 * @param index The index of the conversation to move. | 324 * @param index The index of the conversation to move. |
331 * @param new_index The new index. | 325 * @param new_index The new index. |
332 */ | 326 */ |
333 void gaim_window_move_conversation(struct gaim_window *win, | 327 void gaim_window_move_conversation(GaimWindow *win, unsigned int index, |
334 unsigned int index, unsigned int new_index); | 328 unsigned int new_index); |
335 | 329 |
336 /** | 330 /** |
337 * Returns the conversation in the window at the specified index. | 331 * Returns the conversation in the window at the specified index. |
338 * | 332 * |
339 * If the index is out of range, this returns @c NULL. | 333 * If the index is out of range, this returns @c NULL. |
341 * @param win The window. | 335 * @param win The window. |
342 * @param index The index containing a conversation. | 336 * @param index The index containing a conversation. |
343 * | 337 * |
344 * @return The conversation at the specified index. | 338 * @return The conversation at the specified index. |
345 */ | 339 */ |
346 struct gaim_conversation *gaim_window_get_conversation_at( | 340 GaimConversation *gaim_window_get_conversation_at(const GaimWindow *win, |
347 const struct gaim_window *win, unsigned int index); | 341 unsigned int index); |
348 | 342 |
349 /** | 343 /** |
350 * Returns the number of conversations in the window. | 344 * Returns the number of conversations in the window. |
351 * | 345 * |
352 * @param win The window. | 346 * @param win The window. |
353 * | 347 * |
354 * @return The number of conversations. | 348 * @return The number of conversations. |
355 */ | 349 */ |
356 size_t gaim_window_get_conversation_count(const struct gaim_window *win); | 350 size_t gaim_window_get_conversation_count(const GaimWindow *win); |
357 | 351 |
358 /** | 352 /** |
359 * Switches the active conversation to the one at the specified index. | 353 * Switches the active conversation to the one at the specified index. |
360 * | 354 * |
361 * If @a index is out of range, this does nothing. | 355 * If @a index is out of range, this does nothing. |
362 * | 356 * |
363 * @param win The window. | 357 * @param win The window. |
364 * @param index The new index. | 358 * @param index The new index. |
365 */ | 359 */ |
366 void gaim_window_switch_conversation(struct gaim_window *win, | 360 void gaim_window_switch_conversation(GaimWindow *win, unsigned int index); |
367 unsigned int index); | |
368 | 361 |
369 /** | 362 /** |
370 * Returns the active conversation in the window. | 363 * Returns the active conversation in the window. |
371 * | 364 * |
372 * @param win The window. | 365 * @param win The window. |
373 * | 366 * |
374 * @return The active conversation. | 367 * @return The active conversation. |
375 */ | 368 */ |
376 struct gaim_conversation *gaim_window_get_active_conversation( | 369 GaimConversation *gaim_window_get_active_conversation(const GaimWindow *win); |
377 const struct gaim_window *win); | |
378 | 370 |
379 /** | 371 /** |
380 * Returns the list of conversations in the specified window. | 372 * Returns the list of conversations in the specified window. |
381 * | 373 * |
382 * @param win The window. | 374 * @param win The window. |
383 * | 375 * |
384 * @return The list of conversations. | 376 * @return The list of conversations. |
385 */ | 377 */ |
386 GList *gaim_window_get_conversations(const struct gaim_window *win); | 378 GList *gaim_window_get_conversations(const GaimWindow *win); |
387 | 379 |
388 /** | 380 /** |
389 * Returns a list of all windows. | 381 * Returns a list of all windows. |
390 * | 382 * |
391 * @return A list of windows. | 383 * @return A list of windows. |
397 * | 389 * |
398 * @param type The conversation type. | 390 * @param type The conversation type. |
399 * | 391 * |
400 * @return The window if found, or @c NULL if not found. | 392 * @return The window if found, or @c NULL if not found. |
401 */ | 393 */ |
402 struct gaim_window *gaim_get_first_window_with_type(GaimConversationType type); | 394 GaimWindow *gaim_get_first_window_with_type(GaimConversationType type); |
403 | 395 |
404 /** | 396 /** |
405 * Returns the last window containing a conversation of the specified type. | 397 * Returns the last window containing a conversation of the specified type. |
406 * | 398 * |
407 * @param type The conversation type. | 399 * @param type The conversation type. |
408 * | 400 * |
409 * @return The window if found, or @c NULL if not found. | 401 * @return The window if found, or @c NULL if not found. |
410 */ | 402 */ |
411 struct gaim_window *gaim_get_last_window_with_type(GaimConversationType type); | 403 GaimWindow *gaim_get_last_window_with_type(GaimConversationType type); |
412 | 404 |
413 /*@}*/ | 405 /*@}*/ |
414 | 406 |
415 /**************************************************************************/ | 407 /**************************************************************************/ |
416 /** @name Conversation API */ | 408 /** @name Conversation API */ |
425 * user's end. | 417 * user's end. |
426 * @param name The name of the conversation. | 418 * @param name The name of the conversation. |
427 * | 419 * |
428 * @return The new conversation. | 420 * @return The new conversation. |
429 */ | 421 */ |
430 struct gaim_conversation *gaim_conversation_new(GaimConversationType type, | 422 GaimConversation *gaim_conversation_new(GaimConversationType type, |
431 GaimAccount *account, | 423 GaimAccount *account, |
432 const char *name); | 424 const char *name); |
433 | 425 |
434 /** | 426 /** |
435 * Destroys the specified conversation and removes it from the parent | 427 * Destroys the specified conversation and removes it from the parent |
436 * window. | 428 * window. |
437 * | 429 * |
438 * If this conversation is the only one contained in the parent window, | 430 * If this conversation is the only one contained in the parent window, |
439 * that window is also destroyed. | 431 * that window is also destroyed. |
440 * | 432 * |
441 * @param conv The conversation to destroy. | 433 * @param conv The conversation to destroy. |
442 */ | 434 */ |
443 void gaim_conversation_destroy(struct gaim_conversation *conv); | 435 void gaim_conversation_destroy(GaimConversation *conv); |
444 | 436 |
445 /** | 437 /** |
446 * Returns the specified conversation's type. | 438 * Returns the specified conversation's type. |
447 * | 439 * |
448 * @param conv The conversation. | 440 * @param conv The conversation. |
449 * | 441 * |
450 * @return The conversation's type. | 442 * @return The conversation's type. |
451 */ | 443 */ |
452 GaimConversationType gaim_conversation_get_type( | 444 GaimConversationType gaim_conversation_get_type(const GaimConversation *conv); |
453 const struct gaim_conversation *conv); | |
454 | 445 |
455 /** | 446 /** |
456 * Sets the specified conversation's UI operations structure. | 447 * Sets the specified conversation's UI operations structure. |
457 * | 448 * |
458 * @param conv The conversation. | 449 * @param conv The conversation. |
459 * @param ops The UI conversation operations structure. | 450 * @param ops The UI conversation operations structure. |
460 */ | 451 */ |
461 void gaim_conversation_set_ui_ops(struct gaim_conversation *conv, | 452 void gaim_conversation_set_ui_ops(GaimConversation *conv, |
462 struct gaim_conversation_ui_ops *ops); | 453 GaimConversationUiOps *ops); |
463 | 454 |
464 /** | 455 /** |
465 * Returns the specified conversation's UI operations structure. | 456 * Returns the specified conversation's UI operations structure. |
466 * | 457 * |
467 * @param conv The conversation. | 458 * @param conv The conversation. |
468 * | 459 * |
469 * @return The operations structure. | 460 * @return The operations structure. |
470 */ | 461 */ |
471 struct gaim_conversation_ui_ops *gaim_conversation_get_ui_ops( | 462 GaimConversationUiOps *gaim_conversation_get_ui_ops( |
472 struct gaim_conversation *conv); | 463 const GaimConversation *conv); |
473 | 464 |
474 /** | 465 /** |
475 * Sets the specified conversation's gaim_account. | 466 * Sets the specified conversation's gaim_account. |
476 * | 467 * |
477 * This gaim_account represents the user using gaim, not the person the user | 468 * This gaim_account represents the user using gaim, not the person the user |
478 * is having a conversation/chat/flame with. | 469 * is having a conversation/chat/flame with. |
479 * | 470 * |
480 * @param conv The conversation. | 471 * @param conv The conversation. |
481 * @param account The gaim_account. | 472 * @param account The gaim_account. |
482 */ | 473 */ |
483 void gaim_conversation_set_account(struct gaim_conversation *conv, | 474 void gaim_conversation_set_account(GaimConversation *conv, |
484 GaimAccount *account); | 475 GaimAccount *account); |
485 | 476 |
486 /** | 477 /** |
487 * Returns the specified conversation's gaim_account. | 478 * Returns the specified conversation's gaim_account. |
488 * | 479 * |
489 * This gaim_account represents the user using gaim, not the person the user | 480 * This gaim_account represents the user using gaim, not the person the user |
491 * | 482 * |
492 * @param conv The conversation. | 483 * @param conv The conversation. |
493 * | 484 * |
494 * @return The conversation's gaim_account. | 485 * @return The conversation's gaim_account. |
495 */ | 486 */ |
496 GaimAccount *gaim_conversation_get_account( | 487 GaimAccount *gaim_conversation_get_account(const GaimConversation *conv); |
497 const struct gaim_conversation *conv); | |
498 | 488 |
499 /** | 489 /** |
500 * Returns the specified conversation's gaim_connection. | 490 * Returns the specified conversation's gaim_connection. |
501 * | 491 * |
502 * This is the same as gaim_conversation_get_user(conv)->gc. | 492 * This is the same as gaim_conversation_get_user(conv)->gc. |
503 * | 493 * |
504 * @param conv The conversation. | 494 * @param conv The conversation. |
505 * | 495 * |
506 * @return The conversation's gaim_connection. | 496 * @return The conversation's gaim_connection. |
507 */ | 497 */ |
508 GaimConnection *gaim_conversation_get_gc( | 498 GaimConnection *gaim_conversation_get_gc(const GaimConversation *conv); |
509 const struct gaim_conversation *conv); | |
510 | 499 |
511 /** | 500 /** |
512 * Sets the specified conversation's title. | 501 * Sets the specified conversation's title. |
513 * | 502 * |
514 * @param conv The conversation. | 503 * @param conv The conversation. |
515 * @param title The title. | 504 * @param title The title. |
516 */ | 505 */ |
517 void gaim_conversation_set_title(struct gaim_conversation *conv, | 506 void gaim_conversation_set_title(GaimConversation *conv, const char *title); |
518 const char *title); | |
519 | 507 |
520 /** | 508 /** |
521 * Returns the specified conversation's title. | 509 * Returns the specified conversation's title. |
522 * | 510 * |
523 * @param win The conversation. | 511 * @param win The conversation. |
524 * | 512 * |
525 * @return The title. | 513 * @return The title. |
526 */ | 514 */ |
527 const char *gaim_conversation_get_title(const struct gaim_conversation *conv); | 515 const char *gaim_conversation_get_title(const GaimConversation *conv); |
528 | 516 |
529 /** | 517 /** |
530 * Automatically sets the specified conversation's title. | 518 * Automatically sets the specified conversation's title. |
531 * | 519 * |
532 * This function takes OPT_IM_ALIAS_TAB into account, as well as the | 520 * This function takes OPT_IM_ALIAS_TAB into account, as well as the |
533 * user's alias. | 521 * user's alias. |
534 * | 522 * |
535 * @param conv The conversation. | 523 * @param conv The conversation. |
536 */ | 524 */ |
537 void gaim_conversation_autoset_title(struct gaim_conversation *conv); | 525 void gaim_conversation_autoset_title(GaimConversation *conv); |
538 | 526 |
539 /** | 527 /** |
540 * Returns the specified conversation's index in the parent window. | 528 * Returns the specified conversation's index in the parent window. |
541 * | 529 * |
542 * @param conv The conversation. | 530 * @param conv The conversation. |
543 * | 531 * |
544 * @return The current index in the parent window. | 532 * @return The current index in the parent window. |
545 */ | 533 */ |
546 int gaim_conversation_get_index(const struct gaim_conversation *conv); | 534 int gaim_conversation_get_index(const GaimConversation *conv); |
547 | 535 |
548 /** | 536 /** |
549 * Sets the conversation's unseen state. | 537 * Sets the conversation's unseen state. |
550 * | 538 * |
551 * @param conv The conversation. | 539 * @param conv The conversation. |
552 * @param state The new unseen state. | 540 * @param state The new unseen state. |
553 */ | 541 */ |
554 void gaim_conversation_set_unseen(struct gaim_conversation *conv, | 542 void gaim_conversation_set_unseen(GaimConversation *conv, |
555 GaimUnseenState state); | 543 GaimUnseenState state); |
556 | 544 |
557 /** | 545 /** |
558 * Returns the conversation's unseen state. | 546 * Returns the conversation's unseen state. |
559 * | 547 * |
560 * @param conv The conversation. | 548 * @param conv The conversation. |
561 * | 549 * |
562 * @param The conversation's unseen state. | 550 * @param The conversation's unseen state. |
563 */ | 551 */ |
564 GaimUnseenState gaim_conversation_get_unseen( | 552 GaimUnseenState gaim_conversation_get_unseen(const GaimConversation *conv); |
565 const struct gaim_conversation *conv); | |
566 | 553 |
567 /** | 554 /** |
568 * Returns the specified conversation's name. | 555 * Returns the specified conversation's name. |
569 * | 556 * |
570 * @param conv The conversation. | 557 * @param conv The conversation. |
571 * | 558 * |
572 * @return The conversation's name. | 559 * @return The conversation's name. |
573 */ | 560 */ |
574 const char *gaim_conversation_get_name(const struct gaim_conversation *conv); | 561 const char *gaim_conversation_get_name(const GaimConversation *conv); |
575 | 562 |
576 /** | 563 /** |
577 * Enables or disables logging for this conversation. | 564 * Enables or disables logging for this conversation. |
578 * | 565 * |
579 * @param log @c TRUE if logging should be enabled, or @c FALSE otherwise. | 566 * @param log @c TRUE if logging should be enabled, or @c FALSE otherwise. |
580 */ | 567 */ |
581 void gaim_conversation_set_logging(struct gaim_conversation *conv, | 568 void gaim_conversation_set_logging(GaimConversation *conv, gboolean log); |
582 gboolean log); | |
583 | 569 |
584 /** | 570 /** |
585 * Returns whether or not logging is enabled for this conversation. | 571 * Returns whether or not logging is enabled for this conversation. |
586 * | 572 * |
587 * @return @c TRUE if logging is enabled, or @c FALSE otherwise. | 573 * @return @c TRUE if logging is enabled, or @c FALSE otherwise. |
588 */ | 574 */ |
589 gboolean gaim_conversation_is_logging(const struct gaim_conversation *conv); | 575 gboolean gaim_conversation_is_logging(const GaimConversation *conv); |
590 | 576 |
591 /** | 577 /** |
592 * Returns the specified conversation's send history. | 578 * Returns the specified conversation's send history. |
593 * | 579 * |
594 * @param conv The conversation. | 580 * @param conv The conversation. |
595 * | 581 * |
596 * @return The conversation's send history. | 582 * @return The conversation's send history. |
597 */ | 583 */ |
598 GList *gaim_conversation_get_send_history( | 584 GList *gaim_conversation_get_send_history(const GaimConversation *conv); |
599 const struct gaim_conversation *conv); | |
600 | 585 |
601 /** | 586 /** |
602 * Sets the specified conversation's history. | 587 * Sets the specified conversation's history. |
603 * | 588 * |
604 * @param conv The conversation. | 589 * @param conv The conversation. |
605 * @param history The history. | 590 * @param history The history. |
606 */ | 591 */ |
607 void gaim_conversation_set_history(struct gaim_conversation *conv, | 592 void gaim_conversation_set_history(GaimConversation *conv, GString *history); |
608 GString *history); | |
609 | 593 |
610 /** | 594 /** |
611 * Returns the specified conversation's history. | 595 * Returns the specified conversation's history. |
612 * | 596 * |
613 * @param conv The conversation. | 597 * @param conv The conversation. |
614 * | 598 * |
615 * @return The conversation's history. | 599 * @return The conversation's history. |
616 */ | 600 */ |
617 GString *gaim_conversation_get_history(const struct gaim_conversation *conv); | 601 GString *gaim_conversation_get_history(const GaimConversation *conv); |
618 | 602 |
619 /** | 603 /** |
620 * Returns the specified conversation's parent window. | 604 * Returns the specified conversation's parent window. |
621 * | 605 * |
622 * @param conv The conversation. | 606 * @param conv The conversation. |
623 * | 607 * |
624 * @return The conversation's parent window. | 608 * @return The conversation's parent window. |
625 */ | 609 */ |
626 struct gaim_window *gaim_conversation_get_window( | 610 GaimWindow *gaim_conversation_get_window(const GaimConversation *conv); |
627 const struct gaim_conversation *conv); | |
628 | 611 |
629 /** | 612 /** |
630 * Returns the specified conversation's IM-specific data. | 613 * Returns the specified conversation's IM-specific data. |
631 * | 614 * |
632 * If the conversation type is not GAIM_CONV_IM, this will return @c NULL. | 615 * If the conversation type is not GAIM_CONV_IM, this will return @c NULL. |
633 * | 616 * |
634 * @param conv The conversation. | 617 * @param conv The conversation. |
635 * | 618 * |
636 * @return The IM-specific data. | 619 * @return The IM-specific data. |
637 */ | 620 */ |
638 struct gaim_im *gaim_conversation_get_im_data( | 621 GaimIm *gaim_conversation_get_im_data(const GaimConversation *conv); |
639 const struct gaim_conversation *conv); | |
640 | 622 |
641 #define GAIM_IM(c) (gaim_conversation_get_im_data(c)) | 623 #define GAIM_IM(c) (gaim_conversation_get_im_data(c)) |
642 | 624 |
643 /** | 625 /** |
644 * Returns the specified conversation's chat-specific data. | 626 * Returns the specified conversation's chat-specific data. |
647 * | 629 * |
648 * @param conv The conversation. | 630 * @param conv The conversation. |
649 * | 631 * |
650 * @return The chat-specific data. | 632 * @return The chat-specific data. |
651 */ | 633 */ |
652 struct gaim_chat *gaim_conversation_get_chat_data( | 634 GaimChat *gaim_conversation_get_chat_data(const GaimConversation *conv); |
653 const struct gaim_conversation *conv); | |
654 | 635 |
655 #define GAIM_CHAT(c) (gaim_conversation_get_chat_data(c)) | 636 #define GAIM_CHAT(c) (gaim_conversation_get_chat_data(c)) |
656 | 637 |
657 /** | 638 /** |
658 * Sets extra data for a conversation. | 639 * Sets extra data for a conversation. |
659 * | 640 * |
660 * @param conv The conversation. | 641 * @param conv The conversation. |
661 * @param key The unique key. | 642 * @param key The unique key. |
662 * @param data The data to assign. | 643 * @param data The data to assign. |
663 */ | 644 */ |
664 void gaim_conversation_set_data(struct gaim_conversation *conv, | 645 void gaim_conversation_set_data(GaimConversation *conv, const char *key, |
665 const char *key, gpointer data); | 646 gpointer data); |
666 | 647 |
667 /** | 648 /** |
668 * Returns extra data in a conversation. | 649 * Returns extra data in a conversation. |
669 * | 650 * |
670 * @param conv The conversation. | 651 * @param conv The conversation. |
671 * @param key The unqiue key. | 652 * @param key The unqiue key. |
672 * | 653 * |
673 * @return The data associated with the key. | 654 * @return The data associated with the key. |
674 */ | 655 */ |
675 gpointer gaim_conversation_get_data(struct gaim_conversation *conv, | 656 gpointer gaim_conversation_get_data(GaimConversation *conv, const char *key); |
676 const char *key); | |
677 | 657 |
678 /** | 658 /** |
679 * Returns a list of all conversations. | 659 * Returns a list of all conversations. |
680 * | 660 * |
681 * This list includes both IMs and chats. | 661 * This list includes both IMs and chats. |
703 * | 683 * |
704 * @param name The name of the conversation. | 684 * @param name The name of the conversation. |
705 * | 685 * |
706 * @return The conversation if found, or @c NULL otherwise. | 686 * @return The conversation if found, or @c NULL otherwise. |
707 */ | 687 */ |
708 struct gaim_conversation *gaim_find_conversation(const char *name); | 688 GaimConversation *gaim_find_conversation(const char *name); |
709 | 689 |
710 /** | 690 /** |
711 * Finds a conversation with the specified name and user. | 691 * Finds a conversation with the specified name and user. |
712 * | 692 * |
713 * @param name The name of the conversation. | 693 * @param name The name of the conversation. |
714 * @param account The gaim_account associated with the conversation. | 694 * @param account The gaim_account associated with the conversation. |
715 * | 695 * |
716 * @return The conversation if found, or @c NULL otherwise. | 696 * @return The conversation if found, or @c NULL otherwise. |
717 */ | 697 */ |
718 struct gaim_conversation *gaim_find_conversation_with_account( | 698 GaimConversation *gaim_find_conversation_with_account( |
719 const char *name, const GaimAccount *account); | 699 const char *name, const GaimAccount *account); |
720 | 700 |
721 /** | 701 /** |
722 * Writes to a conversation window. | 702 * Writes to a conversation window. |
723 * | 703 * |
737 * @param mtime The time the message was sent. | 717 * @param mtime The time the message was sent. |
738 * | 718 * |
739 * @see gaim_im_write() | 719 * @see gaim_im_write() |
740 * @see gaim_chat_write() | 720 * @see gaim_chat_write() |
741 */ | 721 */ |
742 void gaim_conversation_write(struct gaim_conversation *conv, const char *who, | 722 void gaim_conversation_write(GaimConversation *conv, const char *who, |
743 const char *message, size_t length, int flags, | 723 const char *message, size_t length, int flags, |
744 time_t mtime); | 724 time_t mtime); |
745 | 725 |
746 /** | 726 /** |
747 * Updates the progress bar on a conversation window | 727 * Updates the progress bar on a conversation window |
750 * This is used for loading images typically. | 730 * This is used for loading images typically. |
751 * | 731 * |
752 * @param conv The conversation. | 732 * @param conv The conversation. |
753 * @param percent The percentage. | 733 * @param percent The percentage. |
754 */ | 734 */ |
755 void gaim_conversation_update_progress(struct gaim_conversation *conv, | 735 void gaim_conversation_update_progress(GaimConversation *conv, float percent); |
756 float percent); | |
757 | 736 |
758 /** | 737 /** |
759 * Updates the visual status and UI of a conversation. | 738 * Updates the visual status and UI of a conversation. |
760 * | 739 * |
761 * @param conv The conversation. | 740 * @param conv The conversation. |
762 * @param type The update type. | 741 * @param type The update type. |
763 */ | 742 */ |
764 void gaim_conversation_update(struct gaim_conversation *conv, | 743 void gaim_conversation_update(GaimConversation *conv, GaimConvUpdateType type); |
765 GaimConvUpdateType type); | |
766 | 744 |
767 /** | 745 /** |
768 * Calls a function on each conversation. | 746 * Calls a function on each conversation. |
769 * | 747 * |
770 * @param func The function. | 748 * @param func The function. |
771 */ | 749 */ |
772 void gaim_conversation_foreach(void (*func)(struct gaim_conversation *conv)); | 750 void gaim_conversation_foreach(void (*func)(GaimConversation *conv)); |
773 | 751 |
774 /*@}*/ | 752 /*@}*/ |
775 | 753 |
776 | 754 |
777 /**************************************************************************/ | 755 /**************************************************************************/ |
784 * | 762 * |
785 * @param im The IM. | 763 * @param im The IM. |
786 * | 764 * |
787 * @return The parent conversation. | 765 * @return The parent conversation. |
788 */ | 766 */ |
789 struct gaim_conversation *gaim_im_get_conversation(struct gaim_im *im); | 767 GaimConversation *gaim_im_get_conversation(const GaimIm *im); |
790 | 768 |
791 /** | 769 /** |
792 * Sets the IM's typing state. | 770 * Sets the IM's typing state. |
793 * | 771 * |
794 * @param im The IM. | 772 * @param im The IM. |
795 * @param state The typing state. | 773 * @param state The typing state. |
796 */ | 774 */ |
797 void gaim_im_set_typing_state(struct gaim_im *im, int state); | 775 void gaim_im_set_typing_state(GaimIm *im, int state); |
798 | 776 |
799 /** | 777 /** |
800 * Returns the IM's typing state. | 778 * Returns the IM's typing state. |
801 * | 779 * |
802 * @param im The IM. | 780 * @param im The IM. |
803 * | 781 * |
804 * @return The IM's typing state. | 782 * @return The IM's typing state. |
805 */ | 783 */ |
806 int gaim_im_get_typing_state(const struct gaim_im *im); | 784 int gaim_im_get_typing_state(const GaimIm *im); |
807 | 785 |
808 /** | 786 /** |
809 * Starts the IM's typing timeout. | 787 * Starts the IM's typing timeout. |
810 * | 788 * |
811 * @param im The IM. | 789 * @param im The IM. |
812 * @param timeout The timeout. | 790 * @param timeout The timeout. |
813 */ | 791 */ |
814 void gaim_im_start_typing_timeout(struct gaim_im *im, int timeout); | 792 void gaim_im_start_typing_timeout(GaimIm *im, int timeout); |
815 | 793 |
816 /** | 794 /** |
817 * Stops the IM's typing timeout. | 795 * Stops the IM's typing timeout. |
818 * | 796 * |
819 * @param im The IM. | 797 * @param im The IM. |
820 */ | 798 */ |
821 void gaim_im_stop_typing_timeout(struct gaim_im *im); | 799 void gaim_im_stop_typing_timeout(GaimIm *im); |
822 | 800 |
823 /** | 801 /** |
824 * Returns the IM's typing timeout. | 802 * Returns the IM's typing timeout. |
825 * | 803 * |
826 * @param im The IM. | 804 * @param im The IM. |
827 * | 805 * |
828 * @return The timeout. | 806 * @return The timeout. |
829 */ | 807 */ |
830 guint gaim_im_get_typing_timeout(const struct gaim_im *im); | 808 guint gaim_im_get_typing_timeout(const GaimIm *im); |
831 | 809 |
832 /** | 810 /** |
833 * Sets the IM's time until it should send another typing notification. | 811 * Sets the IM's time until it should send another typing notification. |
834 * | 812 * |
835 * @param im The IM. | 813 * @param im The IM. |
836 * @param val The time. | 814 * @param val The time. |
837 */ | 815 */ |
838 void gaim_im_set_type_again(struct gaim_im *im, time_t val); | 816 void gaim_im_set_type_again(GaimIm *im, time_t val); |
839 | 817 |
840 /** | 818 /** |
841 * Returns the IM's time until it should send another typing notification. | 819 * Returns the IM's time until it should send another typing notification. |
842 * | 820 * |
843 * @param im The IM. | 821 * @param im The IM. |
844 * | 822 * |
845 * @return The time. | 823 * @return The time. |
846 */ | 824 */ |
847 time_t gaim_im_get_type_again(const struct gaim_im *im); | 825 time_t gaim_im_get_type_again(const GaimIm *im); |
848 | 826 |
849 /** | 827 /** |
850 * Starts the IM's type again timeout. | 828 * Starts the IM's type again timeout. |
851 * | 829 * |
852 * @param im The IM. | 830 * @param im The IM. |
853 */ | 831 */ |
854 void gaim_im_start_type_again_timeout(struct gaim_im *im); | 832 void gaim_im_start_type_again_timeout(GaimIm *im); |
855 | 833 |
856 /** | 834 /** |
857 * Stops the IM's type again timeout. | 835 * Stops the IM's type again timeout. |
858 * | 836 * |
859 * @param im The IM. | 837 * @param im The IM. |
860 */ | 838 */ |
861 void gaim_im_stop_type_again_timeout(struct gaim_im *im); | 839 void gaim_im_stop_type_again_timeout(GaimIm *im); |
862 | 840 |
863 /** | 841 /** |
864 * Returns the IM's type again timeout interval. | 842 * Returns the IM's type again timeout interval. |
865 * | 843 * |
866 * @param im The IM. | 844 * @param im The IM. |
867 * | 845 * |
868 * @return The type again timeout interval. | 846 * @return The type again timeout interval. |
869 */ | 847 */ |
870 guint gaim_im_get_type_again_timeout(const struct gaim_im *im); | 848 guint gaim_im_get_type_again_timeout(const GaimIm *im); |
871 | 849 |
872 /** | 850 /** |
873 * Updates the visual typing notification for an IM conversation. | 851 * Updates the visual typing notification for an IM conversation. |
874 * | 852 * |
875 * @param im The IM. | 853 * @param im The IM. |
876 */ | 854 */ |
877 void gaim_im_update_typing(struct gaim_im *im); | 855 void gaim_im_update_typing(GaimIm *im); |
878 | 856 |
879 /** | 857 /** |
880 * Writes to an IM. | 858 * Writes to an IM. |
881 * | 859 * |
882 * The @a len parameter is used for writing binary data, such as an | 860 * The @a len parameter is used for writing binary data, such as an |
888 * @param len The length of the message, or -1 to specify the length | 866 * @param len The length of the message, or -1 to specify the length |
889 * of @a message. | 867 * of @a message. |
890 * @param flag The flags. | 868 * @param flag The flags. |
891 * @param mtime The time the message was sent. | 869 * @param mtime The time the message was sent. |
892 */ | 870 */ |
893 void gaim_im_write(struct gaim_im *im, const char *who, | 871 void gaim_im_write(GaimIm *im, const char *who, |
894 const char *message, size_t len, int flag, time_t mtime); | 872 const char *message, size_t len, int flag, time_t mtime); |
895 | 873 |
896 /** | 874 /** |
897 * Sends a message to this IM conversation. | 875 * Sends a message to this IM conversation. |
898 * | 876 * |
899 * @param im The IM. | 877 * @param im The IM. |
900 * @param message The message to send. | 878 * @param message The message to send. |
901 */ | 879 */ |
902 void gaim_im_send(struct gaim_im *im, const char *message); | 880 void gaim_im_send(GaimIm *im, const char *message); |
903 | 881 |
904 /*@}*/ | 882 /*@}*/ |
905 | 883 |
906 | 884 |
907 /**************************************************************************/ | 885 /**************************************************************************/ |
914 * | 892 * |
915 * @param chat The chat. | 893 * @param chat The chat. |
916 * | 894 * |
917 * @return The parent conversation. | 895 * @return The parent conversation. |
918 */ | 896 */ |
919 struct gaim_conversation *gaim_chat_get_conversation(struct gaim_chat *chat); | 897 GaimConversation *gaim_chat_get_conversation(const GaimChat *chat); |
920 | 898 |
921 /** | 899 /** |
922 * Sets the list of users in the chat room. | 900 * Sets the list of users in the chat room. |
923 * | 901 * |
924 * @param chat The chat. | 902 * @param chat The chat. |
925 * @param users The list of users. | 903 * @param users The list of users. |
926 * | 904 * |
927 * @return The list passed. | 905 * @return The list passed. |
928 */ | 906 */ |
929 GList *gaim_chat_set_users(struct gaim_chat *chat, GList *users); | 907 GList *gaim_chat_set_users(GaimChat *chat, GList *users); |
930 | 908 |
931 /** | 909 /** |
932 * Returns a list of users in the chat room. | 910 * Returns a list of users in the chat room. |
933 * | 911 * |
934 * @param chat The chat. | 912 * @param chat The chat. |
935 * | 913 * |
936 * @return The list of users. | 914 * @return The list of users. |
937 */ | 915 */ |
938 GList *gaim_chat_get_users(const struct gaim_chat *chat); | 916 GList *gaim_chat_get_users(const GaimChat *chat); |
939 | 917 |
940 /** | 918 /** |
941 * Ignores a user in a chat room. | 919 * Ignores a user in a chat room. |
942 * | 920 * |
943 * @param chat The chat. | 921 * @param chat The chat. |
944 * @param name The name of the user. | 922 * @param name The name of the user. |
945 */ | 923 */ |
946 void gaim_chat_ignore(struct gaim_chat *chat, const char *name); | 924 void gaim_chat_ignore(GaimChat *chat, const char *name); |
947 | 925 |
948 /** | 926 /** |
949 * Unignores a user in a chat room. | 927 * Unignores a user in a chat room. |
950 * | 928 * |
951 * @param chat The chat. | 929 * @param chat The chat. |
952 * @param name The name of the user. | 930 * @param name The name of the user. |
953 */ | 931 */ |
954 void gaim_chat_unignore(struct gaim_chat *chat, const char *name); | 932 void gaim_chat_unignore(GaimChat *chat, const char *name); |
955 | 933 |
956 /** | 934 /** |
957 * Sets the list of ignored users in the chat room. | 935 * Sets the list of ignored users in the chat room. |
958 * | 936 * |
959 * @param chat The chat. | 937 * @param chat The chat. |
960 * @param ignored The list of ignored users. | 938 * @param ignored The list of ignored users. |
961 * | 939 * |
962 * @return The list passed. | 940 * @return The list passed. |
963 */ | 941 */ |
964 GList *gaim_chat_set_ignored(struct gaim_chat *chat, GList *ignored); | 942 GList *gaim_chat_set_ignored(GaimChat *chat, GList *ignored); |
965 | 943 |
966 /** | 944 /** |
967 * Returns the list of ignored users in the chat room. | 945 * Returns the list of ignored users in the chat room. |
968 * | 946 * |
969 * @param chat The chat. | 947 * @param chat The chat. |
970 * | 948 * |
971 * @return The list of ignored users. | 949 * @return The list of ignored users. |
972 */ | 950 */ |
973 GList *gaim_chat_get_ignored(const struct gaim_chat *chat); | 951 GList *gaim_chat_get_ignored(const GaimChat *chat); |
974 | 952 |
975 /** | 953 /** |
976 * Returns the actual name of the specified ignored user, if it exists in | 954 * Returns the actual name of the specified ignored user, if it exists in |
977 * the ignore list. | 955 * the ignore list. |
978 * | 956 * |
984 * @param user The user to check in the ignore list. | 962 * @param user The user to check in the ignore list. |
985 * | 963 * |
986 * @return The ignored user if found, complete with prefixes, or @c NULL | 964 * @return The ignored user if found, complete with prefixes, or @c NULL |
987 * if not found. | 965 * if not found. |
988 */ | 966 */ |
989 const char *gaim_chat_get_ignored_user(const struct gaim_chat *chat, | 967 const char *gaim_chat_get_ignored_user(const GaimChat *chat, |
990 const char *user); | 968 const char *user); |
991 | 969 |
992 /** | 970 /** |
993 * Returns @c TRUE if the specified user is ignored. | 971 * Returns @c TRUE if the specified user is ignored. |
994 * | 972 * |
995 * @param chat The chat. | 973 * @param chat The chat. |
996 * @param user The user. | 974 * @param user The user. |
997 * | 975 * |
998 * @return @c TRUE if the user is in the ignore list; @c FALSE otherwise. | 976 * @return @c TRUE if the user is in the ignore list; @c FALSE otherwise. |
999 */ | 977 */ |
1000 gboolean gaim_chat_is_user_ignored(const struct gaim_chat *chat, | 978 gboolean gaim_chat_is_user_ignored(const GaimChat *chat, |
1001 const char *user); | 979 const char *user); |
1002 | 980 |
1003 /** | 981 /** |
1004 * Sets the chat room's topic. | 982 * Sets the chat room's topic. |
1005 * | 983 * |
1006 * @param chat The chat. | 984 * @param chat The chat. |
1007 * @param who The user that set the topic. | 985 * @param who The user that set the topic. |
1008 * @param topic The topic. | 986 * @param topic The topic. |
1009 */ | 987 */ |
1010 void gaim_chat_set_topic(struct gaim_chat *chat, const char *who, | 988 void gaim_chat_set_topic(GaimChat *chat, const char *who, |
1011 const char *topic); | 989 const char *topic); |
1012 | 990 |
1013 /** | 991 /** |
1014 * Returns the chat room's topic. | 992 * Returns the chat room's topic. |
1015 * | 993 * |
1016 * @param chat The chat. | 994 * @param chat The chat. |
1017 * | 995 * |
1018 * @return The chat's topic. | 996 * @return The chat's topic. |
1019 */ | 997 */ |
1020 const char *gaim_chat_get_topic(const struct gaim_chat *chat); | 998 const char *gaim_chat_get_topic(const GaimChat *chat); |
1021 | 999 |
1022 /** | 1000 /** |
1023 * Sets the chat room's ID. | 1001 * Sets the chat room's ID. |
1024 * | 1002 * |
1025 * @param chat The chat. | 1003 * @param chat The chat. |
1026 * @param id The ID. | 1004 * @param id The ID. |
1027 */ | 1005 */ |
1028 void gaim_chat_set_id(struct gaim_chat *chat, int id); | 1006 void gaim_chat_set_id(GaimChat *chat, int id); |
1029 | 1007 |
1030 /** | 1008 /** |
1031 * Returns the chat room's ID. | 1009 * Returns the chat room's ID. |
1032 * | 1010 * |
1033 * @param chat The chat. | 1011 * @param chat The chat. |
1034 * | 1012 * |
1035 * @return The ID. | 1013 * @return The ID. |
1036 */ | 1014 */ |
1037 int gaim_chat_get_id(const struct gaim_chat *chat); | 1015 int gaim_chat_get_id(const GaimChat *chat); |
1038 | 1016 |
1039 /** | 1017 /** |
1040 * Writes to a chat. | 1018 * Writes to a chat. |
1041 * | 1019 * |
1042 * @param chat The chat. | 1020 * @param chat The chat. |
1043 * @param who The user who sent the message. | 1021 * @param who The user who sent the message. |
1044 * @param message The message to write. | 1022 * @param message The message to write. |
1045 * @param flag The flags. | 1023 * @param flag The flags. |
1046 * @param mtime The time the message was sent. | 1024 * @param mtime The time the message was sent. |
1047 */ | 1025 */ |
1048 void gaim_chat_write(struct gaim_chat *chat, const char *who, | 1026 void gaim_chat_write(GaimChat *chat, const char *who, |
1049 const char *message, int flag, time_t mtime); | 1027 const char *message, int flag, time_t mtime); |
1050 | 1028 |
1051 /** | 1029 /** |
1052 * Sends a message to this chat conversation. | 1030 * Sends a message to this chat conversation. |
1053 * | 1031 * |
1054 * @param chat The chat. | 1032 * @param chat The chat. |
1055 * @param message The message to send. | 1033 * @param message The message to send. |
1056 */ | 1034 */ |
1057 void gaim_chat_send(struct gaim_chat *chat, const char *message); | 1035 void gaim_chat_send(GaimChat *chat, const char *message); |
1058 | 1036 |
1059 /** | 1037 /** |
1060 * Adds a user to a chat. | 1038 * Adds a user to a chat. |
1061 * | 1039 * |
1062 * @param chat The chat. | 1040 * @param chat The chat. |
1063 * @param user The user to add. | 1041 * @param user The user to add. |
1064 * @param extra_msg An extra message to display with the join message. | 1042 * @param extra_msg An extra message to display with the join message. |
1065 */ | 1043 */ |
1066 void gaim_chat_add_user(struct gaim_chat *chat, const char *user, | 1044 void gaim_chat_add_user(GaimChat *chat, const char *user, |
1067 const char *extra_msg); | 1045 const char *extra_msg); |
1068 | 1046 |
1069 /** | 1047 /** |
1070 * Renames a user in a chat. | 1048 * Renames a user in a chat. |
1071 * | 1049 * |
1072 * @param chat The chat. | 1050 * @param chat The chat. |
1073 * @param old_user The old username. | 1051 * @param old_user The old username. |
1074 * @param new_user The new username. | 1052 * @param new_user The new username. |
1075 */ | 1053 */ |
1076 void gaim_chat_rename_user(struct gaim_chat *chat, const char *old_user, | 1054 void gaim_chat_rename_user(GaimChat *chat, const char *old_user, |
1077 const char *new_user); | 1055 const char *new_user); |
1078 | 1056 |
1079 /** | 1057 /** |
1080 * Removes a user from a chat, optionally with a reason. | 1058 * Removes a user from a chat, optionally with a reason. |
1081 * | 1059 * |
1082 * @param chat The chat. | 1060 * @param chat The chat. |
1083 * @param user The user that is being removed. | 1061 * @param user The user that is being removed. |
1084 * @param reason The optional reason given for the removal. Can be @c NULL. | 1062 * @param reason The optional reason given for the removal. Can be @c NULL. |
1085 */ | 1063 */ |
1086 void gaim_chat_remove_user(struct gaim_chat *chat, const char *user, | 1064 void gaim_chat_remove_user(GaimChat *chat, const char *user, |
1087 const char *reason); | 1065 const char *reason); |
1088 | 1066 |
1089 /** | 1067 /** |
1090 * Finds a chat with the specified chat ID. | 1068 * Finds a chat with the specified chat ID. |
1091 * | 1069 * |
1092 * @param gc The gaim_connection. | 1070 * @param gc The gaim_connection. |
1093 * @param id The chat ID. | 1071 * @param id The chat ID. |
1094 * | 1072 * |
1095 * @return The chat conversation. | 1073 * @return The chat conversation. |
1096 */ | 1074 */ |
1097 struct gaim_conversation *gaim_find_chat(GaimConnection *gc, int id); | 1075 GaimConversation *gaim_find_chat(const GaimConnection *gc, int id); |
1098 | 1076 |
1099 /*@}*/ | 1077 /*@}*/ |
1100 | 1078 |
1101 /**************************************************************************/ | 1079 /**************************************************************************/ |
1102 /** @name Conversation Placement Functions */ | 1080 /** @name Conversation Placement Functions */ |
1109 * @param name The name of the function. | 1087 * @param name The name of the function. |
1110 * @param fnc A pointer to the function. | 1088 * @param fnc A pointer to the function. |
1111 * | 1089 * |
1112 * @return The index of this entry. | 1090 * @return The index of this entry. |
1113 */ | 1091 */ |
1114 int gaim_conv_placement_add_fnc(const char *name, gaim_conv_placement_fnc fnc); | 1092 int gaim_conv_placement_add_fnc(const char *name, GaimConvPlacementFunc fnc); |
1115 | 1093 |
1116 /** | 1094 /** |
1117 * Removes a conversation placement function from the list of possible | 1095 * Removes a conversation placement function from the list of possible |
1118 * functions. | 1096 * functions. |
1119 * | 1097 * |
1145 * | 1123 * |
1146 * @param index The index. | 1124 * @param index The index. |
1147 * | 1125 * |
1148 * @return A pointer to the function. | 1126 * @return A pointer to the function. |
1149 */ | 1127 */ |
1150 gaim_conv_placement_fnc gaim_conv_placement_get_fnc(int index); | 1128 GaimConvPlacementFunc gaim_conv_placement_get_fnc(int index); |
1151 | 1129 |
1152 /** | 1130 /** |
1153 * Returns the index of the specified conversation placement function. | 1131 * Returns the index of the specified conversation placement function. |
1154 * | 1132 * |
1155 * @param fnc A pointer to the registered function. | 1133 * @param fnc A pointer to the registered function. |
1156 * | 1134 * |
1157 * @return The index of the conversation, or -1 if the function is not | 1135 * @return The index of the conversation, or -1 if the function is not |
1158 * registered. | 1136 * registered. |
1159 */ | 1137 */ |
1160 int gaim_conv_placement_get_fnc_index(gaim_conv_placement_fnc fnc); | 1138 int gaim_conv_placement_get_fnc_index(GaimConvPlacementFunc fnc); |
1161 | 1139 |
1162 /** | 1140 /** |
1163 * Returns the index of the active conversation placement function. | 1141 * Returns the index of the active conversation placement function. |
1164 * | 1142 * |
1165 * @param index The index of the active function. | 1143 * @param index The index of the active function. |
1184 * Sets the UI operations structure to be used in all gaim conversation | 1162 * Sets the UI operations structure to be used in all gaim conversation |
1185 * windows. | 1163 * windows. |
1186 * | 1164 * |
1187 * @param ops The UI operations structure. | 1165 * @param ops The UI operations structure. |
1188 */ | 1166 */ |
1189 void gaim_set_win_ui_ops(struct gaim_window_ui_ops *ops); | 1167 void gaim_set_win_ui_ops(GaimWindowUiOps *ops); |
1190 | 1168 |
1191 /** | 1169 /** |
1192 * Returns the gaim window UI operations structure to be used in | 1170 * Returns the gaim window UI operations structure to be used in |
1193 * new windows. | 1171 * new windows. |
1194 * | 1172 * |
1195 * @return A filled-out gaim_window_ui_ops structure. | 1173 * @return A filled-out GaimWindowUiOps structure. |
1196 */ | 1174 */ |
1197 struct gaim_window_ui_ops *gaim_get_win_ui_ops(void); | 1175 GaimWindowUiOps *gaim_get_win_ui_ops(void); |
1198 | 1176 |
1199 /*@}*/ | 1177 /*@}*/ |
1200 | 1178 |
1201 #endif /* _GAIM_CONVERSATION_H_ */ | 1179 #endif /* _GAIM_CONVERSATION_H_ */ |