Mercurial > pidgin
annotate src/conversation.h @ 11652:a66ee70c614c
[gaim-migrate @ 13936]
Whoops
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 13 Oct 2005 01:48:03 +0000 |
parents | 9b3833da6840 |
children | 38bbb0f15453 |
rev | line source |
---|---|
4359 | 1 /** |
2 * @file conversation.h Conversation API | |
5034
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
4890
diff
changeset
|
3 * @ingroup core |
4359 | 4 * |
5 * gaim | |
6 * | |
8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
10 * |
4359 | 11 * This program is free software; you can redistribute it and/or modify |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
6488
e5e8d21bd4d8
[gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
24 * |
6605
943b03bcecf5
[gaim-migrate @ 7129]
Christian Hammond <chipx86@chipx86.com>
parents:
6585
diff
changeset
|
25 * @see @ref conversation-signals |
4359 | 26 */ |
4890
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4877
diff
changeset
|
27 #ifndef _GAIM_CONVERSATION_H_ |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4877
diff
changeset
|
28 #define _GAIM_CONVERSATION_H_ |
4359 | 29 |
30 /**************************************************************************/ | |
31 /** Data Structures */ | |
32 /**************************************************************************/ | |
33 | |
11581 | 34 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
35 typedef struct _GaimConversationUiOps GaimConversationUiOps; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
36 typedef struct _GaimConversation GaimConversation; |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
37 typedef struct _GaimConvIm GaimConvIm; |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
38 typedef struct _GaimConvChat GaimConvChat; |
9554 | 39 typedef struct _GaimConvChatBuddy GaimConvChatBuddy; |
4359 | 40 |
41 /** | |
42 * A type of conversation. | |
43 */ | |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
44 typedef enum |
4359 | 45 { |
11338 | 46 GAIM_CONV_TYPE_UNKNOWN = 0, /**< Unknown conversation type. */ |
47 GAIM_CONV_TYPE_IM, /**< Instant Message. */ | |
48 GAIM_CONV_TYPE_CHAT, /**< Chat room. */ | |
49 GAIM_CONV_TYPE_MISC, /**< A misc. conversation. */ | |
50 GAIM_CONV_TYPE_ANY /**< Any type of conversation. */ | |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
51 |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
52 } GaimConversationType; |
4359 | 53 |
54 /** | |
55 * Unseen text states. | |
56 */ | |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
57 typedef enum |
4359 | 58 { |
59 GAIM_UNSEEN_NONE = 0, /**< No unseen text in the conversation. */ | |
60 GAIM_UNSEEN_TEXT, /**< Unseen text in the conversation. */ | |
6405
96de6d9eb422
[gaim-migrate @ 6910]
Christian Hammond <chipx86@chipx86.com>
parents:
6311
diff
changeset
|
61 GAIM_UNSEEN_NICK, /**< Unseen text and the nick was said. */ |
96de6d9eb422
[gaim-migrate @ 6910]
Christian Hammond <chipx86@chipx86.com>
parents:
6311
diff
changeset
|
62 GAIM_UNSEEN_EVENT /**< Unseen events in the conversation. */ |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
63 |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
64 } GaimUnseenState; |
4359 | 65 |
66 /** | |
67 * Conversation update type. | |
68 */ | |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
69 typedef enum |
4359 | 70 { |
71 GAIM_CONV_UPDATE_ADD = 0, /**< The buddy associated with the conversation | |
8155
77d1252b3803
[gaim-migrate @ 8867]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
72 was added. */ |
4359 | 73 GAIM_CONV_UPDATE_REMOVE, /**< The buddy associated with the conversation |
8155
77d1252b3803
[gaim-migrate @ 8867]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
74 was removed. */ |
4491 | 75 GAIM_CONV_UPDATE_ACCOUNT, /**< The gaim_account was changed. */ |
4359 | 76 GAIM_CONV_UPDATE_TYPING, /**< The typing state was updated. */ |
77 GAIM_CONV_UPDATE_UNSEEN, /**< The unseen state was updated. */ | |
78 GAIM_CONV_UPDATE_LOGGING, /**< Logging for this conversation was | |
8155
77d1252b3803
[gaim-migrate @ 8867]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
79 enabled or disabled. */ |
4359 | 80 GAIM_CONV_UPDATE_TOPIC, /**< The topic for a chat was updated. */ |
81 /* | |
82 * XXX These need to go when we implement a more generic core/UI event | |
83 * system. | |
84 */ | |
4378
194507c83612
[gaim-migrate @ 4644]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
85 GAIM_CONV_ACCOUNT_ONLINE, /**< One of the user's accounts went online. */ |
194507c83612
[gaim-migrate @ 4644]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
86 GAIM_CONV_ACCOUNT_OFFLINE, /**< One of the user's accounts went offline. */ |
6846
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
87 GAIM_CONV_UPDATE_AWAY, /**< The other user went away. */ |
8155
77d1252b3803
[gaim-migrate @ 8867]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
88 GAIM_CONV_UPDATE_ICON, /**< The other user's buddy icon changed. */ |
8256
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
89 GAIM_CONV_UPDATE_TITLE, |
10665 | 90 GAIM_CONV_UPDATE_CHATLEFT, |
91 | |
92 GAIM_CONV_UPDATE_FEATURES, /**< The features for a chat have changed */ | |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
93 |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
94 } GaimConvUpdateType; |
4359 | 95 |
96 /** | |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
97 * The typing state of a user. |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
98 */ |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
99 typedef enum |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
100 { |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
101 GAIM_NOT_TYPING = 0, /**< Not typing. */ |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
102 GAIM_TYPING, /**< Currently typing. */ |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
103 GAIM_TYPED /**< Stopped typing momentarily. */ |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
104 |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
105 } GaimTypingState; |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
106 |
6621 | 107 /** |
108 * Flags applicable to a message. Most will have send, recv or system. | |
109 */ | |
110 typedef enum | |
111 { | |
6982 | 112 GAIM_MESSAGE_SEND = 0x0001, /**< Outgoing message. */ |
113 GAIM_MESSAGE_RECV = 0x0002, /**< Incoming message. */ | |
114 GAIM_MESSAGE_SYSTEM = 0x0004, /**< System message. */ | |
115 GAIM_MESSAGE_AUTO_RESP = 0x0008, /**< Auto response. */ | |
116 GAIM_MESSAGE_COLORIZE = 0x0010, /**< Colorize nicks. */ | |
117 GAIM_MESSAGE_NICK = 0x0020, /**< Contains your nick. */ | |
118 GAIM_MESSAGE_NO_LOG = 0x0040, /**< Do not log. */ | |
119 GAIM_MESSAGE_WHISPER = 0x0080, /**< Whispered message. */ | |
9584 | 120 GAIM_MESSAGE_ERROR = 0x0200, /**< Error message. */ |
10346 | 121 GAIM_MESSAGE_DELAYED = 0x0400, /**< Delayed message. */ |
122 GAIM_MESSAGE_RAW = 0x0800 /**< "Raw" message - don't apply formatting */ | |
10008 | 123 |
6621 | 124 } GaimMessageFlags; |
125 | |
9554 | 126 /** |
127 * Flags applicable to users in Chats. | |
128 */ | |
129 typedef enum | |
130 { | |
131 GAIM_CBFLAGS_NONE = 0x0000, /**< No flags */ | |
132 GAIM_CBFLAGS_VOICE = 0x0001, /**< Voiced user or "Participant" */ | |
133 GAIM_CBFLAGS_HALFOP = 0x0002, /**< Half-op */ | |
134 GAIM_CBFLAGS_OP = 0x0004, /**< Channel Op or Moderator */ | |
10665 | 135 GAIM_CBFLAGS_FOUNDER = 0x0008, /**< Channel Founder */ |
136 GAIM_CBFLAGS_TYPING = 0x0010, /**< Currently typing */ | |
11581 | 137 |
10008 | 138 |
9554 | 139 } GaimConvChatBuddyFlags; |
140 | |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
141 #include "account.h" |
9718 | 142 #include "buddyicon.h" |
7431 | 143 #include "log.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
144 #include "server.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
145 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
146 /** |
4359 | 147 * Conversation operations and events. |
148 * | |
149 * Any UI representing a conversation must assign a filled-out | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
150 * GaimConversationUiOps structure to the GaimConversation. |
4359 | 151 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
152 struct _GaimConversationUiOps |
4359 | 153 { |
11581 | 154 void (*create_conversation)(GaimConversation *conv); |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
155 void (*destroy_conversation)(GaimConversation *conv); |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
156 void (*write_chat)(GaimConversation *conv, const char *who, |
8155
77d1252b3803
[gaim-migrate @ 8867]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
157 const char *message, GaimMessageFlags flags, |
77d1252b3803
[gaim-migrate @ 8867]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
158 time_t mtime); |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
159 void (*write_im)(GaimConversation *conv, const char *who, |
8155
77d1252b3803
[gaim-migrate @ 8867]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
160 const char *message, GaimMessageFlags flags, |
77d1252b3803
[gaim-migrate @ 8867]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
161 time_t mtime); |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
162 void (*write_conv)(GaimConversation *conv, const char *name, const char *alias, |
8155
77d1252b3803
[gaim-migrate @ 8867]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
163 const char *message, GaimMessageFlags flags, |
77d1252b3803
[gaim-migrate @ 8867]
Christian Hammond <chipx86@chipx86.com>
parents:
8046
diff
changeset
|
164 time_t mtime); |
4359 | 165 |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
166 void (*chat_add_users)(GaimConversation *conv, GList *users, GList *aliases); |
11485
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11454
diff
changeset
|
167 void (*chat_rename_user)(GaimConversation *conv, const char *old_name, |
16b0da1f376f
[gaim-migrate @ 13727]
Richard Laager <rlaager@wiktel.com>
parents:
11454
diff
changeset
|
168 const char *new_name, const char *new_alias); |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
169 void (*chat_remove_user)(GaimConversation *conv, const char *user); |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
170 void (*chat_remove_users)(GaimConversation *conv, GList *users); |
9554 | 171 void (*chat_update_user)(GaimConversation *conv, const char *user); |
4359 | 172 |
173 | |
9260
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9166
diff
changeset
|
174 gboolean (*has_focus)(GaimConversation *conv); |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9166
diff
changeset
|
175 |
10526 | 176 /* Custom Smileys */ |
177 gboolean (*custom_smiley_add)(GaimConversation *conv, const char *smile); | |
178 void (*custom_smiley_write)(GaimConversation *conv, const char *smile, | |
11137 | 179 const guchar *data, gsize size); |
10526 | 180 void (*custom_smiley_close)(GaimConversation *conv, const char *smile); |
181 | |
4359 | 182 /* Events */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
183 void (*updated)(GaimConversation *conv, GaimConvUpdateType type); |
9260
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9166
diff
changeset
|
184 |
4359 | 185 }; |
186 | |
187 /** | |
188 * Data specific to Instant Messages. | |
189 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
190 struct _GaimConvIm |
4359 | 191 { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
192 GaimConversation *conv; /**< The parent conversation. */ |
4359 | 193 |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
194 GaimTypingState typing_state; /**< The current typing state. */ |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
195 guint typing_timeout; /**< The typing timer handle. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
196 time_t type_again; /**< The type again time. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
197 guint type_again_timeout; /**< The type again timer handle. */ |
4359 | 198 |
6846
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
199 GaimBuddyIcon *icon; /**< The buddy icon. */ |
4359 | 200 }; |
201 | |
202 /** | |
203 * Data specific to Chats. | |
204 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
205 struct _GaimConvChat |
4359 | 206 { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
207 GaimConversation *conv; /**< The parent conversation. */ |
4359 | 208 |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
209 GList *in_room; /**< The users in the room. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
210 GList *ignored; /**< Ignored users. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
211 char *who; /**< The person who set the topic. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
212 char *topic; /**< The topic. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
213 int id; /**< The chat ID. */ |
8158 | 214 char *nick; /**< Your nick in this chat. */ |
8256
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
215 |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
216 gboolean left; /**< We left the chat and kept the window open */ |
4359 | 217 }; |
218 | |
219 /** | |
9554 | 220 * Data for "Chat Buddies" |
221 */ | |
222 struct _GaimConvChatBuddy | |
223 { | |
224 char *name; /**< The name */ | |
225 GaimConvChatBuddyFlags flags; /**< Flags (ops, voice etc.) */ | |
226 }; | |
227 | |
228 /** | |
4359 | 229 * A core representation of a conversation between two or more people. |
230 * | |
11581 | 231 * The conversation can be an IM or a chat. |
4359 | 232 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
233 struct _GaimConversation |
4359 | 234 { |
235 GaimConversationType type; /**< The type of conversation. */ | |
236 | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
237 GaimAccount *account; /**< The user using this conversation. */ |
4359 | 238 |
239 | |
240 char *name; /**< The name of the conversation. */ | |
241 char *title; /**< The window title. */ | |
242 | |
243 gboolean logging; /**< The status of logging. */ | |
8158 | 244 |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
245 GList *logs; /**< This conversation's logs */ |
8158 | 246 |
4359 | 247 GList *send_history; /**< The send history. */ |
248 | |
249 GaimUnseenState unseen; /**< The unseen tab state. */ | |
250 | |
251 union | |
252 { | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
253 GaimConvIm *im; /**< IM-specific data. */ |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
254 GaimConvChat *chat; /**< Chat-specific data. */ |
4378
194507c83612
[gaim-migrate @ 4644]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
255 void *misc; /**< Misc. data. */ |
4359 | 256 |
257 } u; | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
258 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
259 GaimConversationUiOps *ui_ops; /**< UI-specific operations. */ |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
260 void *ui_data; /**< UI-specific data. */ |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
261 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
262 GHashTable *data; /**< Plugin-specific data. */ |
10849 | 263 |
10665 | 264 GaimConnectionFlags features; /**< The supported features */ |
265 | |
4359 | 266 }; |
267 | |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
268 #ifdef __cplusplus |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
269 extern "C" { |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
270 #endif |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
271 |
4359 | 272 /**************************************************************************/ |
273 /** @name Conversation API */ | |
274 /**************************************************************************/ | |
275 /*@{*/ | |
276 | |
277 /** | |
278 * Creates a new conversation of the specified type. | |
279 * | |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6622
diff
changeset
|
280 * @param type The type of conversation. |
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6622
diff
changeset
|
281 * @param account The account opening the conversation window on the gaim |
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6622
diff
changeset
|
282 * user's end. |
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6622
diff
changeset
|
283 * @param name The name of the conversation. |
4359 | 284 * |
285 * @return The new conversation. | |
286 */ | |
6585
f30579b25253
[gaim-migrate @ 7107]
Christian Hammond <chipx86@chipx86.com>
parents:
6488
diff
changeset
|
287 GaimConversation *gaim_conversation_new(GaimConversationType type, |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
288 GaimAccount *account, |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
289 const char *name); |
4359 | 290 |
291 /** | |
292 * Destroys the specified conversation and removes it from the parent | |
293 * window. | |
294 * | |
295 * If this conversation is the only one contained in the parent window, | |
296 * that window is also destroyed. | |
297 * | |
298 * @param conv The conversation to destroy. | |
299 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
300 void gaim_conversation_destroy(GaimConversation *conv); |
4359 | 301 |
302 /** | |
303 * Returns the specified conversation's type. | |
304 * | |
305 * @param conv The conversation. | |
306 * | |
307 * @return The conversation's type. | |
308 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
309 GaimConversationType gaim_conversation_get_type(const GaimConversation *conv); |
4359 | 310 |
311 /** | |
312 * Sets the specified conversation's UI operations structure. | |
313 * | |
314 * @param conv The conversation. | |
315 * @param ops The UI conversation operations structure. | |
316 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
317 void gaim_conversation_set_ui_ops(GaimConversation *conv, |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
318 GaimConversationUiOps *ops); |
4359 | 319 |
320 /** | |
11581 | 321 * Sets the default conversation UI operations structure. |
322 * | |
323 * @param ops The UI conversation operations structure. | |
324 */ | |
325 void gaim_conversations_set_ui_ops(GaimConversationUiOps *ops); | |
326 | |
327 /** | |
4359 | 328 * Returns the specified conversation's UI operations structure. |
6585
f30579b25253
[gaim-migrate @ 7107]
Christian Hammond <chipx86@chipx86.com>
parents:
6488
diff
changeset
|
329 * |
4359 | 330 * @param conv The conversation. |
331 * | |
332 * @return The operations structure. | |
333 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
334 GaimConversationUiOps *gaim_conversation_get_ui_ops( |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
335 const GaimConversation *conv); |
4359 | 336 |
337 /** | |
4491 | 338 * Sets the specified conversation's gaim_account. |
4359 | 339 * |
4491 | 340 * This gaim_account represents the user using gaim, not the person the user |
4359 | 341 * is having a conversation/chat/flame with. |
342 * | |
343 * @param conv The conversation. | |
4491 | 344 * @param account The gaim_account. |
4359 | 345 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
346 void gaim_conversation_set_account(GaimConversation *conv, |
10827 | 347 GaimAccount *account); |
4359 | 348 |
349 /** | |
4491 | 350 * Returns the specified conversation's gaim_account. |
4359 | 351 * |
4491 | 352 * This gaim_account represents the user using gaim, not the person the user |
4359 | 353 * is having a conversation/chat/flame with. |
354 * | |
355 * @param conv The conversation. | |
356 * | |
4491 | 357 * @return The conversation's gaim_account. |
4359 | 358 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
359 GaimAccount *gaim_conversation_get_account(const GaimConversation *conv); |
4359 | 360 |
361 /** | |
362 * Returns the specified conversation's gaim_connection. | |
363 * | |
364 * This is the same as gaim_conversation_get_user(conv)->gc. | |
365 * | |
366 * @param conv The conversation. | |
367 * | |
368 * @return The conversation's gaim_connection. | |
369 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
370 GaimConnection *gaim_conversation_get_gc(const GaimConversation *conv); |
4359 | 371 |
372 /** | |
373 * Sets the specified conversation's title. | |
374 * | |
375 * @param conv The conversation. | |
376 * @param title The title. | |
377 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
378 void gaim_conversation_set_title(GaimConversation *conv, const char *title); |
4359 | 379 |
380 /** | |
381 * Returns the specified conversation's title. | |
382 * | |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6622
diff
changeset
|
383 * @param conv The conversation. |
4359 | 384 * |
385 * @return The title. | |
386 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
387 const char *gaim_conversation_get_title(const GaimConversation *conv); |
4359 | 388 |
389 /** | |
390 * Automatically sets the specified conversation's title. | |
391 * | |
392 * This function takes OPT_IM_ALIAS_TAB into account, as well as the | |
393 * user's alias. | |
394 * | |
395 * @param conv The conversation. | |
396 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
397 void gaim_conversation_autoset_title(GaimConversation *conv); |
4359 | 398 |
399 /** | |
400 * Sets the conversation's unseen state. | |
401 * | |
402 * @param conv The conversation. | |
403 * @param state The new unseen state. | |
404 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
405 void gaim_conversation_set_unseen(GaimConversation *conv, |
10827 | 406 GaimUnseenState state); |
4359 | 407 |
408 /** | |
409 * Returns the conversation's unseen state. | |
410 * | |
411 * @param conv The conversation. | |
412 * | |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6622
diff
changeset
|
413 * @return The conversation's unseen state. |
4359 | 414 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
415 GaimUnseenState gaim_conversation_get_unseen(const GaimConversation *conv); |
4359 | 416 |
417 /** | |
7256
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7122
diff
changeset
|
418 * Sets the specified conversation's name. |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7122
diff
changeset
|
419 * |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7122
diff
changeset
|
420 * @param conv The conversation. |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7122
diff
changeset
|
421 * @param name The conversation's name. |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7122
diff
changeset
|
422 */ |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7122
diff
changeset
|
423 void gaim_conversation_set_name(GaimConversation *conv, const char *name); |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7122
diff
changeset
|
424 |
c93493c59ac3
[gaim-migrate @ 7833]
Christian Hammond <chipx86@chipx86.com>
parents:
7122
diff
changeset
|
425 /** |
4359 | 426 * Returns the specified conversation's name. |
427 * | |
428 * @param conv The conversation. | |
429 * | |
430 * @return The conversation's name. | |
431 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
432 const char *gaim_conversation_get_name(const GaimConversation *conv); |
4359 | 433 |
434 /** | |
435 * Enables or disables logging for this conversation. | |
436 * | |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6622
diff
changeset
|
437 * @param conv The conversation. |
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6622
diff
changeset
|
438 * @param log @c TRUE if logging should be enabled, or @c FALSE otherwise. |
4359 | 439 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
440 void gaim_conversation_set_logging(GaimConversation *conv, gboolean log); |
4359 | 441 |
442 /** | |
443 * Returns whether or not logging is enabled for this conversation. | |
444 * | |
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6622
diff
changeset
|
445 * @param conv The conversation. |
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6622
diff
changeset
|
446 * |
4359 | 447 * @return @c TRUE if logging is enabled, or @c FALSE otherwise. |
448 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
449 gboolean gaim_conversation_is_logging(const GaimConversation *conv); |
4359 | 450 |
451 /** | |
452 * Returns the specified conversation's send history. | |
453 * | |
454 * @param conv The conversation. | |
455 * | |
456 * @return The conversation's send history. | |
457 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
458 GList *gaim_conversation_get_send_history(const GaimConversation *conv); |
4359 | 459 |
460 /** | |
461 * Returns the specified conversation's IM-specific data. | |
462 * | |
11338 | 463 * If the conversation type is not GAIM_CONV_TYPE_IM, this will return @c NULL. |
4359 | 464 * |
465 * @param conv The conversation. | |
466 * | |
467 * @return The IM-specific data. | |
468 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
469 GaimConvIm *gaim_conversation_get_im_data(const GaimConversation *conv); |
4359 | 470 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
471 #define GAIM_CONV_IM(c) (gaim_conversation_get_im_data(c)) |
4359 | 472 |
473 /** | |
474 * Returns the specified conversation's chat-specific data. | |
475 * | |
11338 | 476 * If the conversation type is not GAIM_CONV_TYPE_CHAT, this will return @c NULL. |
4359 | 477 * |
478 * @param conv The conversation. | |
479 * | |
480 * @return The chat-specific data. | |
481 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
482 GaimConvChat *gaim_conversation_get_chat_data(const GaimConversation *conv); |
4359 | 483 |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
484 #define GAIM_CONV_CHAT(c) (gaim_conversation_get_chat_data(c)) |
4359 | 485 |
486 /** | |
4877
249382064693
[gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents:
4876
diff
changeset
|
487 * Sets extra data for a conversation. |
6585
f30579b25253
[gaim-migrate @ 7107]
Christian Hammond <chipx86@chipx86.com>
parents:
6488
diff
changeset
|
488 * |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
489 * @param conv The conversation. |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
490 * @param key The unique key. |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
491 * @param data The data to assign. |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
492 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
493 void gaim_conversation_set_data(GaimConversation *conv, const char *key, |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
494 gpointer data); |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
495 |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
496 /** |
4877
249382064693
[gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents:
4876
diff
changeset
|
497 * Returns extra data in a conversation. |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
498 * |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
499 * @param conv The conversation. |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
500 * @param key The unqiue key. |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
501 * |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
502 * @return The data associated with the key. |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
503 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
504 gpointer gaim_conversation_get_data(GaimConversation *conv, const char *key); |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
505 |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
506 /** |
4359 | 507 * Returns a list of all conversations. |
508 * | |
509 * This list includes both IMs and chats. | |
510 * | |
511 * @return A GList of all conversations. | |
512 */ | |
513 GList *gaim_get_conversations(void); | |
514 | |
515 /** | |
516 * Returns a list of all IMs. | |
517 * | |
518 * @return A GList of all IMs. | |
519 */ | |
520 GList *gaim_get_ims(void); | |
521 | |
522 /** | |
523 * Returns a list of all chats. | |
524 * | |
525 * @return A GList of all chats. | |
526 */ | |
527 GList *gaim_get_chats(void); | |
528 | |
529 /** | |
10246 | 530 * Finds a conversation with the specified type, name, and Gaim account. |
4359 | 531 * |
10246 | 532 * @param type The type of the conversation. |
4359 | 533 * @param name The name of the conversation. |
4491 | 534 * @param account The gaim_account associated with the conversation. |
4359 | 535 * |
536 * @return The conversation if found, or @c NULL otherwise. | |
537 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
538 GaimConversation *gaim_find_conversation_with_account( |
10246 | 539 GaimConversationType type, const char *name, |
540 const GaimAccount *account); | |
4359 | 541 |
542 /** | |
543 * Writes to a conversation window. | |
544 * | |
545 * This function should not be used to write IM or chat messages. Use | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
546 * gaim_conv_im_write() and gaim_conv_chat_write() instead. Those functions will |
4359 | 547 * most likely call this anyway, but they may do their own formatting, |
548 * sound playback, etc. | |
549 * | |
550 * This can be used to write generic messages, such as "so and so closed | |
551 * the conversation window." | |
552 * | |
553 * @param conv The conversation. | |
554 * @param who The user who sent the message. | |
555 * @param message The message. | |
6621 | 556 * @param flags The message flags. |
4359 | 557 * @param mtime The time the message was sent. |
558 * | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
559 * @see gaim_conv_im_write() |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
560 * @see gaim_conv_chat_write() |
4359 | 561 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
562 void gaim_conversation_write(GaimConversation *conv, const char *who, |
10665 | 563 const char *message, GaimMessageFlags flags, |
564 time_t mtime); | |
565 | |
566 | |
567 /** | |
568 Set the features as supported for the given conversation. | |
569 @param conv The conversation | |
570 @param features Bitset defining supported features | |
571 */ | |
572 void gaim_conversation_set_features(GaimConversation *conv, | |
573 GaimConnectionFlags features); | |
574 | |
575 | |
576 /** | |
577 Get the features supported by the given conversation. | |
578 @param conv The conversation | |
579 */ | |
11581 | 580 GaimConnectionFlags gaim_conversation_get_features(GaimConversation *conv); |
4359 | 581 |
582 /** | |
9260
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9166
diff
changeset
|
583 * Determines if a conversation has focus |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9166
diff
changeset
|
584 * |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9166
diff
changeset
|
585 * @param conv The conversation. |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9166
diff
changeset
|
586 * |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9166
diff
changeset
|
587 * @return @c TRUE if the conversation has focus, @c FALSE if |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9166
diff
changeset
|
588 * it does not or the UI does not have a concept of conversation focus |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9166
diff
changeset
|
589 */ |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9166
diff
changeset
|
590 gboolean gaim_conversation_has_focus(GaimConversation *conv); |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9166
diff
changeset
|
591 |
947876140943
[gaim-migrate @ 10059]
Christian Hammond <chipx86@chipx86.com>
parents:
9166
diff
changeset
|
592 /** |
4359 | 593 * Updates the visual status and UI of a conversation. |
594 * | |
595 * @param conv The conversation. | |
596 * @param type The update type. | |
597 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
598 void gaim_conversation_update(GaimConversation *conv, GaimConvUpdateType type); |
4359 | 599 |
600 /** | |
601 * Calls a function on each conversation. | |
602 * | |
603 * @param func The function. | |
604 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
605 void gaim_conversation_foreach(void (*func)(GaimConversation *conv)); |
4359 | 606 |
607 /*@}*/ | |
608 | |
609 | |
610 /**************************************************************************/ | |
611 /** @name IM Conversation API */ | |
612 /**************************************************************************/ | |
613 /*@{*/ | |
614 | |
615 /** | |
616 * Gets an IM's parent conversation. | |
617 * | |
618 * @param im The IM. | |
619 * | |
620 * @return The parent conversation. | |
621 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
622 GaimConversation *gaim_conv_im_get_conversation(const GaimConvIm *im); |
4359 | 623 |
624 /** | |
6846
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
625 * Sets the IM's buddy icon. |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
626 * |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
627 * This should only be called from within Gaim. You probably want to |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
628 * call gaim_buddy_icon_set_data(). |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
629 * |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
630 * @param im The IM. |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
631 * @param icon The buddy icon. |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
632 * |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
633 * @see gaim_buddy_icon_set_data() |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
634 */ |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
635 void gaim_conv_im_set_icon(GaimConvIm *im, GaimBuddyIcon *icon); |
6846
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
636 |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
637 /** |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
638 * Returns the IM's buddy icon. |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
639 * |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
640 * @param im The IM. |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
641 * |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
642 * @return The buddy icon. |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
643 */ |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
644 GaimBuddyIcon *gaim_conv_im_get_icon(const GaimConvIm *im); |
6846
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
645 |
8ab95f4c9800
[gaim-migrate @ 7391]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
646 /** |
4359 | 647 * Sets the IM's typing state. |
648 * | |
649 * @param im The IM. | |
650 * @param state The typing state. | |
651 */ | |
8288
dde73afb3283
[gaim-migrate @ 9012]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
652 void gaim_conv_im_set_typing_state(GaimConvIm *im, GaimTypingState state); |
4359 | 653 |
654 /** | |
655 * Returns the IM's typing state. | |
656 * | |
657 * @param im The IM. | |
658 * | |
659 * @return The IM's typing state. | |
660 */ | |
8288
dde73afb3283
[gaim-migrate @ 9012]
Christian Hammond <chipx86@chipx86.com>
parents:
8256
diff
changeset
|
661 GaimTypingState gaim_conv_im_get_typing_state(const GaimConvIm *im); |
4359 | 662 |
663 /** | |
664 * Starts the IM's typing timeout. | |
665 * | |
666 * @param im The IM. | |
667 * @param timeout The timeout. | |
668 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
669 void gaim_conv_im_start_typing_timeout(GaimConvIm *im, int timeout); |
4359 | 670 |
671 /** | |
672 * Stops the IM's typing timeout. | |
673 * | |
674 * @param im The IM. | |
675 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
676 void gaim_conv_im_stop_typing_timeout(GaimConvIm *im); |
4359 | 677 |
678 /** | |
679 * Returns the IM's typing timeout. | |
680 * | |
681 * @param im The IM. | |
682 * | |
683 * @return The timeout. | |
684 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
685 guint gaim_conv_im_get_typing_timeout(const GaimConvIm *im); |
4359 | 686 |
687 /** | |
688 * Sets the IM's time until it should send another typing notification. | |
689 * | |
690 * @param im The IM. | |
691 * @param val The time. | |
692 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
693 void gaim_conv_im_set_type_again(GaimConvIm *im, time_t val); |
4359 | 694 |
695 /** | |
696 * Returns the IM's time until it should send another typing notification. | |
697 * | |
698 * @param im The IM. | |
699 * | |
700 * @return The time. | |
701 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
702 time_t gaim_conv_im_get_type_again(const GaimConvIm *im); |
4359 | 703 |
704 /** | |
705 * Starts the IM's type again timeout. | |
706 * | |
707 * @param im The IM. | |
708 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
709 void gaim_conv_im_start_type_again_timeout(GaimConvIm *im); |
4359 | 710 |
711 /** | |
712 * Stops the IM's type again timeout. | |
713 * | |
714 * @param im The IM. | |
715 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
716 void gaim_conv_im_stop_type_again_timeout(GaimConvIm *im); |
4359 | 717 |
718 /** | |
719 * Returns the IM's type again timeout interval. | |
720 * | |
721 * @param im The IM. | |
722 * | |
723 * @return The type again timeout interval. | |
724 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
725 guint gaim_conv_im_get_type_again_timeout(const GaimConvIm *im); |
4359 | 726 |
727 /** | |
728 * Updates the visual typing notification for an IM conversation. | |
729 * | |
730 * @param im The IM. | |
731 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
732 void gaim_conv_im_update_typing(GaimConvIm *im); |
4359 | 733 |
734 /** | |
735 * Writes to an IM. | |
736 * | |
737 * @param im The IM. | |
738 * @param who The user who sent the message. | |
739 * @param message The message to write. | |
6621 | 740 * @param flags The message flags. |
4359 | 741 * @param mtime The time the message was sent. |
742 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
743 void gaim_conv_im_write(GaimConvIm *im, const char *who, |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
744 const char *message, GaimMessageFlags flags, |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
745 time_t mtime); |
4359 | 746 |
747 /** | |
9627 | 748 * Presents an IM-error to the user |
11581 | 749 * |
9627 | 750 * This is a helper function to find a conversation, write an error to it, and |
751 * raise the window. If a conversation with this user doesn't already exist, | |
752 * the function will return FALSE and the calling function can attempt to present | |
753 * the error another way (gaim_notify_error, most likely) | |
754 * | |
755 * @param who The user this error is about | |
756 * @param account The account this error is on | |
757 * @param what The error | |
758 * @return TRUE if the error was presented, else FALSE | |
759 */ | |
760 gboolean gaim_conv_present_error(const char *who, GaimAccount *account, const char *what); | |
761 | |
762 /** | |
4359 | 763 * Sends a message to this IM conversation. |
764 * | |
765 * @param im The IM. | |
766 * @param message The message to send. | |
767 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
768 void gaim_conv_im_send(GaimConvIm *im, const char *message); |
4359 | 769 |
10526 | 770 /** |
10528 | 771 * Adds a smiley to the conversation's smiley tree. If this returns |
772 * @c TRUE you should call gaim_conv_custom_smiley_write() one or more | |
773 * times, and then gaim_conv_custom_smiley_close(). If this returns | |
774 * @c FALSE, either the conv or smile were invalid, or the icon was | |
775 * found in the cache. In either case, calling write or close would | |
776 * be an error. | |
10526 | 777 * |
778 * @param conv The conversation to associate the smiley with. | |
779 * @param smile The text associated with the smiley | |
780 * @param cksum_type The type of checksum. | |
781 * @param chksum The checksum, as a NUL terminated base64 string. | |
10528 | 782 * @return @c TRUE if an icon is expected, else FALSE. Note that |
10526 | 783 * it is an error to never call gaim_conv_custom_smiley_close if |
784 * this function returns @c TRUE, but an error to call it if | |
785 * @c FALSE is returned. | |
786 */ | |
787 | |
788 gboolean gaim_conv_custom_smiley_add(GaimConversation *conv, const char *smile, | |
789 const char *cksum_type, const char *chksum); | |
790 | |
791 | |
792 /** | |
793 * Updates the image associated with the current smiley. | |
794 * | |
795 * @param conv The conversation associated with the smiley. | |
796 * @param smile The text associated with the smiley. | |
797 * @param data The actual image data. | |
798 * @param size The length of the data. | |
799 */ | |
800 | |
801 void gaim_conv_custom_smiley_write(GaimConversation *conv, | |
11137 | 802 const char *smile, |
803 const guchar *data, | |
804 gsize size); | |
10526 | 805 |
806 /** | |
807 * Close the custom smiley, all data has been written with | |
808 * gaim_conv_custom_smiley_write, and it is no longer valid | |
809 * to call that function on that smiley. | |
810 * | |
811 * @param conv The gaim conversation associated with the smiley. | |
812 * @param smile The text associated with the smiley | |
813 */ | |
814 | |
815 void gaim_conv_custom_smiley_close(GaimConversation *conv, const char *smile); | |
816 | |
4359 | 817 /*@}*/ |
818 | |
819 | |
820 /**************************************************************************/ | |
821 /** @name Chat Conversation API */ | |
822 /**************************************************************************/ | |
823 /*@{*/ | |
824 | |
825 /** | |
826 * Gets a chat's parent conversation. | |
827 * | |
828 * @param chat The chat. | |
829 * | |
830 * @return The parent conversation. | |
831 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
832 GaimConversation *gaim_conv_chat_get_conversation(const GaimConvChat *chat); |
4359 | 833 |
834 /** | |
835 * Sets the list of users in the chat room. | |
836 * | |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
837 * @note Calling this function will not update the display of the users. |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
838 * Please use gaim_conv_chat_add_user(), gaim_conv_chat_add_users(), |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
839 * gaim_conv_chat_remove_user(), and gaim_conv_chat_remove_users() instead. |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
840 * |
4359 | 841 * @param chat The chat. |
842 * @param users The list of users. | |
843 * | |
844 * @return The list passed. | |
845 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
846 GList *gaim_conv_chat_set_users(GaimConvChat *chat, GList *users); |
4359 | 847 |
848 /** | |
849 * Returns a list of users in the chat room. | |
850 * | |
851 * @param chat The chat. | |
852 * | |
853 * @return The list of users. | |
854 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
855 GList *gaim_conv_chat_get_users(const GaimConvChat *chat); |
4359 | 856 |
857 /** | |
858 * Ignores a user in a chat room. | |
859 * | |
860 * @param chat The chat. | |
861 * @param name The name of the user. | |
862 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
863 void gaim_conv_chat_ignore(GaimConvChat *chat, const char *name); |
4359 | 864 |
865 /** | |
866 * Unignores a user in a chat room. | |
867 * | |
868 * @param chat The chat. | |
869 * @param name The name of the user. | |
870 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
871 void gaim_conv_chat_unignore(GaimConvChat *chat, const char *name); |
4359 | 872 |
873 /** | |
874 * Sets the list of ignored users in the chat room. | |
875 * | |
876 * @param chat The chat. | |
877 * @param ignored The list of ignored users. | |
878 * | |
879 * @return The list passed. | |
880 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
881 GList *gaim_conv_chat_set_ignored(GaimConvChat *chat, GList *ignored); |
4359 | 882 |
883 /** | |
884 * Returns the list of ignored users in the chat room. | |
885 * | |
886 * @param chat The chat. | |
887 * | |
888 * @return The list of ignored users. | |
889 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
890 GList *gaim_conv_chat_get_ignored(const GaimConvChat *chat); |
4359 | 891 |
892 /** | |
893 * Returns the actual name of the specified ignored user, if it exists in | |
894 * the ignore list. | |
895 * | |
896 * If the user found contains a prefix, such as '+' or '\@', this is also | |
897 * returned. The username passed to the function does not have to have this | |
898 * formatting. | |
899 * | |
900 * @param chat The chat. | |
901 * @param user The user to check in the ignore list. | |
902 * | |
903 * @return The ignored user if found, complete with prefixes, or @c NULL | |
904 * if not found. | |
905 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
906 const char *gaim_conv_chat_get_ignored_user(const GaimConvChat *chat, |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
907 const char *user); |
4359 | 908 |
909 /** | |
910 * Returns @c TRUE if the specified user is ignored. | |
911 * | |
912 * @param chat The chat. | |
913 * @param user The user. | |
914 * | |
915 * @return @c TRUE if the user is in the ignore list; @c FALSE otherwise. | |
916 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
917 gboolean gaim_conv_chat_is_user_ignored(const GaimConvChat *chat, |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
918 const char *user); |
4359 | 919 |
920 /** | |
921 * Sets the chat room's topic. | |
922 * | |
923 * @param chat The chat. | |
924 * @param who The user that set the topic. | |
925 * @param topic The topic. | |
926 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
927 void gaim_conv_chat_set_topic(GaimConvChat *chat, const char *who, |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
928 const char *topic); |
4359 | 929 |
930 /** | |
931 * Returns the chat room's topic. | |
932 * | |
933 * @param chat The chat. | |
934 * | |
935 * @return The chat's topic. | |
936 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
937 const char *gaim_conv_chat_get_topic(const GaimConvChat *chat); |
4359 | 938 |
939 /** | |
940 * Sets the chat room's ID. | |
941 * | |
942 * @param chat The chat. | |
943 * @param id The ID. | |
944 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
945 void gaim_conv_chat_set_id(GaimConvChat *chat, int id); |
4359 | 946 |
947 /** | |
948 * Returns the chat room's ID. | |
949 * | |
950 * @param chat The chat. | |
951 * | |
952 * @return The ID. | |
953 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
954 int gaim_conv_chat_get_id(const GaimConvChat *chat); |
4359 | 955 |
956 /** | |
957 * Writes to a chat. | |
958 * | |
959 * @param chat The chat. | |
960 * @param who The user who sent the message. | |
961 * @param message The message to write. | |
6621 | 962 * @param flags The flags. |
4359 | 963 * @param mtime The time the message was sent. |
964 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
965 void gaim_conv_chat_write(GaimConvChat *chat, const char *who, |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
966 const char *message, GaimMessageFlags flags, |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
967 time_t mtime); |
4359 | 968 |
969 /** | |
970 * Sends a message to this chat conversation. | |
971 * | |
972 * @param chat The chat. | |
973 * @param message The message to send. | |
974 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
975 void gaim_conv_chat_send(GaimConvChat *chat, const char *message); |
4359 | 976 |
977 /** | |
978 * Adds a user to a chat. | |
979 * | |
9939 | 980 * @param chat The chat. |
981 * @param user The user to add. | |
982 * @param extra_msg An extra message to display with the join message. | |
983 * @param flags The users flags | |
984 * @param new_arrival Decides whether or not to show a join notice. | |
4359 | 985 */ |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
986 void gaim_conv_chat_add_user(GaimConvChat *chat, const char *user, |
9846 | 987 const char *extra_msg, GaimConvChatBuddyFlags flags, |
988 gboolean new_arrival); | |
4359 | 989 |
990 /** | |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
991 * Adds a list of users to a chat. |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
992 * |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
993 * The data is copied from @a users, @a extra_msgs, and @a flags, so it is up to |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
994 * the caller to free this list after calling this function. |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
995 * |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
996 * @param chat The chat. |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
997 * @param users The list of users to add. |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
998 * @param extra_msgs An extra message to display with the join message for each |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
999 * user. This list may be shorter than @a users, in which |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1000 * case, the users after the end of extra_msgs will not have |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1001 * an extra message. By extension, this means that extra_msgs |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1002 * can simply be @c NULL and none of the users will have an |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1003 * extra message. |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1004 * @param flags The list of flags for each user. |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1005 * @param new_arrivals Decides whether or not to show join notices. |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1006 */ |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1007 void gaim_conv_chat_add_users(GaimConvChat *chat, GList *users, GList *extra_msgs, |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11338
diff
changeset
|
1008 GList *flags, gboolean new_arrivals); |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1009 |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1010 /** |
4359 | 1011 * Renames a user in a chat. |
1012 * | |
1013 * @param chat The chat. | |
1014 * @param old_user The old username. | |
1015 * @param new_user The new username. | |
1016 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
1017 void gaim_conv_chat_rename_user(GaimConvChat *chat, const char *old_user, |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
1018 const char *new_user); |
4359 | 1019 |
1020 /** | |
1021 * Removes a user from a chat, optionally with a reason. | |
1022 * | |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1023 * It is up to the developer to free this list after calling this function. |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1024 * |
4359 | 1025 * @param chat The chat. |
1026 * @param user The user that is being removed. | |
1027 * @param reason The optional reason given for the removal. Can be @c NULL. | |
1028 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
1029 void gaim_conv_chat_remove_user(GaimConvChat *chat, const char *user, |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
1030 const char *reason); |
4359 | 1031 |
1032 /** | |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1033 * Removes a list of users from a chat, optionally with a single reason. |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1034 * |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1035 * @param chat The chat. |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1036 * @param users The users that are being removed. |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1037 * @param reason The optional reason given for the removal. Can be @c NULL. |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1038 */ |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
1039 void gaim_conv_chat_remove_users(GaimConvChat *chat, GList *users, |
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
1040 const char *reason); |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1041 |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1042 /** |
9554 | 1043 * Finds a user in a chat |
1044 * | |
1045 * @param chat The chat. | |
1046 * @param user The user to look for. | |
1047 * | |
1048 * @return TRUE if the user is in the chat, FALSE if not | |
1049 */ | |
1050 gboolean gaim_conv_chat_find_user(GaimConvChat *chat, const char *user); | |
1051 | |
1052 /** | |
1053 * Set a users flags in a chat | |
1054 * | |
1055 * @param chat The chat. | |
1056 * @param user The user to update. | |
1057 * @param flags The new flags. | |
1058 */ | |
1059 void gaim_conv_chat_user_set_flags(GaimConvChat *chat, const char *user, | |
1060 GaimConvChatBuddyFlags flags); | |
1061 | |
1062 /** | |
1063 * Get the flags for a user in a chat | |
1064 * | |
1065 * @param chat The chat. | |
1066 * @param user The user to find the flags for | |
1067 * | |
1068 * @return The flags for the user | |
1069 */ | |
1070 GaimConvChatBuddyFlags gaim_conv_chat_user_get_flags(GaimConvChat *chat, | |
1071 const char *user); | |
1072 | |
1073 /** | |
6414
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1074 * Clears all users from a chat. |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1075 * |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1076 * @param chat The chat. |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1077 */ |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
1078 void gaim_conv_chat_clear_users(GaimConvChat *chat); |
6414
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1079 |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1080 /** |
8158 | 1081 * Sets your nickname (used for hilighting) for a chat. |
1082 * | |
1083 * @param chat The chat. | |
1084 * @param nick The nick. | |
1085 */ | |
1086 void gaim_conv_chat_set_nick(GaimConvChat *chat, const char *nick); | |
1087 | |
1088 /** | |
1089 * Gets your nickname (used for hilighting) for a chat. | |
1090 * | |
1091 * @param chat The chat. | |
1092 * @return The nick. | |
1093 */ | |
1094 const char *gaim_conv_chat_get_nick(GaimConvChat *chat); | |
1095 | |
1096 /** | |
4359 | 1097 * Finds a chat with the specified chat ID. |
1098 * | |
1099 * @param gc The gaim_connection. | |
1100 * @param id The chat ID. | |
1101 * | |
1102 * @return The chat conversation. | |
1103 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1104 GaimConversation *gaim_find_chat(const GaimConnection *gc, int id); |
4359 | 1105 |
8256
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1106 /** |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1107 * Lets the core know we left a chat, without destroying it. |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1108 * Called from serv_got_chat_left(). |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1109 * |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1110 * @param chat The chat. |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1111 */ |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1112 void gaim_conv_chat_left(GaimConvChat *chat); |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1113 |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1114 /** |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1115 * Returns true if we're no longer in this chat, |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1116 * and just left the window open. |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1117 * |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1118 * @param chat The chat. |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1119 * |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1120 * @return @c TRUE if we left the chat already, @c FALSE if |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1121 * we're still there. |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1122 */ |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1123 gboolean gaim_conv_chat_has_left(GaimConvChat *chat); |
1d86096ae0f4
[gaim-migrate @ 8979]
Christian Hammond <chipx86@chipx86.com>
parents:
8158
diff
changeset
|
1124 |
9554 | 1125 /** |
1126 * Creates a new chat buddy | |
1127 * | |
1128 * @param name The name. | |
1129 * @param flags The flags. | |
1130 * | |
1131 * @return The new chat buddy | |
1132 */ | |
1133 GaimConvChatBuddy *gaim_conv_chat_cb_new(const char *name, | |
1134 GaimConvChatBuddyFlags flags); | |
1135 | |
1136 /** | |
1137 * Find a chat buddy in a chat | |
1138 * | |
1139 * @param chat The chat. | |
1140 * @param name The name of the chat buddy to find. | |
1141 */ | |
1142 GaimConvChatBuddy *gaim_conv_chat_cb_find(GaimConvChat *chat, const char *name); | |
1143 | |
1144 /** | |
1145 * Get the name of a chat buddy | |
1146 * | |
1147 * @param cb The chat buddy. | |
1148 * | |
1149 * @return The name of the chat buddy. | |
1150 */ | |
1151 const char *gaim_conv_chat_cb_get_name(GaimConvChatBuddy *cb); | |
1152 | |
1153 /** | |
1154 * Destroys a chat buddy | |
1155 * | |
1156 * @param cb The chat buddy to destroy | |
1157 */ | |
1158 void gaim_conv_chat_cb_destroy(GaimConvChatBuddy *cb); | |
1159 | |
4359 | 1160 /*@}*/ |
1161 | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1162 /**************************************************************************/ |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1163 /** @name Conversations Subsystem */ |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1164 /**************************************************************************/ |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1165 /*@{*/ |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1166 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1167 /** |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1168 * Returns the conversation subsystem handle. |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1169 * |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1170 * @return The conversation subsystem handle. |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1171 */ |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1172 void *gaim_conversations_get_handle(void); |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1173 |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1174 /** |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1175 * Initializes the conversation subsystem. |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1176 */ |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1177 void gaim_conversations_init(void); |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1178 |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1179 /** |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1180 * Uninitializes the conversation subsystem. |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1181 */ |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6414
diff
changeset
|
1182 void gaim_conversations_uninit(void); |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1183 |
4481
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1184 /*@}*/ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1185 |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1186 #ifdef __cplusplus |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1187 } |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1188 #endif |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1189 |
4890
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4877
diff
changeset
|
1190 #endif /* _GAIM_CONVERSATION_H_ */ |