Mercurial > pidgin.yaz
comparison libpurple/conversation.h @ 32827:4a34689eeb33 default tip
merged from im.pidgin.pidgin
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Sat, 19 Nov 2011 14:42:54 +0900 |
parents | 0f94ec89f0bc 3e7a7e14af62 |
children |
comparison
equal
deleted
inserted
replaced
32692:0f94ec89f0bc | 32827:4a34689eeb33 |
---|---|
247 void (*_purple_reserved2)(void); | 247 void (*_purple_reserved2)(void); |
248 void (*_purple_reserved3)(void); | 248 void (*_purple_reserved3)(void); |
249 void (*_purple_reserved4)(void); | 249 void (*_purple_reserved4)(void); |
250 }; | 250 }; |
251 | 251 |
252 /** | |
253 * Data specific to Instant Messages. | |
254 */ | |
255 struct _PurpleConvIm | |
256 { | |
257 PurpleConversation *conv; /**< The parent conversation. */ | |
258 | |
259 PurpleTypingState typing_state; /**< The current typing state. */ | |
260 guint typing_timeout; /**< The typing timer handle. */ | |
261 time_t type_again; /**< The type again time. */ | |
262 guint send_typed_timeout; /**< The type again timer handle. */ | |
263 | |
264 PurpleBuddyIcon *icon; /**< The buddy icon. */ | |
265 }; | |
266 | |
267 /** | |
268 * Data specific to Chats. | |
269 */ | |
270 struct _PurpleConvChat | |
271 { | |
272 PurpleConversation *conv; /**< The parent conversation. */ | |
273 | |
274 GList *in_room; /**< The users in the room. | |
275 * @deprecated Will be removed in 3.0.0 | |
276 */ | |
277 GList *ignored; /**< Ignored users. */ | |
278 char *who; /**< The person who set the topic. */ | |
279 char *topic; /**< The topic. */ | |
280 int id; /**< The chat ID. */ | |
281 char *nick; /**< Your nick in this chat. */ | |
282 | |
283 gboolean left; /**< We left the chat and kept the window open */ | |
284 GHashTable *users; /**< Hash table of the users in the room. */ | |
285 }; | |
286 | |
287 /** | |
288 * Data for "Chat Buddies" | |
289 */ | |
290 struct _PurpleConvChatBuddy | |
291 { | |
292 /** The chat participant's name in the chat. */ | |
293 char *name; | |
294 | |
295 /** The chat participant's alias, if known; @a NULL otherwise. */ | |
296 char *alias; | |
297 | |
298 /** | |
299 * A string by which this buddy will be sorted, or @c NULL if the | |
300 * buddy should be sorted by its @c name. (This is currently always | |
301 * @c NULL. | |
302 */ | |
303 char *alias_key; | |
304 | |
305 /** | |
306 * @a TRUE if this chat participant is on the buddy list; | |
307 * @a FALSE otherwise. | |
308 */ | |
309 gboolean buddy; | |
310 | |
311 /** | |
312 * A bitwise OR of flags for this participant, such as whether they | |
313 * are a channel operator. | |
314 */ | |
315 PurpleConvChatBuddyFlags flags; | |
316 | |
317 /** | |
318 * A hash table of attributes about the user, such as real name, | |
319 * user\@host, etc. | |
320 */ | |
321 GHashTable *attributes; | |
322 | |
323 /** The UI can put whatever it wants here. */ | |
324 gpointer ui_data; | |
325 }; | |
326 | |
327 /** | |
328 * Description of a conversation message | |
329 */ | |
330 struct _PurpleConvMessage | |
331 { | |
332 char *who; | |
333 char *what; | |
334 PurpleMessageFlags flags; | |
335 time_t when; | |
336 PurpleConversation *conv; | |
337 char *alias; | |
338 }; | |
339 | |
340 /** | |
341 * A core representation of a conversation between two or more people. | |
342 * | |
343 * The conversation can be an IM or a chat. | |
344 */ | |
345 struct _PurpleConversation | |
346 { | |
347 PurpleConversationType type; /**< The type of conversation. */ | |
348 | |
349 PurpleAccount *account; /**< The user using this conversation. */ | |
350 | |
351 | |
352 char *name; /**< The name of the conversation. */ | |
353 char *title; /**< The window title. */ | |
354 | |
355 gboolean logging; /**< The status of logging. */ | |
356 | |
357 GList *logs; /**< This conversation's logs */ | |
358 | |
359 union | |
360 { | |
361 PurpleConvIm *im; /**< IM-specific data. */ | |
362 PurpleConvChat *chat; /**< Chat-specific data. */ | |
363 void *misc; /**< Misc. data. */ | |
364 | |
365 } u; | |
366 | |
367 PurpleConversationUiOps *ui_ops; /**< UI-specific operations. */ | |
368 void *ui_data; /**< UI-specific data. */ | |
369 | |
370 GHashTable *data; /**< Plugin-specific data. */ | |
371 | |
372 PurpleConnectionFlags features; /**< The supported features */ | |
373 GList *message_history; /**< Message history, as a GList of PurpleConvMessage's */ | |
374 }; | |
375 | |
376 #ifdef __cplusplus | 252 #ifdef __cplusplus |
377 extern "C" { | 253 extern "C" { |
378 #endif | 254 #endif |
379 | 255 |
380 /**************************************************************************/ | 256 /**************************************************************************/ |
477 PurpleAccount *purple_conversation_get_account(const PurpleConversation *conv); | 353 PurpleAccount *purple_conversation_get_account(const PurpleConversation *conv); |
478 | 354 |
479 /** | 355 /** |
480 * Returns the specified conversation's purple_connection. | 356 * Returns the specified conversation's purple_connection. |
481 * | 357 * |
482 * This is the same as purple_conversation_get_user(conv)->gc. | |
483 * | |
484 * @param conv The conversation. | 358 * @param conv The conversation. |
485 * | 359 * |
486 * @return The conversation's purple_connection. | 360 * @return The conversation's purple_connection. |
487 */ | 361 */ |
488 PurpleConnection *purple_conversation_get_gc(const PurpleConversation *conv); | 362 PurpleConnection *purple_conversation_get_connection(const PurpleConversation *conv); |
489 | 363 |
490 /** | 364 /** |
491 * Sets the specified conversation's title. | 365 * Sets the specified conversation's title. |
492 * | 366 * |
493 * @param conv The conversation. | 367 * @param conv The conversation. |
769 * | 643 * |
770 * @param msg A PurpleConvMessage | 644 * @param msg A PurpleConvMessage |
771 * | 645 * |
772 * @return The name of the sender of the message | 646 * @return The name of the sender of the message |
773 */ | 647 */ |
774 const char *purple_conversation_message_get_sender(PurpleConvMessage *msg); | 648 const char *purple_conversation_message_get_sender(const PurpleConvMessage *msg); |
775 | 649 |
776 /** | 650 /** |
777 * Get the message from a PurpleConvMessage | 651 * Get the message from a PurpleConvMessage |
778 * | 652 * |
779 * @param msg A PurpleConvMessage | 653 * @param msg A PurpleConvMessage |
780 * | 654 * |
781 * @return The name of the sender of the message | 655 * @return The name of the sender of the message |
782 */ | 656 */ |
783 const char *purple_conversation_message_get_message(PurpleConvMessage *msg); | 657 const char *purple_conversation_message_get_message(const PurpleConvMessage *msg); |
784 | 658 |
785 /** | 659 /** |
786 * Get the message-flags of a PurpleConvMessage | 660 * Get the message-flags of a PurpleConvMessage |
787 * | 661 * |
788 * @param msg A PurpleConvMessage | 662 * @param msg A PurpleConvMessage |
789 * | 663 * |
790 * @return The message flags | 664 * @return The message flags |
791 */ | 665 */ |
792 PurpleMessageFlags purple_conversation_message_get_flags(PurpleConvMessage *msg); | 666 PurpleMessageFlags purple_conversation_message_get_flags(const PurpleConvMessage *msg); |
793 | 667 |
794 /** | 668 /** |
795 * Get the timestamp of a PurpleConvMessage | 669 * Get the timestamp of a PurpleConvMessage |
796 * | 670 * |
797 * @param msg A PurpleConvMessage | 671 * @param msg A PurpleConvMessage |
798 * | 672 * |
799 * @return The timestamp of the message | 673 * @return The timestamp of the message |
800 */ | 674 */ |
801 time_t purple_conversation_message_get_timestamp(PurpleConvMessage *msg); | 675 time_t purple_conversation_message_get_timestamp(const PurpleConvMessage *msg); |
676 | |
677 /** | |
678 * Get the alias from a PurpleConvMessage | |
679 * | |
680 * @param msg A PurpleConvMessage | |
681 * | |
682 * @return The alias of the sender of the message | |
683 */ | |
684 const char *purple_conversation_message_get_alias(const PurpleConvMessage *msg); | |
685 | |
686 /** | |
687 * Get the conversation associated with the PurpleConvMessage | |
688 * | |
689 * @param msg A PurpleConvMessage | |
690 * | |
691 * @return The conversation | |
692 */ | |
693 PurpleConversation *purple_conversation_message_get_conv(const PurpleConvMessage *msg); | |
802 | 694 |
803 /** | 695 /** |
804 * Set the UI data associated with this conversation. | 696 * Set the UI data associated with this conversation. |
805 * | 697 * |
806 * @param conv The conversation. | 698 * @param conv The conversation. |
1397 * @param name The name of the chat buddy to find. | 1289 * @param name The name of the chat buddy to find. |
1398 */ | 1290 */ |
1399 PurpleConvChatBuddy *purple_conv_chat_cb_find(PurpleConvChat *chat, const char *name); | 1291 PurpleConvChatBuddy *purple_conv_chat_cb_find(PurpleConvChat *chat, const char *name); |
1400 | 1292 |
1401 /** | 1293 /** |
1294 * Set the UI data associated with this chat buddy. | |
1295 * | |
1296 * @param cb The chat buddy | |
1297 * @param ui_data A pointer to associate with this chat buddy. | |
1298 */ | |
1299 void purple_conv_chat_cb_set_ui_data(PurpleConvChatBuddy *cb, gpointer ui_data); | |
1300 | |
1301 /** | |
1302 * Get the UI data associated with this chat buddy. | |
1303 * | |
1304 * @param cb The chat buddy. | |
1305 * | |
1306 * @return The UI data associated with this chat buddy. This is a | |
1307 * convenience field provided to the UIs--it is not | |
1308 * used by the libpurple core. | |
1309 */ | |
1310 gpointer purple_conv_chat_cb_get_ui_data(const PurpleConvChatBuddy *conv); | |
1311 | |
1312 /** | |
1313 * Get the alias of a chat buddy | |
1314 * | |
1315 * @param cb The chat buddy. | |
1316 * | |
1317 * @return The alias of the chat buddy. | |
1318 */ | |
1319 const char *purple_conv_chat_cb_get_alias(const PurpleConvChatBuddy *cb); | |
1320 | |
1321 /** | |
1402 * Get the name of a chat buddy | 1322 * Get the name of a chat buddy |
1403 * | 1323 * |
1404 * @param cb The chat buddy. | 1324 * @param cb The chat buddy. |
1405 * | 1325 * |
1406 * @return The name of the chat buddy. | 1326 * @return The name of the chat buddy. |
1407 */ | 1327 */ |
1408 const char *purple_conv_chat_cb_get_name(PurpleConvChatBuddy *cb); | 1328 const char *purple_conv_chat_cb_get_name(const PurpleConvChatBuddy *cb); |
1329 | |
1330 /** | |
1331 * Get the flags of a chat buddy. | |
1332 * | |
1333 * @param cb The chat buddy. | |
1334 * | |
1335 * @return The flags of the chat buddy. | |
1336 */ | |
1337 PurpleConvChatBuddyFlags purple_conv_chat_cb_get_flags(const PurpleConvChatBuddy *cb); | |
1338 | |
1339 /** | |
1340 * Indicates if this chat buddy is on the buddy list. | |
1341 * | |
1342 * @param cb The chat buddy. | |
1343 * | |
1344 * @return TRUE if the chat buddy is on the buddy list. | |
1345 */ | |
1346 gboolean purple_conv_chat_cb_is_buddy(const PurpleConvChatBuddy *cb); | |
1409 | 1347 |
1410 /** | 1348 /** |
1411 * Destroys a chat buddy | 1349 * Destroys a chat buddy |
1412 * | 1350 * |
1413 * @param cb The chat buddy to destroy | 1351 * @param cb The chat buddy to destroy |