| 121 /** |
121 /** |
| 122 * A core representation of a conversation between two or more people. |
122 * A core representation of a conversation between two or more people. |
| 123 * |
123 * |
| 124 * The conversation can be an IM or a chat. |
124 * The conversation can be an IM or a chat. |
| 125 * |
125 * |
| 126 * @note When a conversation is destroyed with the last g_object_unref(), the |
126 * Note: When a conversation is destroyed with the last g_object_unref(), the |
| 127 * specified conversation is removed from the parent window. If this |
127 * specified conversation is removed from the parent window. If this |
| 128 * conversation is the only one contained in the parent window, that |
128 * conversation is the only one contained in the parent window, that |
| 129 * window is also destroyed. |
129 * window is also destroyed. |
| 130 */ |
130 */ |
| 131 struct _PurpleConversation |
131 struct _PurpleConversation |
| 176 */ |
176 */ |
| 177 void (*create_conversation)(PurpleConversation *conv); |
177 void (*create_conversation)(PurpleConversation *conv); |
| 178 |
178 |
| 179 /** Called just before @a conv is freed. */ |
179 /** Called just before @a conv is freed. */ |
| 180 void (*destroy_conversation)(PurpleConversation *conv); |
180 void (*destroy_conversation)(PurpleConversation *conv); |
| 181 /** Write a message to a chat. If this field is @c NULL, libpurple will |
181 /** Write a message to a chat. If this field is %NULL, libpurple will |
| 182 * fall back to using #write_conv. |
182 * fall back to using #write_conv. |
| 183 * @see purple_chat_conversation_write() |
183 * @see purple_chat_conversation_write() |
| 184 */ |
184 */ |
| 185 void (*write_chat)(PurpleChatConversation *chat, const char *who, |
185 void (*write_chat)(PurpleChatConversation *chat, const char *who, |
| 186 const char *message, PurpleMessageFlags flags, |
186 const char *message, PurpleMessageFlags flags, |
| 187 time_t mtime); |
187 time_t mtime); |
| 188 /** Write a message to an IM conversation. If this field is @c NULL, |
188 /** Write a message to an IM conversation. If this field is %NULL, |
| 189 * libpurple will fall back to using #write_conv. |
189 * libpurple will fall back to using #write_conv. |
| 190 * @see purple_im_conversation_write() |
190 * @see purple_im_conversation_write() |
| 191 */ |
191 */ |
| 192 void (*write_im)(PurpleIMConversation *im, const char *who, |
192 void (*write_im)(PurpleIMConversation *im, const char *who, |
| 193 const char *message, PurpleMessageFlags flags, |
193 const char *message, PurpleMessageFlags flags, |
| 238 * the IM dialog. |
238 * the IM dialog. |
| 239 */ |
239 */ |
| 240 void (*present)(PurpleConversation *conv); |
240 void (*present)(PurpleConversation *conv); |
| 241 |
241 |
| 242 /** If this UI has a concept of focus (as in a windowing system) and |
242 /** If this UI has a concept of focus (as in a windowing system) and |
| 243 * this conversation has the focus, return @c TRUE; otherwise, return |
243 * this conversation has the focus, return %TRUE; otherwise, return |
| 244 * @c FALSE. |
244 * %FALSE. |
| 245 */ |
245 */ |
| 246 gboolean (*has_focus)(PurpleConversation *conv); |
246 gboolean (*has_focus)(PurpleConversation *conv); |
| 247 |
247 |
| 248 /* Custom Smileys */ |
248 /* Custom Smileys */ |
| 249 gboolean (*custom_smiley_add)(PurpleConversation *conv, const char *smile, |
249 gboolean (*custom_smiley_add)(PurpleConversation *conv, const char *smile, |
| 252 const guchar *data, gsize size); |
252 const guchar *data, gsize size); |
| 253 void (*custom_smiley_close)(PurpleConversation *conv, const char *smile); |
253 void (*custom_smiley_close)(PurpleConversation *conv, const char *smile); |
| 254 |
254 |
| 255 /** Prompt the user for confirmation to send @a message. This function |
255 /** Prompt the user for confirmation to send @a message. This function |
| 256 * should arrange for the message to be sent if the user accepts. If |
256 * should arrange for the message to be sent if the user accepts. If |
| 257 * this field is @c NULL, libpurple will fall back to using |
257 * this field is %NULL, libpurple will fall back to using |
| 258 * #purple_request_action(). |
258 * #purple_request_action(). |
| 259 */ |
259 */ |
| 260 void (*send_confirm)(PurpleConversation *conv, const char *message); |
260 void (*send_confirm)(PurpleConversation *conv, const char *message); |
| 261 |
261 |
| 262 /*< private >*/ |
262 /*< private >*/ |
| 403 |
403 |
| 404 /** |
404 /** |
| 405 * Enables or disables logging for this conversation. |
405 * Enables or disables logging for this conversation. |
| 406 * |
406 * |
| 407 * @conv: The conversation. |
407 * @conv: The conversation. |
| 408 * @log: @c TRUE if logging should be enabled, or @c FALSE otherwise. |
408 * @log: %TRUE if logging should be enabled, or %FALSE otherwise. |
| 409 */ |
409 */ |
| 410 void purple_conversation_set_logging(PurpleConversation *conv, gboolean log); |
410 void purple_conversation_set_logging(PurpleConversation *conv, gboolean log); |
| 411 |
411 |
| 412 /** |
412 /** |
| 413 * Returns whether or not logging is enabled for this conversation. |
413 * Returns whether or not logging is enabled for this conversation. |
| 414 * |
414 * |
| 415 * @conv: The conversation. |
415 * @conv: The conversation. |
| 416 * |
416 * |
| 417 * Returns: @c TRUE if logging is enabled, or @c FALSE otherwise. |
417 * Returns: %TRUE if logging is enabled, or %FALSE otherwise. |
| 418 */ |
418 */ |
| 419 gboolean purple_conversation_is_logging(const PurpleConversation *conv); |
419 gboolean purple_conversation_is_logging(const PurpleConversation *conv); |
| 420 |
420 |
| 421 /** |
421 /** |
| 422 * Closes any open logs for this conversation. |
422 * Closes any open logs for this conversation. |
| 504 /** |
504 /** |
| 505 * Determines if a conversation has focus |
505 * Determines if a conversation has focus |
| 506 * |
506 * |
| 507 * @conv: The conversation. |
507 * @conv: The conversation. |
| 508 * |
508 * |
| 509 * Returns: @c TRUE if the conversation has focus, @c FALSE if |
509 * Returns: %TRUE if the conversation has focus, %FALSE if |
| 510 * it does not or the UI does not have a concept of conversation focus |
510 * it does not or the UI does not have a concept of conversation focus |
| 511 */ |
511 */ |
| 512 gboolean purple_conversation_has_focus(PurpleConversation *conv); |
512 gboolean purple_conversation_has_focus(PurpleConversation *conv); |
| 513 |
513 |
| 514 /** |
514 /** |
| 570 */ |
570 */ |
| 571 void purple_conversation_send_confirm(PurpleConversation *conv, const char *message); |
571 void purple_conversation_send_confirm(PurpleConversation *conv, const char *message); |
| 572 |
572 |
| 573 /** |
573 /** |
| 574 * Adds a smiley to the conversation's smiley tree. If this returns |
574 * Adds a smiley to the conversation's smiley tree. If this returns |
| 575 * @c TRUE you should call purple_conversation_custom_smiley_write() one or more |
575 * %TRUE you should call purple_conversation_custom_smiley_write() one or more |
| 576 * times, and then purple_conversation_custom_smiley_close(). If this returns |
576 * times, and then purple_conversation_custom_smiley_close(). If this returns |
| 577 * @c FALSE, either the conv or smile were invalid, or the icon was |
577 * %FALSE, either the conv or smile were invalid, or the icon was |
| 578 * found in the cache. In either case, calling write or close would |
578 * found in the cache. In either case, calling write or close would |
| 579 * be an error. |
579 * be an error. |
| 580 * |
580 * |
| 581 * @conv: The conversation to associate the smiley with. |
581 * @conv: The conversation to associate the smiley with. |
| 582 * @smile: The text associated with the smiley |
582 * @smile: The text associated with the smiley |
| 583 * @cksum_type: The type of checksum. |
583 * @cksum_type: The type of checksum. |
| 584 * @chksum: The checksum, as a NUL terminated base64 string. |
584 * @chksum: The checksum, as a NUL terminated base64 string. |
| 585 * @remote: @c TRUE if the custom smiley is set by the remote user (buddy). |
585 * @remote: %TRUE if the custom smiley is set by the remote user (buddy). |
| 586 * Returns: @c TRUE if an icon is expected, else FALSE. Note that |
586 * Returns: %TRUE if an icon is expected, else FALSE. Note that |
| 587 * it is an error to never call purple_conversation_custom_smiley_close if |
587 * it is an error to never call purple_conversation_custom_smiley_close if |
| 588 * this function returns @c TRUE, but an error to call it if |
588 * this function returns %TRUE, but an error to call it if |
| 589 * @c FALSE is returned. |
589 * %FALSE is returned. |
| 590 */ |
590 */ |
| 591 |
591 |
| 592 gboolean purple_conversation_custom_smiley_add(PurpleConversation *conv, const char *smile, |
592 gboolean purple_conversation_custom_smiley_add(PurpleConversation *conv, const char *smile, |
| 593 const char *cksum_type, const char *chksum, |
593 const char *cksum_type, const char *chksum, |
| 594 gboolean remote); |
594 gboolean remote); |
| 632 /** |
632 /** |
| 633 * Perform a command in a conversation. Similar to @see purple_cmd_do_command |
633 * Perform a command in a conversation. Similar to @see purple_cmd_do_command |
| 634 * |
634 * |
| 635 * @conv: The conversation. |
635 * @conv: The conversation. |
| 636 * @cmdline: The entire command including the arguments. |
636 * @cmdline: The entire command including the arguments. |
| 637 * @markup: @c NULL, or the formatted command line. |
637 * @markup: %NULL, or the formatted command line. |
| 638 * @error: If the command failed errormsg is filled in with the appropriate error |
638 * @error: If the command failed errormsg is filled in with the appropriate error |
| 639 * message, if not @c NULL. It must be freed by the caller with g_free(). |
639 * message, if not %NULL. It must be freed by the caller with g_free(). |
| 640 * |
640 * |
| 641 * Returns: @c TRUE if the command was executed successfully, @c FALSE otherwise. |
641 * Returns: %TRUE if the command was executed successfully, %FALSE otherwise. |
| 642 */ |
642 */ |
| 643 gboolean purple_conversation_do_command(PurpleConversation *conv, |
643 gboolean purple_conversation_do_command(PurpleConversation *conv, |
| 644 const gchar *cmdline, const gchar *markup, gchar **error); |
644 const gchar *cmdline, const gchar *markup, gchar **error); |
| 645 |
645 |
| 646 /** |
646 /** |