comparison src/conversation.h @ 7118:bf630f7dfdcd

[gaim-migrate @ 7685] Here's a commit that I think will make faceprint happy. GaimWindow -> GaimConvWindow, GaimIm -> GaimConvIm, GaimChat -> GaimConvChat, GaimBlistChat -> GaimChat, and updated the API functions as well. Plugin authors are going to hunt me down and murder me. I can feel it.. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 02 Oct 2003 02:54:07 +0000
parents feb3d21a7794
children b90c94620d1c
comparison
equal deleted inserted replaced
7117:943085b0ff8b 7118:bf630f7dfdcd
27 27
28 /**************************************************************************/ 28 /**************************************************************************/
29 /** Data Structures */ 29 /** Data Structures */
30 /**************************************************************************/ 30 /**************************************************************************/
31 31
32 typedef struct _GaimWindowUiOps GaimWindowUiOps; 32 typedef struct _GaimConvWindowUiOps GaimConvWindowUiOps;
33 typedef struct _GaimWindow GaimWindow; 33 typedef struct _GaimConvWindow GaimConvWindow;
34 typedef struct _GaimConversationUiOps GaimConversationUiOps; 34 typedef struct _GaimConversationUiOps GaimConversationUiOps;
35 typedef struct _GaimConversation GaimConversation; 35 typedef struct _GaimConversation GaimConversation;
36 typedef struct _GaimIm GaimIm; 36 typedef struct _GaimConvIm GaimConvIm;
37 typedef struct _GaimChat GaimChat; 37 typedef struct _GaimConvChat GaimConvChat;
38 38
39 /** 39 /**
40 * A type of conversation. 40 * A type of conversation.
41 */ 41 */
42 typedef enum 42 typedef enum
110 GAIM_MESSAGE_COLORIZE = 0x0010, /**< Colorize nicks. */ 110 GAIM_MESSAGE_COLORIZE = 0x0010, /**< Colorize nicks. */
111 GAIM_MESSAGE_NICK = 0x0020, /**< Contains your nick. */ 111 GAIM_MESSAGE_NICK = 0x0020, /**< Contains your nick. */
112 GAIM_MESSAGE_NO_LOG = 0x0040, /**< Do not log. */ 112 GAIM_MESSAGE_NO_LOG = 0x0040, /**< Do not log. */
113 GAIM_MESSAGE_WHISPER = 0x0080, /**< Whispered message. */ 113 GAIM_MESSAGE_WHISPER = 0x0080, /**< Whispered message. */
114 GAIM_MESSAGE_IMAGES = 0x0100 /**< Message contains images. */ 114 GAIM_MESSAGE_IMAGES = 0x0100 /**< Message contains images. */
115
115 } GaimMessageFlags; 116 } GaimMessageFlags;
116 117
117 #include "account.h" 118 #include "account.h"
118 #include "buddyicon.h" 119 #include "buddyicon.h"
119 #include "server.h" 120 #include "server.h"
120 121
121 /** 122 /**
122 * Conversation window operations. 123 * Conversation window operations.
123 * 124 *
124 * Any UI representing a window must assign a filled-out gaim_window_ops 125 * Any UI representing a window must assign a filled-out gaim_conv_window_ops
125 * structure to the GaimWindow. 126 * structure to the GaimConvWindow.
126 */ 127 */
127 struct _GaimWindowUiOps 128 struct _GaimConvWindowUiOps
128 { 129 {
129 GaimConversationUiOps *(*get_conversation_ui_ops)(void); 130 GaimConversationUiOps *(*get_conversation_ui_ops)(void);
130 131
131 void (*new_window)(GaimWindow *win); 132 void (*new_window)(GaimConvWindow *win);
132 void (*destroy_window)(GaimWindow *win); 133 void (*destroy_window)(GaimConvWindow *win);
133 134
134 void (*show)(GaimWindow *win); 135 void (*show)(GaimConvWindow *win);
135 void (*hide)(GaimWindow *win); 136 void (*hide)(GaimConvWindow *win);
136 void (*raise)(GaimWindow *win); 137 void (*raise)(GaimConvWindow *win);
137 void (*flash)(GaimWindow *win); 138 void (*flash)(GaimConvWindow *win);
138 139
139 void (*switch_conversation)(GaimWindow *win, unsigned int index); 140 void (*switch_conversation)(GaimConvWindow *win, unsigned int index);
140 void (*add_conversation)(GaimWindow *win, GaimConversation *conv); 141 void (*add_conversation)(GaimConvWindow *win, GaimConversation *conv);
141 void (*remove_conversation)(GaimWindow *win, GaimConversation *conv); 142 void (*remove_conversation)(GaimConvWindow *win, GaimConversation *conv);
142 void (*move_conversation)(GaimWindow *win, GaimConversation *conv, 143 void (*move_conversation)(GaimConvWindow *win, GaimConversation *conv,
143 unsigned int newIndex); 144 unsigned int newIndex);
144 int (*get_active_index)(const GaimWindow *win); 145 int (*get_active_index)(const GaimConvWindow *win);
145 }; 146 };
146 147
147 /** 148 /**
148 * Conversation operations and events. 149 * Conversation operations and events.
149 * 150 *
152 */ 153 */
153 struct _GaimConversationUiOps 154 struct _GaimConversationUiOps
154 { 155 {
155 void (*destroy_conversation)(GaimConversation *conv); 156 void (*destroy_conversation)(GaimConversation *conv);
156 void (*write_chat)(GaimConversation *conv, const char *who, 157 void (*write_chat)(GaimConversation *conv, const char *who,
157 const char *message, GaimMessageFlags flags, time_t mtime); 158 const char *message, GaimMessageFlags flags,
159 time_t mtime);
158 void (*write_im)(GaimConversation *conv, const char *who, 160 void (*write_im)(GaimConversation *conv, const char *who,
159 const char *message, GaimMessageFlags flags, time_t mtime); 161 const char *message, GaimMessageFlags flags,
162 time_t mtime);
160 void (*write_conv)(GaimConversation *conv, const char *who, 163 void (*write_conv)(GaimConversation *conv, const char *who,
161 const char *message, GaimMessageFlags flags, 164 const char *message, GaimMessageFlags flags,
162 time_t mtime); 165 time_t mtime);
163 166
164 void (*chat_add_user)(GaimConversation *conv, const char *user); 167 void (*chat_add_user)(GaimConversation *conv, const char *user);
177 180
178 /** 181 /**
179 * A core representation of a graphical window containing one or more 182 * A core representation of a graphical window containing one or more
180 * conversations. 183 * conversations.
181 */ 184 */
182 struct _GaimWindow 185 struct _GaimConvWindow
183 { 186 {
184 GList *conversations; /**< The conversations in the window. */ 187 GList *conversations; /**< The conversations in the window. */
185 size_t conversation_count; /**< The number of conversations. */ 188 size_t conversation_count; /**< The number of conversations. */
186 189
187 GaimWindowUiOps *ui_ops; /**< UI-specific window operations. */ 190 GaimConvWindowUiOps *ui_ops; /**< UI-specific window operations. */
188 void *ui_data; /**< UI-specific data. */ 191 void *ui_data; /**< UI-specific data. */
189 }; 192 };
190 193
191 /** 194 /**
192 * Data specific to Instant Messages. 195 * Data specific to Instant Messages.
193 */ 196 */
194 struct _GaimIm 197 struct _GaimConvIm
195 { 198 {
196 GaimConversation *conv; /**< The parent conversation. */ 199 GaimConversation *conv; /**< The parent conversation. */
197 200
198 GaimTypingState typing_state; /**< The current typing state. */ 201 GaimTypingState typing_state; /**< The current typing state. */
199 guint typing_timeout; /**< The typing timer handle. */ 202 guint typing_timeout; /**< The typing timer handle. */
206 }; 209 };
207 210
208 /** 211 /**
209 * Data specific to Chats. 212 * Data specific to Chats.
210 */ 213 */
211 struct _GaimChat 214 struct _GaimConvChat
212 { 215 {
213 GaimConversation *conv; /**< The parent conversation. */ 216 GaimConversation *conv; /**< The parent conversation. */
214 217
215 GList *in_room; /**< The users in the room. */ 218 GList *in_room; /**< The users in the room. */
216 GList *ignored; /**< Ignored users. */ 219 GList *ignored; /**< Ignored users. */
221 224
222 /** 225 /**
223 * A core representation of a conversation between two or more people. 226 * A core representation of a conversation between two or more people.
224 * 227 *
225 * The conversation can be an IM or a chat. Each conversation is kept 228 * The conversation can be an IM or a chat. Each conversation is kept
226 * in a GaimWindow and has a UI representation. 229 * in a GaimConvWindow and has a UI representation.
227 */ 230 */
228 struct _GaimConversation 231 struct _GaimConversation
229 { 232 {
230 GaimConversationType type; /**< The type of conversation. */ 233 GaimConversationType type; /**< The type of conversation. */
231 234
232 GaimAccount *account; /**< The user using this conversation. */ 235 GaimAccount *account; /**< The user using this conversation. */
233 GaimWindow *window; /**< The parent window. */ 236 GaimConvWindow *window; /**< The parent window. */
234 237
235 int conversation_pos; /**< The position in the window's list. */ 238 int conversation_pos; /**< The position in the window's list. */
236 239
237 char *name; /**< The name of the conversation. */ 240 char *name; /**< The name of the conversation. */
238 char *title; /**< The window title. */ 241 char *title; /**< The window title. */
244 247
245 GaimUnseenState unseen; /**< The unseen tab state. */ 248 GaimUnseenState unseen; /**< The unseen tab state. */
246 249
247 union 250 union
248 { 251 {
249 GaimIm *im; /**< IM-specific data. */ 252 GaimConvIm *im; /**< IM-specific data. */
250 GaimChat *chat; /**< Chat-specific data. */ 253 GaimConvChat *chat; /**< Chat-specific data. */
251 void *misc; /**< Misc. data. */ 254 void *misc; /**< Misc. data. */
252 255
253 } u; 256 } u;
254 257
255 GaimConversationUiOps *ui_ops; /**< UI-specific operations. */ 258 GaimConversationUiOps *ui_ops; /**< UI-specific operations. */
271 274
272 /** 275 /**
273 * Creates a new conversation window. 276 * Creates a new conversation window.
274 * 277 *
275 * This window is added to the list of windows, but is not shown until 278 * This window is added to the list of windows, but is not shown until
276 * gaim_window_show() is called. 279 * gaim_conv_window_show() is called.
277 * 280 *
278 * @return The new conversation window. 281 * @return The new conversation window.
279 */ 282 */
280 GaimWindow *gaim_window_new(void); 283 GaimConvWindow *gaim_conv_window_new(void);
281 284
282 /** 285 /**
283 * Destroys the specified conversation window and all conversations in it. 286 * Destroys the specified conversation window and all conversations in it.
284 * 287 *
285 * @param win The window to destroy. 288 * @param win The window to destroy.
286 */ 289 */
287 void gaim_window_destroy(GaimWindow *win); 290 void gaim_conv_window_destroy(GaimConvWindow *win);
288 291
289 /** 292 /**
290 * Shows the specified conversation window. 293 * Shows the specified conversation window.
291 * 294 *
292 * @param win The window. 295 * @param win The window.
293 */ 296 */
294 void gaim_window_show(GaimWindow *win); 297 void gaim_conv_window_show(GaimConvWindow *win);
295 298
296 /** 299 /**
297 * Hides the specified conversation window. 300 * Hides the specified conversation window.
298 * 301 *
299 * @param win The window. 302 * @param win The window.
300 */ 303 */
301 void gaim_window_hide(GaimWindow *win); 304 void gaim_conv_window_hide(GaimConvWindow *win);
302 305
303 /** 306 /**
304 * Raises the specified conversation window. 307 * Raises the specified conversation window.
305 * 308 *
306 * @param win The window. 309 * @param win The window.
307 */ 310 */
308 void gaim_window_raise(GaimWindow *win); 311 void gaim_conv_window_raise(GaimConvWindow *win);
309 312
310 /** 313 /**
311 * Causes the window to flash for IM notification, if the UI supports this. 314 * Causes the window to flash for IM notification, if the UI supports this.
312 * 315 *
313 * @param win The window. 316 * @param win The window.
314 */ 317 */
315 void gaim_window_flash(GaimWindow *win); 318 void gaim_conv_window_flash(GaimConvWindow *win);
316 319
317 /** 320 /**
318 * Sets the specified window's UI window operations structure. 321 * Sets the specified window's UI window operations structure.
319 * 322 *
320 * @param win The window. 323 * @param win The window.
321 * @param ops The UI window operations structure. 324 * @param ops The UI window operations structure.
322 */ 325 */
323 void gaim_window_set_ui_ops(GaimWindow *win, GaimWindowUiOps *ops); 326 void gaim_conv_window_set_ui_ops(GaimConvWindow *win,
327 GaimConvWindowUiOps *ops);
324 328
325 /** 329 /**
326 * Returns the specified window's UI window operations structure. 330 * Returns the specified window's UI window operations structure.
327 * 331 *
328 * @param win The window. 332 * @param win The window.
329 * 333 *
330 * @return The UI window operations structure. 334 * @return The UI window operations structure.
331 */ 335 */
332 GaimWindowUiOps *gaim_window_get_ui_ops(const GaimWindow *win); 336 GaimConvWindowUiOps *gaim_conv_window_get_ui_ops(const GaimConvWindow *win);
333 337
334 /** 338 /**
335 * Adds a conversation to this window. 339 * Adds a conversation to this window.
336 * 340 *
337 * If the conversation already has a parent window, this will do nothing. 341 * If the conversation already has a parent window, this will do nothing.
339 * @param win The window. 343 * @param win The window.
340 * @param conv The conversation. 344 * @param conv The conversation.
341 * 345 *
342 * @return The new index of the conversation in the window. 346 * @return The new index of the conversation in the window.
343 */ 347 */
344 int gaim_window_add_conversation(GaimWindow *win, GaimConversation *conv); 348 int gaim_conv_window_add_conversation(GaimConvWindow *win,
349 GaimConversation *conv);
345 350
346 /** 351 /**
347 * Removes the conversation at the specified index from the window. 352 * Removes the conversation at the specified index from the window.
348 * 353 *
349 * If there is no conversation at this index, this will do nothing. 354 * If there is no conversation at this index, this will do nothing.
351 * @param win The window. 356 * @param win The window.
352 * @param index The index of the conversation. 357 * @param index The index of the conversation.
353 * 358 *
354 * @return The conversation removed. 359 * @return The conversation removed.
355 */ 360 */
356 GaimConversation *gaim_window_remove_conversation(GaimWindow *win, 361 GaimConversation *gaim_conv_window_remove_conversation(GaimConvWindow *win,
357 unsigned int index); 362 unsigned int index);
358 363
359 /** 364 /**
360 * Moves the conversation at the specified index in a window to a new index. 365 * Moves the conversation at the specified index in a window to a new index.
361 * 366 *
362 * @param win The window. 367 * @param win The window.
363 * @param index The index of the conversation to move. 368 * @param index The index of the conversation to move.
364 * @param new_index The new index. 369 * @param new_index The new index.
365 */ 370 */
366 void gaim_window_move_conversation(GaimWindow *win, unsigned int index, 371 void gaim_conv_window_move_conversation(GaimConvWindow *win,
367 unsigned int new_index); 372 unsigned int index,
373 unsigned int new_index);
368 374
369 /** 375 /**
370 * Returns the conversation in the window at the specified index. 376 * Returns the conversation in the window at the specified index.
371 * 377 *
372 * If the index is out of range, this returns @c NULL. 378 * If the index is out of range, this returns @c NULL.
374 * @param win The window. 380 * @param win The window.
375 * @param index The index containing a conversation. 381 * @param index The index containing a conversation.
376 * 382 *
377 * @return The conversation at the specified index. 383 * @return The conversation at the specified index.
378 */ 384 */
379 GaimConversation *gaim_window_get_conversation_at(const GaimWindow *win, 385 GaimConversation *gaim_conv_window_get_conversation_at(
380 unsigned int index); 386 const GaimConvWindow *win, unsigned int index);
381 387
382 /** 388 /**
383 * Returns the number of conversations in the window. 389 * Returns the number of conversations in the window.
384 * 390 *
385 * @param win The window. 391 * @param win The window.
386 * 392 *
387 * @return The number of conversations. 393 * @return The number of conversations.
388 */ 394 */
389 size_t gaim_window_get_conversation_count(const GaimWindow *win); 395 size_t gaim_conv_window_get_conversation_count(const GaimConvWindow *win);
390 396
391 /** 397 /**
392 * Switches the active conversation to the one at the specified index. 398 * Switches the active conversation to the one at the specified index.
393 * 399 *
394 * If @a index is out of range, this does nothing. 400 * If @a index is out of range, this does nothing.
395 * 401 *
396 * @param win The window. 402 * @param win The window.
397 * @param index The new index. 403 * @param index The new index.
398 */ 404 */
399 void gaim_window_switch_conversation(GaimWindow *win, unsigned int index); 405 void gaim_conv_window_switch_conversation(GaimConvWindow *win,
406 unsigned int index);
400 407
401 /** 408 /**
402 * Returns the active conversation in the window. 409 * Returns the active conversation in the window.
403 * 410 *
404 * @param win The window. 411 * @param win The window.
405 * 412 *
406 * @return The active conversation. 413 * @return The active conversation.
407 */ 414 */
408 GaimConversation *gaim_window_get_active_conversation(const GaimWindow *win); 415 GaimConversation *gaim_conv_window_get_active_conversation(
416 const GaimConvWindow *win);
409 417
410 /** 418 /**
411 * Returns the list of conversations in the specified window. 419 * Returns the list of conversations in the specified window.
412 * 420 *
413 * @param win The window. 421 * @param win The window.
414 * 422 *
415 * @return The list of conversations. 423 * @return The list of conversations.
416 */ 424 */
417 GList *gaim_window_get_conversations(const GaimWindow *win); 425 GList *gaim_conv_window_get_conversations(const GaimConvWindow *win);
418 426
419 /** 427 /**
420 * Returns a list of all windows. 428 * Returns a list of all windows.
421 * 429 *
422 * @return A list of windows. 430 * @return A list of windows.
428 * 436 *
429 * @param type The conversation type. 437 * @param type The conversation type.
430 * 438 *
431 * @return The window if found, or @c NULL if not found. 439 * @return The window if found, or @c NULL if not found.
432 */ 440 */
433 GaimWindow *gaim_get_first_window_with_type(GaimConversationType type); 441 GaimConvWindow *gaim_get_first_window_with_type(GaimConversationType type);
434 442
435 /** 443 /**
436 * Returns the last window containing a conversation of the specified type. 444 * Returns the last window containing a conversation of the specified type.
437 * 445 *
438 * @param type The conversation type. 446 * @param type The conversation type.
439 * 447 *
440 * @return The window if found, or @c NULL if not found. 448 * @return The window if found, or @c NULL if not found.
441 */ 449 */
442 GaimWindow *gaim_get_last_window_with_type(GaimConversationType type); 450 GaimConvWindow *gaim_get_last_window_with_type(GaimConversationType type);
443 451
444 /*@}*/ 452 /*@}*/
445 453
446 /**************************************************************************/ 454 /**************************************************************************/
447 /** @name Conversation API */ 455 /** @name Conversation API */
647 * 655 *
648 * @param conv The conversation. 656 * @param conv The conversation.
649 * 657 *
650 * @return The conversation's parent window. 658 * @return The conversation's parent window.
651 */ 659 */
652 GaimWindow *gaim_conversation_get_window(const GaimConversation *conv); 660 GaimConvWindow *gaim_conversation_get_window(const GaimConversation *conv);
653 661
654 /** 662 /**
655 * Returns the specified conversation's IM-specific data. 663 * Returns the specified conversation's IM-specific data.
656 * 664 *
657 * If the conversation type is not GAIM_CONV_IM, this will return @c NULL. 665 * If the conversation type is not GAIM_CONV_IM, this will return @c NULL.
658 * 666 *
659 * @param conv The conversation. 667 * @param conv The conversation.
660 * 668 *
661 * @return The IM-specific data. 669 * @return The IM-specific data.
662 */ 670 */
663 GaimIm *gaim_conversation_get_im_data(const GaimConversation *conv); 671 GaimConvIm *gaim_conversation_get_im_data(const GaimConversation *conv);
664 672
665 #define GAIM_IM(c) (gaim_conversation_get_im_data(c)) 673 #define GAIM_CONV_IM(c) (gaim_conversation_get_im_data(c))
666 674
667 /** 675 /**
668 * Returns the specified conversation's chat-specific data. 676 * Returns the specified conversation's chat-specific data.
669 * 677 *
670 * If the conversation type is not GAIM_CONV_CHAT, this will return @c NULL. 678 * If the conversation type is not GAIM_CONV_CHAT, this will return @c NULL.
671 * 679 *
672 * @param conv The conversation. 680 * @param conv The conversation.
673 * 681 *
674 * @return The chat-specific data. 682 * @return The chat-specific data.
675 */ 683 */
676 GaimChat *gaim_conversation_get_chat_data(const GaimConversation *conv); 684 GaimConvChat *gaim_conversation_get_chat_data(const GaimConversation *conv);
677 685
678 #define GAIM_CHAT(c) (gaim_conversation_get_chat_data(c)) 686 #define GAIM_CONV_CHAT(c) (gaim_conversation_get_chat_data(c))
679 687
680 /** 688 /**
681 * Sets extra data for a conversation. 689 * Sets extra data for a conversation.
682 * 690 *
683 * @param conv The conversation. 691 * @param conv The conversation.
742 750
743 /** 751 /**
744 * Writes to a conversation window. 752 * Writes to a conversation window.
745 * 753 *
746 * This function should not be used to write IM or chat messages. Use 754 * This function should not be used to write IM or chat messages. Use
747 * gaim_im_write() and gaim_chat_write() instead. Those functions will 755 * gaim_conv_im_write() and gaim_conv_chat_write() instead. Those functions will
748 * most likely call this anyway, but they may do their own formatting, 756 * most likely call this anyway, but they may do their own formatting,
749 * sound playback, etc. 757 * sound playback, etc.
750 * 758 *
751 * This can be used to write generic messages, such as "so and so closed 759 * This can be used to write generic messages, such as "so and so closed
752 * the conversation window." 760 * the conversation window."
755 * @param who The user who sent the message. 763 * @param who The user who sent the message.
756 * @param message The message. 764 * @param message The message.
757 * @param flags The message flags. 765 * @param flags The message flags.
758 * @param mtime The time the message was sent. 766 * @param mtime The time the message was sent.
759 * 767 *
760 * @see gaim_im_write() 768 * @see gaim_conv_im_write()
761 * @see gaim_chat_write() 769 * @see gaim_conv_chat_write()
762 */ 770 */
763 void gaim_conversation_write(GaimConversation *conv, const char *who, 771 void gaim_conversation_write(GaimConversation *conv, const char *who,
764 const char *message, GaimMessageFlags flags, 772 const char *message, GaimMessageFlags flags,
765 time_t mtime); 773 time_t mtime);
766 774
803 * 811 *
804 * @param im The IM. 812 * @param im The IM.
805 * 813 *
806 * @return The parent conversation. 814 * @return The parent conversation.
807 */ 815 */
808 GaimConversation *gaim_im_get_conversation(const GaimIm *im); 816 GaimConversation *gaim_conv_im_get_conversation(const GaimConvIm *im);
809 817
810 /** 818 /**
811 * Sets the IM's buddy icon. 819 * Sets the IM's buddy icon.
812 * 820 *
813 * This should only be called from within Gaim. You probably want to 821 * This should only be called from within Gaim. You probably want to
816 * @param im The IM. 824 * @param im The IM.
817 * @param icon The buddy icon. 825 * @param icon The buddy icon.
818 * 826 *
819 * @see gaim_buddy_icon_set_data() 827 * @see gaim_buddy_icon_set_data()
820 */ 828 */
821 void gaim_im_set_icon(GaimIm *im, GaimBuddyIcon *icon); 829 void gaim_conv_im_set_icon(GaimConvIm *im, GaimBuddyIcon *icon);
822 830
823 /** 831 /**
824 * Returns the IM's buddy icon. 832 * Returns the IM's buddy icon.
825 * 833 *
826 * @param im The IM. 834 * @param im The IM.
827 * 835 *
828 * @return The buddy icon. 836 * @return The buddy icon.
829 */ 837 */
830 GaimBuddyIcon *gaim_im_get_icon(const GaimIm *im); 838 GaimBuddyIcon *gaim_conv_im_get_icon(const GaimConvIm *im);
831 839
832 /** 840 /**
833 * Sets the IM's typing state. 841 * Sets the IM's typing state.
834 * 842 *
835 * @param im The IM. 843 * @param im The IM.
836 * @param state The typing state. 844 * @param state The typing state.
837 */ 845 */
838 void gaim_im_set_typing_state(GaimIm *im, int state); 846 void gaim_conv_im_set_typing_state(GaimConvIm *im, int state);
839 847
840 /** 848 /**
841 * Returns the IM's typing state. 849 * Returns the IM's typing state.
842 * 850 *
843 * @param im The IM. 851 * @param im The IM.
844 * 852 *
845 * @return The IM's typing state. 853 * @return The IM's typing state.
846 */ 854 */
847 int gaim_im_get_typing_state(const GaimIm *im); 855 int gaim_conv_im_get_typing_state(const GaimConvIm *im);
848 856
849 /** 857 /**
850 * Starts the IM's typing timeout. 858 * Starts the IM's typing timeout.
851 * 859 *
852 * @param im The IM. 860 * @param im The IM.
853 * @param timeout The timeout. 861 * @param timeout The timeout.
854 */ 862 */
855 void gaim_im_start_typing_timeout(GaimIm *im, int timeout); 863 void gaim_conv_im_start_typing_timeout(GaimConvIm *im, int timeout);
856 864
857 /** 865 /**
858 * Stops the IM's typing timeout. 866 * Stops the IM's typing timeout.
859 * 867 *
860 * @param im The IM. 868 * @param im The IM.
861 */ 869 */
862 void gaim_im_stop_typing_timeout(GaimIm *im); 870 void gaim_conv_im_stop_typing_timeout(GaimConvIm *im);
863 871
864 /** 872 /**
865 * Returns the IM's typing timeout. 873 * Returns the IM's typing timeout.
866 * 874 *
867 * @param im The IM. 875 * @param im The IM.
868 * 876 *
869 * @return The timeout. 877 * @return The timeout.
870 */ 878 */
871 guint gaim_im_get_typing_timeout(const GaimIm *im); 879 guint gaim_conv_im_get_typing_timeout(const GaimConvIm *im);
872 880
873 /** 881 /**
874 * Sets the IM's time until it should send another typing notification. 882 * Sets the IM's time until it should send another typing notification.
875 * 883 *
876 * @param im The IM. 884 * @param im The IM.
877 * @param val The time. 885 * @param val The time.
878 */ 886 */
879 void gaim_im_set_type_again(GaimIm *im, time_t val); 887 void gaim_conv_im_set_type_again(GaimConvIm *im, time_t val);
880 888
881 /** 889 /**
882 * Returns the IM's time until it should send another typing notification. 890 * Returns the IM's time until it should send another typing notification.
883 * 891 *
884 * @param im The IM. 892 * @param im The IM.
885 * 893 *
886 * @return The time. 894 * @return The time.
887 */ 895 */
888 time_t gaim_im_get_type_again(const GaimIm *im); 896 time_t gaim_conv_im_get_type_again(const GaimConvIm *im);
889 897
890 /** 898 /**
891 * Starts the IM's type again timeout. 899 * Starts the IM's type again timeout.
892 * 900 *
893 * @param im The IM. 901 * @param im The IM.
894 */ 902 */
895 void gaim_im_start_type_again_timeout(GaimIm *im); 903 void gaim_conv_im_start_type_again_timeout(GaimConvIm *im);
896 904
897 /** 905 /**
898 * Stops the IM's type again timeout. 906 * Stops the IM's type again timeout.
899 * 907 *
900 * @param im The IM. 908 * @param im The IM.
901 */ 909 */
902 void gaim_im_stop_type_again_timeout(GaimIm *im); 910 void gaim_conv_im_stop_type_again_timeout(GaimConvIm *im);
903 911
904 /** 912 /**
905 * Returns the IM's type again timeout interval. 913 * Returns the IM's type again timeout interval.
906 * 914 *
907 * @param im The IM. 915 * @param im The IM.
908 * 916 *
909 * @return The type again timeout interval. 917 * @return The type again timeout interval.
910 */ 918 */
911 guint gaim_im_get_type_again_timeout(const GaimIm *im); 919 guint gaim_conv_im_get_type_again_timeout(const GaimConvIm *im);
912 920
913 /** 921 /**
914 * Updates the visual typing notification for an IM conversation. 922 * Updates the visual typing notification for an IM conversation.
915 * 923 *
916 * @param im The IM. 924 * @param im The IM.
917 */ 925 */
918 void gaim_im_update_typing(GaimIm *im); 926 void gaim_conv_im_update_typing(GaimConvIm *im);
919 927
920 /** 928 /**
921 * Writes to an IM. 929 * Writes to an IM.
922 * 930 *
923 * @param im The IM. 931 * @param im The IM.
924 * @param who The user who sent the message. 932 * @param who The user who sent the message.
925 * @param message The message to write. 933 * @param message The message to write.
926 * @param flags The message flags. 934 * @param flags The message flags.
927 * @param mtime The time the message was sent. 935 * @param mtime The time the message was sent.
928 */ 936 */
929 void gaim_im_write(GaimIm *im, const char *who, 937 void gaim_conv_im_write(GaimConvIm *im, const char *who,
930 const char *message, GaimMessageFlags flags, time_t mtime); 938 const char *message, GaimMessageFlags flags,
939 time_t mtime);
931 940
932 /** 941 /**
933 * Sends a message to this IM conversation. 942 * Sends a message to this IM conversation.
934 * 943 *
935 * @param im The IM. 944 * @param im The IM.
936 * @param message The message to send. 945 * @param message The message to send.
937 */ 946 */
938 void gaim_im_send(GaimIm *im, const char *message); 947 void gaim_conv_im_send(GaimConvIm *im, const char *message);
939 948
940 /*@}*/ 949 /*@}*/
941 950
942 951
943 /**************************************************************************/ 952 /**************************************************************************/
950 * 959 *
951 * @param chat The chat. 960 * @param chat The chat.
952 * 961 *
953 * @return The parent conversation. 962 * @return The parent conversation.
954 */ 963 */
955 GaimConversation *gaim_chat_get_conversation(const GaimChat *chat); 964 GaimConversation *gaim_conv_chat_get_conversation(const GaimConvChat *chat);
956 965
957 /** 966 /**
958 * Sets the list of users in the chat room. 967 * Sets the list of users in the chat room.
959 * 968 *
960 * @note Calling this function will not update the display of the users. 969 * @note Calling this function will not update the display of the users.
961 * Please use gaim_chat_add_user(), gaim_chat_add_users(), 970 * Please use gaim_conv_chat_add_user(), gaim_conv_chat_add_users(),
962 * gaim_chat_remove_user(), and gaim_chat_remove_users() instead. 971 * gaim_conv_chat_remove_user(), and gaim_conv_chat_remove_users() instead.
963 * 972 *
964 * @param chat The chat. 973 * @param chat The chat.
965 * @param users The list of users. 974 * @param users The list of users.
966 * 975 *
967 * @return The list passed. 976 * @return The list passed.
968 */ 977 */
969 GList *gaim_chat_set_users(GaimChat *chat, GList *users); 978 GList *gaim_conv_chat_set_users(GaimConvChat *chat, GList *users);
970 979
971 /** 980 /**
972 * Returns a list of users in the chat room. 981 * Returns a list of users in the chat room.
973 * 982 *
974 * @param chat The chat. 983 * @param chat The chat.
975 * 984 *
976 * @return The list of users. 985 * @return The list of users.
977 */ 986 */
978 GList *gaim_chat_get_users(const GaimChat *chat); 987 GList *gaim_conv_chat_get_users(const GaimConvChat *chat);
979 988
980 /** 989 /**
981 * Ignores a user in a chat room. 990 * Ignores a user in a chat room.
982 * 991 *
983 * @param chat The chat. 992 * @param chat The chat.
984 * @param name The name of the user. 993 * @param name The name of the user.
985 */ 994 */
986 void gaim_chat_ignore(GaimChat *chat, const char *name); 995 void gaim_conv_chat_ignore(GaimConvChat *chat, const char *name);
987 996
988 /** 997 /**
989 * Unignores a user in a chat room. 998 * Unignores a user in a chat room.
990 * 999 *
991 * @param chat The chat. 1000 * @param chat The chat.
992 * @param name The name of the user. 1001 * @param name The name of the user.
993 */ 1002 */
994 void gaim_chat_unignore(GaimChat *chat, const char *name); 1003 void gaim_conv_chat_unignore(GaimConvChat *chat, const char *name);
995 1004
996 /** 1005 /**
997 * Sets the list of ignored users in the chat room. 1006 * Sets the list of ignored users in the chat room.
998 * 1007 *
999 * @param chat The chat. 1008 * @param chat The chat.
1000 * @param ignored The list of ignored users. 1009 * @param ignored The list of ignored users.
1001 * 1010 *
1002 * @return The list passed. 1011 * @return The list passed.
1003 */ 1012 */
1004 GList *gaim_chat_set_ignored(GaimChat *chat, GList *ignored); 1013 GList *gaim_conv_chat_set_ignored(GaimConvChat *chat, GList *ignored);
1005 1014
1006 /** 1015 /**
1007 * Returns the list of ignored users in the chat room. 1016 * Returns the list of ignored users in the chat room.
1008 * 1017 *
1009 * @param chat The chat. 1018 * @param chat The chat.
1010 * 1019 *
1011 * @return The list of ignored users. 1020 * @return The list of ignored users.
1012 */ 1021 */
1013 GList *gaim_chat_get_ignored(const GaimChat *chat); 1022 GList *gaim_conv_chat_get_ignored(const GaimConvChat *chat);
1014 1023
1015 /** 1024 /**
1016 * Returns the actual name of the specified ignored user, if it exists in 1025 * Returns the actual name of the specified ignored user, if it exists in
1017 * the ignore list. 1026 * the ignore list.
1018 * 1027 *
1024 * @param user The user to check in the ignore list. 1033 * @param user The user to check in the ignore list.
1025 * 1034 *
1026 * @return The ignored user if found, complete with prefixes, or @c NULL 1035 * @return The ignored user if found, complete with prefixes, or @c NULL
1027 * if not found. 1036 * if not found.
1028 */ 1037 */
1029 const char *gaim_chat_get_ignored_user(const GaimChat *chat, 1038 const char *gaim_conv_chat_get_ignored_user(const GaimConvChat *chat,
1030 const char *user); 1039 const char *user);
1031 1040
1032 /** 1041 /**
1033 * Returns @c TRUE if the specified user is ignored. 1042 * Returns @c TRUE if the specified user is ignored.
1034 * 1043 *
1035 * @param chat The chat. 1044 * @param chat The chat.
1036 * @param user The user. 1045 * @param user The user.
1037 * 1046 *
1038 * @return @c TRUE if the user is in the ignore list; @c FALSE otherwise. 1047 * @return @c TRUE if the user is in the ignore list; @c FALSE otherwise.
1039 */ 1048 */
1040 gboolean gaim_chat_is_user_ignored(const GaimChat *chat, 1049 gboolean gaim_conv_chat_is_user_ignored(const GaimConvChat *chat,
1041 const char *user); 1050 const char *user);
1042 1051
1043 /** 1052 /**
1044 * Sets the chat room's topic. 1053 * Sets the chat room's topic.
1045 * 1054 *
1046 * @param chat The chat. 1055 * @param chat The chat.
1047 * @param who The user that set the topic. 1056 * @param who The user that set the topic.
1048 * @param topic The topic. 1057 * @param topic The topic.
1049 */ 1058 */
1050 void gaim_chat_set_topic(GaimChat *chat, const char *who, 1059 void gaim_conv_chat_set_topic(GaimConvChat *chat, const char *who,
1051 const char *topic); 1060 const char *topic);
1052 1061
1053 /** 1062 /**
1054 * Returns the chat room's topic. 1063 * Returns the chat room's topic.
1055 * 1064 *
1056 * @param chat The chat. 1065 * @param chat The chat.
1057 * 1066 *
1058 * @return The chat's topic. 1067 * @return The chat's topic.
1059 */ 1068 */
1060 const char *gaim_chat_get_topic(const GaimChat *chat); 1069 const char *gaim_conv_chat_get_topic(const GaimConvChat *chat);
1061 1070
1062 /** 1071 /**
1063 * Sets the chat room's ID. 1072 * Sets the chat room's ID.
1064 * 1073 *
1065 * @param chat The chat. 1074 * @param chat The chat.
1066 * @param id The ID. 1075 * @param id The ID.
1067 */ 1076 */
1068 void gaim_chat_set_id(GaimChat *chat, int id); 1077 void gaim_conv_chat_set_id(GaimConvChat *chat, int id);
1069 1078
1070 /** 1079 /**
1071 * Returns the chat room's ID. 1080 * Returns the chat room's ID.
1072 * 1081 *
1073 * @param chat The chat. 1082 * @param chat The chat.
1074 * 1083 *
1075 * @return The ID. 1084 * @return The ID.
1076 */ 1085 */
1077 int gaim_chat_get_id(const GaimChat *chat); 1086 int gaim_conv_chat_get_id(const GaimConvChat *chat);
1078 1087
1079 /** 1088 /**
1080 * Writes to a chat. 1089 * Writes to a chat.
1081 * 1090 *
1082 * @param chat The chat. 1091 * @param chat The chat.
1083 * @param who The user who sent the message. 1092 * @param who The user who sent the message.
1084 * @param message The message to write. 1093 * @param message The message to write.
1085 * @param flags The flags. 1094 * @param flags The flags.
1086 * @param mtime The time the message was sent. 1095 * @param mtime The time the message was sent.
1087 */ 1096 */
1088 void gaim_chat_write(GaimChat *chat, const char *who, 1097 void gaim_conv_chat_write(GaimConvChat *chat, const char *who,
1089 const char *message, GaimMessageFlags flags, time_t mtime); 1098 const char *message, GaimMessageFlags flags,
1099 time_t mtime);
1090 1100
1091 /** 1101 /**
1092 * Sends a message to this chat conversation. 1102 * Sends a message to this chat conversation.
1093 * 1103 *
1094 * @param chat The chat. 1104 * @param chat The chat.
1095 * @param message The message to send. 1105 * @param message The message to send.
1096 */ 1106 */
1097 void gaim_chat_send(GaimChat *chat, const char *message); 1107 void gaim_conv_chat_send(GaimConvChat *chat, const char *message);
1098 1108
1099 /** 1109 /**
1100 * Adds a user to a chat. 1110 * Adds a user to a chat.
1101 * 1111 *
1102 * @param chat The chat. 1112 * @param chat The chat.
1103 * @param user The user to add. 1113 * @param user The user to add.
1104 * @param extra_msg An extra message to display with the join message. 1114 * @param extra_msg An extra message to display with the join message.
1105 */ 1115 */
1106 void gaim_chat_add_user(GaimChat *chat, const char *user, 1116 void gaim_conv_chat_add_user(GaimConvChat *chat, const char *user,
1107 const char *extra_msg); 1117 const char *extra_msg);
1108 1118
1109 /** 1119 /**
1110 * Adds a list of users to a chat. 1120 * Adds a list of users to a chat.
1111 * 1121 *
1112 * The data is copied from @a users, so it is up to the developer to 1122 * The data is copied from @a users, so it is up to the developer to
1113 * free this list after calling this function. 1123 * free this list after calling this function.
1114 * 1124 *
1115 * @param chat The chat. 1125 * @param chat The chat.
1116 * @param users The list of users to add. 1126 * @param users The list of users to add.
1117 */ 1127 */
1118 void gaim_chat_add_users(GaimChat *chat, GList *users); 1128 void gaim_conv_chat_add_users(GaimConvChat *chat, GList *users);
1119 1129
1120 /** 1130 /**
1121 * Renames a user in a chat. 1131 * Renames a user in a chat.
1122 * 1132 *
1123 * @param chat The chat. 1133 * @param chat The chat.
1124 * @param old_user The old username. 1134 * @param old_user The old username.
1125 * @param new_user The new username. 1135 * @param new_user The new username.
1126 */ 1136 */
1127 void gaim_chat_rename_user(GaimChat *chat, const char *old_user, 1137 void gaim_conv_chat_rename_user(GaimConvChat *chat, const char *old_user,
1128 const char *new_user); 1138 const char *new_user);
1129 1139
1130 /** 1140 /**
1131 * Removes a user from a chat, optionally with a reason. 1141 * Removes a user from a chat, optionally with a reason.
1132 * 1142 *
1133 * It is up to the developer to free this list after calling this function. 1143 * It is up to the developer to free this list after calling this function.
1134 * 1144 *
1135 * @param chat The chat. 1145 * @param chat The chat.
1136 * @param user The user that is being removed. 1146 * @param user The user that is being removed.
1137 * @param reason The optional reason given for the removal. Can be @c NULL. 1147 * @param reason The optional reason given for the removal. Can be @c NULL.
1138 */ 1148 */
1139 void gaim_chat_remove_user(GaimChat *chat, const char *user, 1149 void gaim_conv_chat_remove_user(GaimConvChat *chat, const char *user,
1140 const char *reason); 1150 const char *reason);
1141 1151
1142 /** 1152 /**
1143 * Removes a list of users from a chat, optionally with a single reason. 1153 * Removes a list of users from a chat, optionally with a single reason.
1144 * 1154 *
1145 * @param chat The chat. 1155 * @param chat The chat.
1146 * @param users The users that are being removed. 1156 * @param users The users that are being removed.
1147 * @param reason The optional reason given for the removal. Can be @c NULL. 1157 * @param reason The optional reason given for the removal. Can be @c NULL.
1148 */ 1158 */
1149 void gaim_chat_remove_users(GaimChat *chat, GList *users, const char *reason); 1159 void gaim_conv_chat_remove_users(GaimConvChat *chat, GList *users,
1160 const char *reason);
1150 1161
1151 /** 1162 /**
1152 * Clears all users from a chat. 1163 * Clears all users from a chat.
1153 * 1164 *
1154 * @param chat The chat. 1165 * @param chat The chat.
1155 */ 1166 */
1156 void gaim_chat_clear_users(GaimChat *chat); 1167 void gaim_conv_chat_clear_users(GaimConvChat *chat);
1157 1168
1158 /** 1169 /**
1159 * Finds a chat with the specified chat ID. 1170 * Finds a chat with the specified chat ID.
1160 * 1171 *
1161 * @param gc The gaim_connection. 1172 * @param gc The gaim_connection.
1239 * Sets the UI operations structure to be used in all gaim conversation 1250 * Sets the UI operations structure to be used in all gaim conversation
1240 * windows. 1251 * windows.
1241 * 1252 *
1242 * @param ops The UI operations structure. 1253 * @param ops The UI operations structure.
1243 */ 1254 */
1244 void gaim_conversations_set_win_ui_ops(GaimWindowUiOps *ops); 1255 void gaim_conversations_set_win_ui_ops(GaimConvWindowUiOps *ops);
1245 1256
1246 /** 1257 /**
1247 * Returns the gaim window UI operations structure to be used in 1258 * Returns the gaim window UI operations structure to be used in
1248 * new windows. 1259 * new windows.
1249 * 1260 *
1250 * @return A filled-out GaimWindowUiOps structure. 1261 * @return A filled-out GaimConvWindowUiOps structure.
1251 */ 1262 */
1252 GaimWindowUiOps *gaim_conversations_get_win_ui_ops(void); 1263 GaimConvWindowUiOps *gaim_conversations_get_win_ui_ops(void);
1253 1264
1254 /*@}*/ 1265 /*@}*/
1255 1266
1256 /**************************************************************************/ 1267 /**************************************************************************/
1257 /** @name Conversations Subsystem */ 1268 /** @name Conversations Subsystem */