conversation.h
Go to the documentation of this file.
1 
7 /* purple
8  *
9  * Purple is the legal property of its developers, whose names are too numerous
10  * to list here. Please refer to the COPYRIGHT file distributed with this
11  * source distribution.
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
26  */
27 #ifndef _PURPLE_CONVERSATION_H_
28 #define _PURPLE_CONVERSATION_H_
29 
30 /**************************************************************************/
32 /**************************************************************************/
33 
34 
40 typedef struct _PurpleConvIm PurpleConvIm;
47 
51 typedef enum
52 {
60 
64 typedef enum
65 {
76  /*
77  * XXX These need to go when we implement a more generic core/UI event
78  * system.
79  */
84  PURPLE_CONV_UPDATE_TITLE,
85  PURPLE_CONV_UPDATE_CHATLEFT,
86 
90 
94 typedef enum
95 {
101 
105 typedef enum
106 {
134 
138 typedef enum
139 {
143  PURPLE_CBFLAGS_OP = 0x0004,
149 
150 #include "account.h"
151 #include "buddyicon.h"
152 #include "log.h"
153 #include "server.h"
154 
162 {
167 
174  void (*write_chat)(PurpleConversation *conv, const char *who,
175  const char *message, PurpleMessageFlags flags,
176  time_t mtime);
181  void (*write_im)(PurpleConversation *conv, const char *who,
182  const char *message, PurpleMessageFlags flags,
183  time_t mtime);
193  const char *name,
194  const char *alias,
195  const char *message,
196  PurpleMessageFlags flags,
197  time_t mtime);
198 
206  GList *cbuddies,
207  gboolean new_arrivals);
213  void (*chat_rename_user)(PurpleConversation *conv, const char *old_name,
214  const char *new_name, const char *new_alias);
219  void (*chat_remove_users)(PurpleConversation *conv, GList *users);
223  void (*chat_update_user)(PurpleConversation *conv, const char *user);
224 
228  void (*present)(PurpleConversation *conv);
229 
234  gboolean (*has_focus)(PurpleConversation *conv);
235 
236  /* Custom Smileys */
237  gboolean (*custom_smiley_add)(PurpleConversation *conv, const char *smile, gboolean remote);
238  void (*custom_smiley_write)(PurpleConversation *conv, const char *smile,
239  const guchar *data, gsize size);
240  void (*custom_smiley_close)(PurpleConversation *conv, const char *smile);
241 
247  void (*send_confirm)(PurpleConversation *conv, const char *message);
248 
249  void (*_purple_reserved1)(void);
250  void (*_purple_reserved2)(void);
251  void (*_purple_reserved3)(void);
252  void (*_purple_reserved4)(void);
253 };
254 
259 {
264  time_t type_again;
268 };
269 
274 {
277  GList *in_room;
280  GList *ignored;
281  char *who;
282  char *topic;
283  int id;
284  char *nick;
286  gboolean left;
287  GHashTable *users;
290 };
291 
296 {
297  char *name;
298  char *alias;
301  char *alias_key;
306  gboolean buddy;
312  GHashTable *attributes;
315  gpointer ui_data;
316 };
317 
324 {
325  char *who;
326  char *what;
327  PurpleMessageFlags flags;
328  time_t when;
330  char *alias;
331 };
332 
339 {
345  char *name;
346  char *title;
348  gboolean logging;
350  GList *logs;
352  union
353  {
356  void *misc;
358  } u;
359 
361  void *ui_data;
363  GHashTable *data;
367 };
368 
369 #ifdef __cplusplus
370 extern "C" {
371 #endif
372 
373 /**************************************************************************/
375 /**************************************************************************/
390  PurpleAccount *account,
391  const char *name);
392 
403 
404 
411 
412 
421 
430 
437 
446  const PurpleConversation *conv);
447 
458  PurpleAccount *account);
459 
471 
482 
489 void purple_conversation_set_title(PurpleConversation *conv, const char *title);
490 
498 const char *purple_conversation_get_title(const PurpleConversation *conv);
499 
509 
516 void purple_conversation_set_name(PurpleConversation *conv, const char *name);
517 
526 const char *purple_conversation_get_name(const PurpleConversation *conv);
527 
536 const char *purple_conv_chat_cb_get_attribute(PurpleConvChatBuddy *cb, const char *key);
537 
546 
555 void purple_conv_chat_cb_set_attribute(PurpleConvChat *chat, PurpleConvChatBuddy *cb, const char *key, const char *value);
556 
565 void
566 purple_conv_chat_cb_set_attributes(PurpleConvChat *chat, PurpleConvChatBuddy *cb, GList *keys, GList *values);
567 
574 void purple_conversation_set_logging(PurpleConversation *conv, gboolean log);
575 
584 
595 
606 
607 #define PURPLE_CONV_IM(c) (purple_conversation_get_im_data(c))
608 
619 
620 #define PURPLE_CONV_CHAT(c) (purple_conversation_get_chat_data(c))
621 
629 void purple_conversation_set_data(PurpleConversation *conv, const char *key,
630  gpointer data);
631 
640 gpointer purple_conversation_get_data(PurpleConversation *conv, const char *key);
641 
649 GList *purple_get_conversations(void);
650 
656 GList *purple_get_ims(void);
657 
663 GList *purple_get_chats(void);
664 
675  PurpleConversationType type, const char *name,
676  const PurpleAccount *account);
677 
698 void purple_conversation_write(PurpleConversation *conv, const char *who,
699  const char *message, PurpleMessageFlags flags,
700  time_t mtime);
701 
708  PurpleConnectionFlags features);
709 
710 
716 
726 
734 
740 void purple_conversation_foreach(void (*func)(PurpleConversation *conv));
741 
754 
763 
774 
785 
796 
807 
811 /**************************************************************************/
813 /**************************************************************************/
824 
837 
846 
854 
863 
871 
878 
887 
898 void purple_conv_im_set_type_again(PurpleConvIm *im, unsigned int val);
899 
909 
916 
923 
932 
939 
949 void purple_conv_im_write(PurpleConvIm *im, const char *who,
950  const char *message, PurpleMessageFlags flags,
951  time_t mtime);
952 
966 gboolean purple_conv_present_error(const char *who, PurpleAccount *account, const char *what);
967 
974 void purple_conv_im_send(PurpleConvIm *im, const char *message);
975 
988 void purple_conv_send_confirm(PurpleConversation *conv, const char *message);
989 
997 void purple_conv_im_send_with_flags(PurpleConvIm *im, const char *message, PurpleMessageFlags flags);
998 
1018 gboolean purple_conv_custom_smiley_add(PurpleConversation *conv, const char *smile,
1019  const char *cksum_type, const char *chksum,
1020  gboolean remote);
1021 
1022 
1033  const char *smile,
1034  const guchar *data,
1035  gsize size);
1036 
1046 void purple_conv_custom_smiley_close(PurpleConversation *conv, const char *smile);
1047 
1051 /**************************************************************************/
1053 /**************************************************************************/
1064 
1079 GList *purple_conv_chat_set_users(PurpleConvChat *chat, GList *users);
1080 
1089 GList *purple_conv_chat_get_users(const PurpleConvChat *chat);
1090 
1097 void purple_conv_chat_ignore(PurpleConvChat *chat, const char *name);
1098 
1105 void purple_conv_chat_unignore(PurpleConvChat *chat, const char *name);
1106 
1115 GList *purple_conv_chat_set_ignored(PurpleConvChat *chat, GList *ignored);
1116 
1124 GList *purple_conv_chat_get_ignored(const PurpleConvChat *chat);
1125 
1140 const char *purple_conv_chat_get_ignored_user(const PurpleConvChat *chat,
1141  const char *user);
1142 
1152  const char *user);
1153 
1161 void purple_conv_chat_set_topic(PurpleConvChat *chat, const char *who,
1162  const char *topic);
1163 
1171 const char *purple_conv_chat_get_topic(const PurpleConvChat *chat);
1172 
1179 void purple_conv_chat_set_id(PurpleConvChat *chat, int id);
1180 
1188 int purple_conv_chat_get_id(const PurpleConvChat *chat);
1189 
1199 void purple_conv_chat_write(PurpleConvChat *chat, const char *who,
1200  const char *message, PurpleMessageFlags flags,
1201  time_t mtime);
1202 
1209 void purple_conv_chat_send(PurpleConvChat *chat, const char *message);
1210 
1218 void purple_conv_chat_send_with_flags(PurpleConvChat *chat, const char *message, PurpleMessageFlags flags);
1219 
1229 void purple_conv_chat_add_user(PurpleConvChat *chat, const char *user,
1230  const char *extra_msg, PurpleConvChatBuddyFlags flags,
1231  gboolean new_arrival);
1232 
1250 void purple_conv_chat_add_users(PurpleConvChat *chat, GList *users, GList *extra_msgs,
1251  GList *flags, gboolean new_arrivals);
1252 
1260 void purple_conv_chat_rename_user(PurpleConvChat *chat, const char *old_user,
1261  const char *new_user);
1262 
1272 void purple_conv_chat_remove_user(PurpleConvChat *chat, const char *user,
1273  const char *reason);
1274 
1282 void purple_conv_chat_remove_users(PurpleConvChat *chat, GList *users,
1283  const char *reason);
1284 
1293 gboolean purple_conv_chat_find_user(PurpleConvChat *chat, const char *user);
1294 
1302 void purple_conv_chat_user_set_flags(PurpleConvChat *chat, const char *user,
1303  PurpleConvChatBuddyFlags flags);
1304 
1314  const char *user);
1315 
1322 
1329 void purple_conv_chat_set_nick(PurpleConvChat *chat, const char *nick);
1330 
1337 const char *purple_conv_chat_get_nick(PurpleConvChat *chat);
1338 
1348 
1356 
1370 void purple_conv_chat_invite_user(PurpleConvChat *chat, const char *user,
1371  const char *message, gboolean confirm);
1372 
1383 
1393 PurpleConvChatBuddy *purple_conv_chat_cb_new(const char *name, const char *alias,
1394  PurpleConvChatBuddyFlags flags);
1395 
1403 
1412 
1419 
1432 
1446 gboolean purple_conversation_do_command(PurpleConversation *conv, const gchar *cmdline, const gchar *markup, gchar **error);
1447 
1450 /**************************************************************************/
1452 /**************************************************************************/
1461 
1465 void purple_conversations_init(void);
1466 
1470 void purple_conversations_uninit(void);
1471 
1474 #ifdef __cplusplus
1475 }
1476 #endif
1477 
1478 #endif /* _PURPLE_CONVERSATION_H_ */
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!