Mercurial > pidgin.yaz
annotate src/conversation.h @ 6440:ded6796da6b9
[gaim-migrate @ 6948]
Etan Reisner with a tab icon update. Thanks.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Tue, 12 Aug 2003 05:44:29 +0000 |
parents | 874a5c9f4eb8 |
children | 70d5122bc3ff |
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 * | |
7 * Copyright (C) 2002-2003, Christian Hammond <chipx86@gnupdate.org> | |
8 * | |
9 * This program is free software; you can redistribute it and/or modify | |
10 * it under the terms of the GNU General Public License as published by | |
11 * the Free Software Foundation; either version 2 of the License, or | |
12 * (at your option) any later version. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program; if not, write to the Free Software | |
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 */ | |
23 | |
4890
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4877
diff
changeset
|
24 #ifndef _GAIM_CONVERSATION_H_ |
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4877
diff
changeset
|
25 #define _GAIM_CONVERSATION_H_ |
4359 | 26 |
27 /**************************************************************************/ | |
28 /** Data Structures */ | |
29 /**************************************************************************/ | |
30 | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
31 typedef struct _GaimWindowUiOps GaimWindowUiOps; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
32 typedef struct _GaimWindow GaimWindow; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
33 typedef struct _GaimConversationUiOps GaimConversationUiOps; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
34 typedef struct _GaimConversation GaimConversation; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
35 typedef struct _GaimIm GaimIm; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
36 typedef struct _GaimChat GaimChat; |
4359 | 37 |
38 /** | |
39 * A type of conversation. | |
40 */ | |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
41 typedef enum |
4359 | 42 { |
43 GAIM_CONV_UNKNOWN = 0, /**< Unknown conversation type. */ | |
44 GAIM_CONV_IM, /**< Instant Message. */ | |
4378
194507c83612
[gaim-migrate @ 4644]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
45 GAIM_CONV_CHAT, /**< Chat room. */ |
194507c83612
[gaim-migrate @ 4644]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
46 GAIM_CONV_MISC /**< A misc. conversation. */ |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
47 |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
48 } GaimConversationType; |
4359 | 49 |
50 /** | |
51 * Unseen text states. | |
52 */ | |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
53 typedef enum |
4359 | 54 { |
55 GAIM_UNSEEN_NONE = 0, /**< No unseen text in the conversation. */ | |
56 GAIM_UNSEEN_TEXT, /**< Unseen text in the conversation. */ | |
6405
96de6d9eb422
[gaim-migrate @ 6910]
Christian Hammond <chipx86@chipx86.com>
parents:
6311
diff
changeset
|
57 GAIM_UNSEEN_NICK, /**< Unseen text and the nick was said. */ |
96de6d9eb422
[gaim-migrate @ 6910]
Christian Hammond <chipx86@chipx86.com>
parents:
6311
diff
changeset
|
58 GAIM_UNSEEN_EVENT /**< Unseen events in the conversation. */ |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
59 |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
60 } GaimUnseenState; |
4359 | 61 |
62 /** | |
63 * Conversation update type. | |
64 */ | |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
65 typedef enum |
4359 | 66 { |
67 GAIM_CONV_UPDATE_ADD = 0, /**< The buddy associated with the conversation | |
68 was added. */ | |
69 GAIM_CONV_UPDATE_REMOVE, /**< The buddy associated with the conversation | |
70 was removed. */ | |
4491 | 71 GAIM_CONV_UPDATE_ACCOUNT, /**< The gaim_account was changed. */ |
4359 | 72 GAIM_CONV_UPDATE_TYPING, /**< The typing state was updated. */ |
73 GAIM_CONV_UPDATE_UNSEEN, /**< The unseen state was updated. */ | |
74 GAIM_CONV_UPDATE_LOGGING, /**< Logging for this conversation was | |
75 enabled or disabled. */ | |
76 GAIM_CONV_UPDATE_TOPIC, /**< The topic for a chat was updated. */ | |
77 | |
78 /* | |
79 * XXX These need to go when we implement a more generic core/UI event | |
80 * system. | |
81 */ | |
4378
194507c83612
[gaim-migrate @ 4644]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
82 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
|
83 GAIM_CONV_ACCOUNT_OFFLINE, /**< One of the user's accounts went offline. */ |
194507c83612
[gaim-migrate @ 4644]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
84 GAIM_CONV_UPDATE_AWAY /**< The other user went away. */ |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
85 |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
86 } GaimConvUpdateType; |
4359 | 87 |
88 /** | |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
89 * The typing state of a user. |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
90 */ |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
91 typedef enum |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
92 { |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
93 GAIM_NOT_TYPING = 0, /**< Not typing. */ |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
94 GAIM_TYPING, /**< Currently typing. */ |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
95 GAIM_TYPED /**< Stopped typing momentarily. */ |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
96 |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
97 } GaimTypingState; |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
98 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
99 #include "account.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
100 #include "server.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
101 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
102 /** |
4359 | 103 * Conversation window operations. |
104 * | |
105 * Any UI representing a window must assign a filled-out gaim_window_ops | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
106 * structure to the GaimWindow. |
4359 | 107 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
108 struct _GaimWindowUiOps |
4359 | 109 { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
110 GaimConversationUiOps *(*get_conversation_ui_ops)(void); |
4359 | 111 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
112 void (*new_window)(GaimWindow *win); |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
113 void (*destroy_window)(GaimWindow *win); |
4359 | 114 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
115 void (*show)(GaimWindow *win); |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
116 void (*hide)(GaimWindow *win); |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
117 void (*raise)(GaimWindow *win); |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
118 void (*flash)(GaimWindow *win); |
4359 | 119 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
120 void (*switch_conversation)(GaimWindow *win, unsigned int index); |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
121 void (*add_conversation)(GaimWindow *win, GaimConversation *conv); |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
122 void (*remove_conversation)(GaimWindow *win, GaimConversation *conv); |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
123 void (*move_conversation)(GaimWindow *win, GaimConversation *conv, |
4359 | 124 unsigned int newIndex); |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
125 int (*get_active_index)(const GaimWindow *win); |
4359 | 126 }; |
127 | |
128 /** | |
129 * Conversation operations and events. | |
130 * | |
131 * Any UI representing a conversation must assign a filled-out | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
132 * GaimConversationUiOps structure to the GaimConversation. |
4359 | 133 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
134 struct _GaimConversationUiOps |
4359 | 135 { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
136 void (*destroy_conversation)(GaimConversation *conv); |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
137 void (*write_chat)(GaimConversation *conv, const char *who, |
4359 | 138 const char *message, int flags, time_t mtime); |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
139 void (*write_im)(GaimConversation *conv, const char *who, |
4359 | 140 const char *message, size_t len, int flags, time_t mtime); |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
141 void (*write_conv)(GaimConversation *conv, const char *who, |
4359 | 142 const char *message, size_t length, int flags, |
143 time_t mtime); | |
144 | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
145 void (*chat_add_user)(GaimConversation *conv, const char *user); |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
146 void (*chat_add_users)(GaimConversation *conv, GList *users); |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
147 void (*chat_rename_user)(GaimConversation *conv, |
4359 | 148 const char *old_name, const char *new_name); |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
149 void (*chat_remove_user)(GaimConversation *conv, const char *user); |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
150 void (*chat_remove_users)(GaimConversation *conv, GList *users); |
4359 | 151 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
152 void (*set_title)(GaimConversation *conv, const char *title); |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
153 void (*update_progress)(GaimConversation *conv, float percent); |
4359 | 154 |
155 /* Events */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
156 void (*updated)(GaimConversation *conv, GaimConvUpdateType type); |
4359 | 157 }; |
158 | |
159 /** | |
160 * A core representation of a graphical window containing one or more | |
161 * conversations. | |
162 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
163 struct _GaimWindow |
4359 | 164 { |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
165 GList *conversations; /**< The conversations in the window. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
166 size_t conversation_count; /**< The number of conversations. */ |
4359 | 167 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
168 GaimWindowUiOps *ui_ops; /**< UI-specific window operations. */ |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
169 void *ui_data; /**< UI-specific data. */ |
4359 | 170 }; |
171 | |
172 /** | |
173 * Data specific to Instant Messages. | |
174 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
175 struct _GaimIm |
4359 | 176 { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
177 GaimConversation *conv; /**< The parent conversation. */ |
4359 | 178 |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
179 GaimTypingState typing_state; /**< The current typing state. */ |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
180 guint typing_timeout; /**< The typing timer handle. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
181 time_t type_again; /**< The type again time. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
182 guint type_again_timeout; /**< The type again timer handle. */ |
4359 | 183 |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
184 GSList *images; /**< A list of images in the IM. */ |
4359 | 185 }; |
186 | |
187 /** | |
188 * Data specific to Chats. | |
189 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
190 struct _GaimChat |
4359 | 191 { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
192 GaimConversation *conv; /**< The parent conversation. */ |
4359 | 193 |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
194 GList *in_room; /**< The users in the room. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
195 GList *ignored; /**< Ignored users. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
196 char *who; /**< The person who set the topic. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
197 char *topic; /**< The topic. */ |
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
198 int id; /**< The chat ID. */ |
4359 | 199 }; |
200 | |
201 /** | |
202 * A core representation of a conversation between two or more people. | |
203 * | |
204 * The conversation can be an IM or a chat. Each conversation is kept | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
205 * in a GaimWindow and has a UI representation. |
4359 | 206 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
207 struct _GaimConversation |
4359 | 208 { |
209 GaimConversationType type; /**< The type of conversation. */ | |
210 | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
211 GaimAccount *account; /**< The user using this conversation. */ |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
212 GaimWindow *window; /**< The parent window. */ |
4359 | 213 |
214 int conversation_pos; /**< The position in the window's list. */ | |
215 | |
216 char *name; /**< The name of the conversation. */ | |
217 char *title; /**< The window title. */ | |
218 | |
219 gboolean logging; /**< The status of logging. */ | |
220 | |
221 GList *send_history; /**< The send history. */ | |
222 GString *history; /**< The conversation history. */ | |
223 | |
224 GaimUnseenState unseen; /**< The unseen tab state. */ | |
225 | |
226 union | |
227 { | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
228 GaimIm *im; /**< IM-specific data. */ |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
229 GaimChat *chat; /**< Chat-specific data. */ |
4378
194507c83612
[gaim-migrate @ 4644]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
230 void *misc; /**< Misc. data. */ |
4359 | 231 |
232 } u; | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
233 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
234 GaimConversationUiOps *ui_ops; /**< UI-specific operations. */ |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4378
diff
changeset
|
235 void *ui_data; /**< UI-specific data. */ |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
236 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
237 GHashTable *data; /**< Plugin-specific data. */ |
4359 | 238 }; |
239 | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
240 typedef void (*GaimConvPlacementFunc)(GaimConversation *); |
4359 | 241 |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
242 #ifdef __cplusplus |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
243 extern "C" { |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
244 #endif |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
245 |
4359 | 246 /**************************************************************************/ |
247 /** @name Conversation Window API */ | |
248 /**************************************************************************/ | |
249 /*@{*/ | |
250 | |
251 /** | |
252 * Creates a new conversation window. | |
253 * | |
254 * This window is added to the list of windows, but is not shown until | |
255 * gaim_window_show() is called. | |
256 * | |
257 * @return The new conversation window. | |
258 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
259 GaimWindow *gaim_window_new(void); |
4359 | 260 |
261 /** | |
262 * Destroys the specified conversation window and all conversations in it. | |
263 * | |
264 * @param win The window to destroy. | |
265 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
266 void gaim_window_destroy(GaimWindow *win); |
4359 | 267 |
268 /** | |
269 * Shows the specified conversation window. | |
270 * | |
271 * @param win The window. | |
272 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
273 void gaim_window_show(GaimWindow *win); |
4359 | 274 |
275 /** | |
276 * Hides the specified conversation window. | |
277 * | |
278 * @param win The window. | |
279 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
280 void gaim_window_hide(GaimWindow *win); |
4359 | 281 |
282 /** | |
283 * Raises the specified conversation window. | |
284 * | |
285 * @param win The window. | |
286 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
287 void gaim_window_raise(GaimWindow *win); |
4359 | 288 |
289 /** | |
290 * Causes the window to flash for IM notification, if the UI supports this. | |
291 * | |
292 * @param win The window. | |
293 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
294 void gaim_window_flash(GaimWindow *win); |
4359 | 295 |
296 /** | |
297 * Sets the specified window's UI window operations structure. | |
298 * | |
299 * @param win The window. | |
300 * @param ops The UI window operations structure. | |
301 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
302 void gaim_window_set_ui_ops(GaimWindow *win, GaimWindowUiOps *ops); |
4359 | 303 |
304 /** | |
305 * Returns the specified window's UI window operations structure. | |
306 * | |
307 * @param win The window. | |
308 * | |
309 * @return The UI window operations structure. | |
310 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
311 GaimWindowUiOps *gaim_window_get_ui_ops(const GaimWindow *win); |
4359 | 312 |
313 /** | |
314 * Adds a conversation to this window. | |
315 * | |
316 * If the conversation already has a parent window, this will do nothing. | |
317 * | |
318 * @param win The window. | |
319 * @param conv The conversation. | |
320 * | |
321 * @return The new index of the conversation in the window. | |
322 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
323 int gaim_window_add_conversation(GaimWindow *win, GaimConversation *conv); |
4359 | 324 |
325 /** | |
326 * Removes the conversation at the specified index from the window. | |
327 * | |
328 * If there is no conversation at this index, this will do nothing. | |
329 * | |
330 * @param win The window. | |
331 * @param index The index of the conversation. | |
332 * | |
333 * @return The conversation removed. | |
334 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
335 GaimConversation *gaim_window_remove_conversation(GaimWindow *win, |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
336 unsigned int index); |
4359 | 337 |
338 /** | |
339 * Moves the conversation at the specified index in a window to a new index. | |
340 * | |
341 * @param win The window. | |
342 * @param index The index of the conversation to move. | |
343 * @param new_index The new index. | |
344 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
345 void gaim_window_move_conversation(GaimWindow *win, unsigned int index, |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
346 unsigned int new_index); |
4359 | 347 |
348 /** | |
349 * Returns the conversation in the window at the specified index. | |
350 * | |
351 * If the index is out of range, this returns @c NULL. | |
352 * | |
353 * @param win The window. | |
354 * @param index The index containing a conversation. | |
355 * | |
356 * @return The conversation at the specified index. | |
357 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
358 GaimConversation *gaim_window_get_conversation_at(const GaimWindow *win, |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
359 unsigned int index); |
4359 | 360 |
361 /** | |
362 * Returns the number of conversations in the window. | |
363 * | |
364 * @param win The window. | |
365 * | |
366 * @return The number of conversations. | |
367 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
368 size_t gaim_window_get_conversation_count(const GaimWindow *win); |
4359 | 369 |
370 /** | |
371 * Switches the active conversation to the one at the specified index. | |
372 * | |
373 * If @a index is out of range, this does nothing. | |
374 * | |
375 * @param win The window. | |
376 * @param index The new index. | |
377 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
378 void gaim_window_switch_conversation(GaimWindow *win, unsigned int index); |
4359 | 379 |
380 /** | |
381 * Returns the active conversation in the window. | |
382 * | |
383 * @param win The window. | |
384 * | |
385 * @return The active conversation. | |
386 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
387 GaimConversation *gaim_window_get_active_conversation(const GaimWindow *win); |
4359 | 388 |
389 /** | |
390 * Returns the list of conversations in the specified window. | |
391 * | |
392 * @param win The window. | |
393 * | |
394 * @return The list of conversations. | |
395 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
396 GList *gaim_window_get_conversations(const GaimWindow *win); |
4359 | 397 |
398 /** | |
399 * Returns a list of all windows. | |
400 * | |
401 * @return A list of windows. | |
402 */ | |
403 GList *gaim_get_windows(void); | |
404 | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
405 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
406 * Returns the first window containing a conversation of the specified type. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
407 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
408 * @param type The conversation type. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
409 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
410 * @return The window if found, or @c NULL if not found. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
411 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
412 GaimWindow *gaim_get_first_window_with_type(GaimConversationType type); |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
413 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
414 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
415 * Returns the last window containing a conversation of the specified type. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
416 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
417 * @param type The conversation type. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
418 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
419 * @return The window if found, or @c NULL if not found. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
420 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
421 GaimWindow *gaim_get_last_window_with_type(GaimConversationType type); |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
422 |
4359 | 423 /*@}*/ |
424 | |
425 /**************************************************************************/ | |
426 /** @name Conversation API */ | |
427 /**************************************************************************/ | |
428 /*@{*/ | |
429 | |
430 /** | |
431 * Creates a new conversation of the specified type. | |
432 * | |
433 * @param type The type of conversation. | |
4476
62c1e5e656d0
[gaim-migrate @ 4751]
Christian Hammond <chipx86@chipx86.com>
parents:
4469
diff
changeset
|
434 * @param user The account opening the conversation window on the gaim |
62c1e5e656d0
[gaim-migrate @ 4751]
Christian Hammond <chipx86@chipx86.com>
parents:
4469
diff
changeset
|
435 * user's end. |
4359 | 436 * @param name The name of the conversation. |
437 * | |
438 * @return The new conversation. | |
439 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
440 GaimConversation *gaim_conversation_new(GaimConversationType type, |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
441 GaimAccount *account, |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
442 const char *name); |
4359 | 443 |
444 /** | |
445 * Destroys the specified conversation and removes it from the parent | |
446 * window. | |
447 * | |
448 * If this conversation is the only one contained in the parent window, | |
449 * that window is also destroyed. | |
450 * | |
451 * @param conv The conversation to destroy. | |
452 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
453 void gaim_conversation_destroy(GaimConversation *conv); |
4359 | 454 |
455 /** | |
456 * Returns the specified conversation's type. | |
457 * | |
458 * @param conv The conversation. | |
459 * | |
460 * @return The conversation's type. | |
461 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
462 GaimConversationType gaim_conversation_get_type(const GaimConversation *conv); |
4359 | 463 |
464 /** | |
465 * Sets the specified conversation's UI operations structure. | |
466 * | |
467 * @param conv The conversation. | |
468 * @param ops The UI conversation operations structure. | |
469 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
470 void gaim_conversation_set_ui_ops(GaimConversation *conv, |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
471 GaimConversationUiOps *ops); |
4359 | 472 |
473 /** | |
474 * Returns the specified conversation's UI operations structure. | |
475 * | |
476 * @param conv The conversation. | |
477 * | |
478 * @return The operations structure. | |
479 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
480 GaimConversationUiOps *gaim_conversation_get_ui_ops( |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
481 const GaimConversation *conv); |
4359 | 482 |
483 /** | |
4491 | 484 * Sets the specified conversation's gaim_account. |
4359 | 485 * |
4491 | 486 * This gaim_account represents the user using gaim, not the person the user |
4359 | 487 * is having a conversation/chat/flame with. |
488 * | |
489 * @param conv The conversation. | |
4491 | 490 * @param account The gaim_account. |
4359 | 491 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
492 void gaim_conversation_set_account(GaimConversation *conv, |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
493 GaimAccount *account); |
4359 | 494 |
495 /** | |
4491 | 496 * Returns the specified conversation's gaim_account. |
4359 | 497 * |
4491 | 498 * This gaim_account represents the user using gaim, not the person the user |
4359 | 499 * is having a conversation/chat/flame with. |
500 * | |
501 * @param conv The conversation. | |
502 * | |
4491 | 503 * @return The conversation's gaim_account. |
4359 | 504 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
505 GaimAccount *gaim_conversation_get_account(const GaimConversation *conv); |
4359 | 506 |
507 /** | |
508 * Returns the specified conversation's gaim_connection. | |
509 * | |
510 * This is the same as gaim_conversation_get_user(conv)->gc. | |
511 * | |
512 * @param conv The conversation. | |
513 * | |
514 * @return The conversation's gaim_connection. | |
515 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
516 GaimConnection *gaim_conversation_get_gc(const GaimConversation *conv); |
4359 | 517 |
518 /** | |
519 * Sets the specified conversation's title. | |
520 * | |
521 * @param conv The conversation. | |
522 * @param title The title. | |
523 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
524 void gaim_conversation_set_title(GaimConversation *conv, const char *title); |
4359 | 525 |
526 /** | |
527 * Returns the specified conversation's title. | |
528 * | |
529 * @param win The conversation. | |
530 * | |
531 * @return The title. | |
532 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
533 const char *gaim_conversation_get_title(const GaimConversation *conv); |
4359 | 534 |
535 /** | |
536 * Automatically sets the specified conversation's title. | |
537 * | |
538 * This function takes OPT_IM_ALIAS_TAB into account, as well as the | |
539 * user's alias. | |
540 * | |
541 * @param conv The conversation. | |
542 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
543 void gaim_conversation_autoset_title(GaimConversation *conv); |
4359 | 544 |
545 /** | |
546 * Returns the specified conversation's index in the parent window. | |
547 * | |
548 * @param conv The conversation. | |
549 * | |
550 * @return The current index in the parent window. | |
551 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
552 int gaim_conversation_get_index(const GaimConversation *conv); |
4359 | 553 |
554 /** | |
555 * Sets the conversation's unseen state. | |
556 * | |
557 * @param conv The conversation. | |
558 * @param state The new unseen state. | |
559 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
560 void gaim_conversation_set_unseen(GaimConversation *conv, |
4359 | 561 GaimUnseenState state); |
562 | |
563 /** | |
564 * Returns the conversation's unseen state. | |
565 * | |
566 * @param conv The conversation. | |
567 * | |
568 * @param The conversation's unseen state. | |
569 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
570 GaimUnseenState gaim_conversation_get_unseen(const GaimConversation *conv); |
4359 | 571 |
572 /** | |
573 * Returns the specified conversation's name. | |
574 * | |
575 * @param conv The conversation. | |
576 * | |
577 * @return The conversation's name. | |
578 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
579 const char *gaim_conversation_get_name(const GaimConversation *conv); |
4359 | 580 |
581 /** | |
582 * Enables or disables logging for this conversation. | |
583 * | |
584 * @param log @c TRUE if logging should be enabled, or @c FALSE otherwise. | |
585 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
586 void gaim_conversation_set_logging(GaimConversation *conv, gboolean log); |
4359 | 587 |
588 /** | |
589 * Returns whether or not logging is enabled for this conversation. | |
590 * | |
591 * @return @c TRUE if logging is enabled, or @c FALSE otherwise. | |
592 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
593 gboolean gaim_conversation_is_logging(const GaimConversation *conv); |
4359 | 594 |
595 /** | |
596 * Returns the specified conversation's send history. | |
597 * | |
598 * @param conv The conversation. | |
599 * | |
600 * @return The conversation's send history. | |
601 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
602 GList *gaim_conversation_get_send_history(const GaimConversation *conv); |
4359 | 603 |
604 /** | |
605 * Sets the specified conversation's history. | |
606 * | |
607 * @param conv The conversation. | |
608 * @param history The history. | |
609 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
610 void gaim_conversation_set_history(GaimConversation *conv, GString *history); |
4359 | 611 |
612 /** | |
613 * Returns the specified conversation's history. | |
614 * | |
615 * @param conv The conversation. | |
616 * | |
617 * @return The conversation's history. | |
618 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
619 GString *gaim_conversation_get_history(const GaimConversation *conv); |
4359 | 620 |
621 /** | |
622 * Returns the specified conversation's parent window. | |
623 * | |
624 * @param conv The conversation. | |
625 * | |
626 * @return The conversation's parent window. | |
627 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
628 GaimWindow *gaim_conversation_get_window(const GaimConversation *conv); |
4359 | 629 |
630 /** | |
631 * Returns the specified conversation's IM-specific data. | |
632 * | |
633 * If the conversation type is not GAIM_CONV_IM, this will return @c NULL. | |
634 * | |
635 * @param conv The conversation. | |
636 * | |
637 * @return The IM-specific data. | |
638 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
639 GaimIm *gaim_conversation_get_im_data(const GaimConversation *conv); |
4359 | 640 |
641 #define GAIM_IM(c) (gaim_conversation_get_im_data(c)) | |
642 | |
643 /** | |
644 * Returns the specified conversation's chat-specific data. | |
645 * | |
646 * If the conversation type is not GAIM_CONV_CHAT, this will return @c NULL. | |
647 * | |
648 * @param conv The conversation. | |
649 * | |
650 * @return The chat-specific data. | |
651 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
652 GaimChat *gaim_conversation_get_chat_data(const GaimConversation *conv); |
4359 | 653 |
654 #define GAIM_CHAT(c) (gaim_conversation_get_chat_data(c)) | |
655 | |
656 /** | |
4877
249382064693
[gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents:
4876
diff
changeset
|
657 * Sets extra data for a conversation. |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
658 * |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
659 * @param conv The conversation. |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
660 * @param key The unique key. |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
661 * @param data The data to assign. |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
662 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
663 void gaim_conversation_set_data(GaimConversation *conv, const char *key, |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
664 gpointer data); |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
665 |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
666 /** |
4877
249382064693
[gaim-migrate @ 5207]
Christian Hammond <chipx86@chipx86.com>
parents:
4876
diff
changeset
|
667 * Returns extra data in a conversation. |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
668 * |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
669 * @param conv The conversation. |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
670 * @param key The unqiue key. |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
671 * |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
672 * @return The data associated with the key. |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
673 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
674 gpointer gaim_conversation_get_data(GaimConversation *conv, const char *key); |
4876
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
675 |
9567b13d0e98
[gaim-migrate @ 5206]
Christian Hammond <chipx86@chipx86.com>
parents:
4491
diff
changeset
|
676 /** |
4359 | 677 * Returns a list of all conversations. |
678 * | |
679 * This list includes both IMs and chats. | |
680 * | |
681 * @return A GList of all conversations. | |
682 */ | |
683 GList *gaim_get_conversations(void); | |
684 | |
685 /** | |
686 * Returns a list of all IMs. | |
687 * | |
688 * @return A GList of all IMs. | |
689 */ | |
690 GList *gaim_get_ims(void); | |
691 | |
692 /** | |
693 * Returns a list of all chats. | |
694 * | |
695 * @return A GList of all chats. | |
696 */ | |
697 GList *gaim_get_chats(void); | |
698 | |
699 /** | |
700 * Finds the conversation with the specified name. | |
701 * | |
702 * @param name The name of the conversation. | |
703 * | |
704 * @return The conversation if found, or @c NULL otherwise. | |
705 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
706 GaimConversation *gaim_find_conversation(const char *name); |
4359 | 707 |
708 /** | |
709 * Finds a conversation with the specified name and user. | |
710 * | |
711 * @param name The name of the conversation. | |
4491 | 712 * @param account The gaim_account associated with the conversation. |
4359 | 713 * |
714 * @return The conversation if found, or @c NULL otherwise. | |
715 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
716 GaimConversation *gaim_find_conversation_with_account( |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5207
diff
changeset
|
717 const char *name, const GaimAccount *account); |
4359 | 718 |
719 /** | |
720 * Writes to a conversation window. | |
721 * | |
722 * This function should not be used to write IM or chat messages. Use | |
723 * gaim_im_write() and gaim_chat_write() instead. Those functions will | |
724 * most likely call this anyway, but they may do their own formatting, | |
725 * sound playback, etc. | |
726 * | |
727 * This can be used to write generic messages, such as "so and so closed | |
728 * the conversation window." | |
729 * | |
730 * @param conv The conversation. | |
731 * @param who The user who sent the message. | |
732 * @param message The message. | |
733 * @param length The length of the message. | |
734 * @param flags The flags. | |
735 * @param mtime The time the message was sent. | |
736 * | |
737 * @see gaim_im_write() | |
738 * @see gaim_chat_write() | |
739 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
740 void gaim_conversation_write(GaimConversation *conv, const char *who, |
4359 | 741 const char *message, size_t length, int flags, |
742 time_t mtime); | |
743 | |
744 /** | |
745 * Updates the progress bar on a conversation window | |
746 * (if one exists in the UI). | |
747 * | |
748 * This is used for loading images typically. | |
749 * | |
750 * @param conv The conversation. | |
751 * @param percent The percentage. | |
752 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
753 void gaim_conversation_update_progress(GaimConversation *conv, float percent); |
4359 | 754 |
755 /** | |
756 * Updates the visual status and UI of a conversation. | |
757 * | |
758 * @param conv The conversation. | |
759 * @param type The update type. | |
760 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
761 void gaim_conversation_update(GaimConversation *conv, GaimConvUpdateType type); |
4359 | 762 |
763 /** | |
764 * Calls a function on each conversation. | |
765 * | |
766 * @param func The function. | |
767 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
768 void gaim_conversation_foreach(void (*func)(GaimConversation *conv)); |
4359 | 769 |
770 /*@}*/ | |
771 | |
772 | |
773 /**************************************************************************/ | |
774 /** @name IM Conversation API */ | |
775 /**************************************************************************/ | |
776 /*@{*/ | |
777 | |
778 /** | |
779 * Gets an IM's parent conversation. | |
780 * | |
781 * @param im The IM. | |
782 * | |
783 * @return The parent conversation. | |
784 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
785 GaimConversation *gaim_im_get_conversation(const GaimIm *im); |
4359 | 786 |
787 /** | |
788 * Sets the IM's typing state. | |
789 * | |
790 * @param im The IM. | |
791 * @param state The typing state. | |
792 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
793 void gaim_im_set_typing_state(GaimIm *im, int state); |
4359 | 794 |
795 /** | |
796 * Returns the IM's typing state. | |
797 * | |
798 * @param im The IM. | |
799 * | |
800 * @return The IM's typing state. | |
801 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
802 int gaim_im_get_typing_state(const GaimIm *im); |
4359 | 803 |
804 /** | |
805 * Starts the IM's typing timeout. | |
806 * | |
807 * @param im The IM. | |
808 * @param timeout The timeout. | |
809 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
810 void gaim_im_start_typing_timeout(GaimIm *im, int timeout); |
4359 | 811 |
812 /** | |
813 * Stops the IM's typing timeout. | |
814 * | |
815 * @param im The IM. | |
816 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
817 void gaim_im_stop_typing_timeout(GaimIm *im); |
4359 | 818 |
819 /** | |
820 * Returns the IM's typing timeout. | |
821 * | |
822 * @param im The IM. | |
823 * | |
824 * @return The timeout. | |
825 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
826 guint gaim_im_get_typing_timeout(const GaimIm *im); |
4359 | 827 |
828 /** | |
829 * Sets the IM's time until it should send another typing notification. | |
830 * | |
831 * @param im The IM. | |
832 * @param val The time. | |
833 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
834 void gaim_im_set_type_again(GaimIm *im, time_t val); |
4359 | 835 |
836 /** | |
837 * Returns the IM's time until it should send another typing notification. | |
838 * | |
839 * @param im The IM. | |
840 * | |
841 * @return The time. | |
842 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
843 time_t gaim_im_get_type_again(const GaimIm *im); |
4359 | 844 |
845 /** | |
846 * Starts the IM's type again timeout. | |
847 * | |
848 * @param im The IM. | |
849 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
850 void gaim_im_start_type_again_timeout(GaimIm *im); |
4359 | 851 |
852 /** | |
853 * Stops the IM's type again timeout. | |
854 * | |
855 * @param im The IM. | |
856 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
857 void gaim_im_stop_type_again_timeout(GaimIm *im); |
4359 | 858 |
859 /** | |
860 * Returns the IM's type again timeout interval. | |
861 * | |
862 * @param im The IM. | |
863 * | |
864 * @return The type again timeout interval. | |
865 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
866 guint gaim_im_get_type_again_timeout(const GaimIm *im); |
4359 | 867 |
868 /** | |
869 * Updates the visual typing notification for an IM conversation. | |
870 * | |
871 * @param im The IM. | |
872 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
873 void gaim_im_update_typing(GaimIm *im); |
4359 | 874 |
875 /** | |
876 * Writes to an IM. | |
877 * | |
878 * The @a len parameter is used for writing binary data, such as an | |
879 * image. If @c message is text, specify -1 for @a len. | |
880 * | |
881 * @param im The IM. | |
882 * @param who The user who sent the message. | |
883 * @param message The message to write. | |
884 * @param len The length of the message, or -1 to specify the length | |
885 * of @a message. | |
886 * @param flag The flags. | |
887 * @param mtime The time the message was sent. | |
888 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
889 void gaim_im_write(GaimIm *im, const char *who, |
4359 | 890 const char *message, size_t len, int flag, time_t mtime); |
891 | |
892 /** | |
893 * Sends a message to this IM conversation. | |
894 * | |
895 * @param im The IM. | |
896 * @param message The message to send. | |
897 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
898 void gaim_im_send(GaimIm *im, const char *message); |
4359 | 899 |
900 /*@}*/ | |
901 | |
902 | |
903 /**************************************************************************/ | |
904 /** @name Chat Conversation API */ | |
905 /**************************************************************************/ | |
906 /*@{*/ | |
907 | |
908 /** | |
909 * Gets a chat's parent conversation. | |
910 * | |
911 * @param chat The chat. | |
912 * | |
913 * @return The parent conversation. | |
914 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
915 GaimConversation *gaim_chat_get_conversation(const GaimChat *chat); |
4359 | 916 |
917 /** | |
918 * Sets the list of users in the chat room. | |
919 * | |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
920 * @note Calling this function will not update the display of the users. |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
921 * Please use gaim_chat_add_user(), gaim_chat_add_users(), |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
922 * gaim_chat_remove_user(), and gaim_chat_remove_users() instead. |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
923 * |
4359 | 924 * @param chat The chat. |
925 * @param users The list of users. | |
926 * | |
927 * @return The list passed. | |
928 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
929 GList *gaim_chat_set_users(GaimChat *chat, GList *users); |
4359 | 930 |
931 /** | |
932 * Returns a list of users in the chat room. | |
933 * | |
934 * @param chat The chat. | |
935 * | |
936 * @return The list of users. | |
937 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
938 GList *gaim_chat_get_users(const GaimChat *chat); |
4359 | 939 |
940 /** | |
941 * Ignores a user in a chat room. | |
942 * | |
943 * @param chat The chat. | |
944 * @param name The name of the user. | |
945 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
946 void gaim_chat_ignore(GaimChat *chat, const char *name); |
4359 | 947 |
948 /** | |
949 * Unignores a user in a chat room. | |
950 * | |
951 * @param chat The chat. | |
952 * @param name The name of the user. | |
953 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
954 void gaim_chat_unignore(GaimChat *chat, const char *name); |
4359 | 955 |
956 /** | |
957 * Sets the list of ignored users in the chat room. | |
958 * | |
959 * @param chat The chat. | |
960 * @param ignored The list of ignored users. | |
961 * | |
962 * @return The list passed. | |
963 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
964 GList *gaim_chat_set_ignored(GaimChat *chat, GList *ignored); |
4359 | 965 |
966 /** | |
967 * Returns the list of ignored users in the chat room. | |
968 * | |
969 * @param chat The chat. | |
970 * | |
971 * @return The list of ignored users. | |
972 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
973 GList *gaim_chat_get_ignored(const GaimChat *chat); |
4359 | 974 |
975 /** | |
976 * Returns the actual name of the specified ignored user, if it exists in | |
977 * the ignore list. | |
978 * | |
979 * If the user found contains a prefix, such as '+' or '\@', this is also | |
980 * returned. The username passed to the function does not have to have this | |
981 * formatting. | |
982 * | |
983 * @param chat The chat. | |
984 * @param user The user to check in the ignore list. | |
985 * | |
986 * @return The ignored user if found, complete with prefixes, or @c NULL | |
987 * if not found. | |
988 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
989 const char *gaim_chat_get_ignored_user(const GaimChat *chat, |
4359 | 990 const char *user); |
991 | |
992 /** | |
993 * Returns @c TRUE if the specified user is ignored. | |
994 * | |
995 * @param chat The chat. | |
996 * @param user The user. | |
997 * | |
998 * @return @c TRUE if the user is in the ignore list; @c FALSE otherwise. | |
999 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1000 gboolean gaim_chat_is_user_ignored(const GaimChat *chat, |
4359 | 1001 const char *user); |
1002 | |
1003 /** | |
1004 * Sets the chat room's topic. | |
1005 * | |
1006 * @param chat The chat. | |
1007 * @param who The user that set the topic. | |
1008 * @param topic The topic. | |
1009 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1010 void gaim_chat_set_topic(GaimChat *chat, const char *who, |
4359 | 1011 const char *topic); |
1012 | |
1013 /** | |
1014 * Returns the chat room's topic. | |
1015 * | |
1016 * @param chat The chat. | |
1017 * | |
1018 * @return The chat's topic. | |
1019 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1020 const char *gaim_chat_get_topic(const GaimChat *chat); |
4359 | 1021 |
1022 /** | |
1023 * Sets the chat room's ID. | |
1024 * | |
1025 * @param chat The chat. | |
1026 * @param id The ID. | |
1027 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1028 void gaim_chat_set_id(GaimChat *chat, int id); |
4359 | 1029 |
1030 /** | |
1031 * Returns the chat room's ID. | |
1032 * | |
1033 * @param chat The chat. | |
1034 * | |
1035 * @return The ID. | |
1036 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1037 int gaim_chat_get_id(const GaimChat *chat); |
4359 | 1038 |
1039 /** | |
1040 * Writes to a chat. | |
1041 * | |
1042 * @param chat The chat. | |
1043 * @param who The user who sent the message. | |
1044 * @param message The message to write. | |
1045 * @param flag The flags. | |
1046 * @param mtime The time the message was sent. | |
1047 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1048 void gaim_chat_write(GaimChat *chat, const char *who, |
4359 | 1049 const char *message, int flag, time_t mtime); |
1050 | |
1051 /** | |
1052 * Sends a message to this chat conversation. | |
1053 * | |
1054 * @param chat The chat. | |
1055 * @param message The message to send. | |
1056 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1057 void gaim_chat_send(GaimChat *chat, const char *message); |
4359 | 1058 |
1059 /** | |
1060 * Adds a user to a chat. | |
1061 * | |
1062 * @param chat The chat. | |
1063 * @param user The user to add. | |
1064 * @param extra_msg An extra message to display with the join message. | |
1065 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1066 void gaim_chat_add_user(GaimChat *chat, const char *user, |
4359 | 1067 const char *extra_msg); |
1068 | |
1069 /** | |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1070 * Adds a list of users to a chat. |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1071 * |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1072 * The data is copied from @a users, so it is up to the developer to |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1073 * free this list after calling this function. |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1074 * |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1075 * @param chat The chat. |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1076 * @param users The list of users to add. |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1077 */ |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1078 void gaim_chat_add_users(GaimChat *chat, GList *users); |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1079 |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1080 /** |
4359 | 1081 * Renames a user in a chat. |
1082 * | |
1083 * @param chat The chat. | |
1084 * @param old_user The old username. | |
1085 * @param new_user The new username. | |
1086 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1087 void gaim_chat_rename_user(GaimChat *chat, const char *old_user, |
4359 | 1088 const char *new_user); |
1089 | |
1090 /** | |
1091 * Removes a user from a chat, optionally with a reason. | |
1092 * | |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1093 * 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
|
1094 * |
4359 | 1095 * @param chat The chat. |
1096 * @param user The user that is being removed. | |
1097 * @param reason The optional reason given for the removal. Can be @c NULL. | |
1098 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1099 void gaim_chat_remove_user(GaimChat *chat, const char *user, |
4359 | 1100 const char *reason); |
1101 | |
1102 /** | |
6407
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1103 * 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
|
1104 * |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1105 * @param chat The chat. |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1106 * @param users The users that are being removed. |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1107 * @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
|
1108 */ |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1109 void gaim_chat_remove_users(GaimChat *chat, GList *users, const char *reason); |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1110 |
ba0b99a72be2
[gaim-migrate @ 6913]
Christian Hammond <chipx86@chipx86.com>
parents:
6405
diff
changeset
|
1111 /** |
6414
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1112 * Clears all users from a chat. |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1113 * |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1114 * @param chat The chat. |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1115 */ |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1116 void gaim_chat_clear_users(GaimChat *chat); |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1117 |
874a5c9f4eb8
[gaim-migrate @ 6921]
Christian Hammond <chipx86@chipx86.com>
parents:
6407
diff
changeset
|
1118 /** |
4359 | 1119 * Finds a chat with the specified chat ID. |
1120 * | |
1121 * @param gc The gaim_connection. | |
1122 * @param id The chat ID. | |
1123 * | |
1124 * @return The chat conversation. | |
1125 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1126 GaimConversation *gaim_find_chat(const GaimConnection *gc, int id); |
4359 | 1127 |
1128 /*@}*/ | |
1129 | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1130 /**************************************************************************/ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1131 /** @name Conversation Placement Functions */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1132 /**************************************************************************/ |
4481
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1133 /*@{*/ |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1134 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1135 /** |
5858 | 1136 * Returns a GList containing the IDs and Names of the registered placement |
1137 * functions. | |
1138 * | |
1139 * @return The list of IDs and names. | |
1140 */ | |
1141 GList *gaim_conv_placement_get_options(void); | |
1142 | |
1143 /** | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1144 * Adds a conversation placement function to the list of possible functions. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1145 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1146 * @param name The name of the function. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1147 * @param fnc A pointer to the function. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1148 */ |
6311
eaeac660c17c
[gaim-migrate @ 6810]
Christian Hammond <chipx86@chipx86.com>
parents:
6063
diff
changeset
|
1149 void gaim_conv_placement_add_fnc(const char *id, const char *name, |
eaeac660c17c
[gaim-migrate @ 6810]
Christian Hammond <chipx86@chipx86.com>
parents:
6063
diff
changeset
|
1150 GaimConvPlacementFunc fnc); |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1151 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1152 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1153 * Removes a conversation placement function from the list of possible |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1154 * functions. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1155 * |
5858 | 1156 * @param id The id of the function. |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1157 */ |
5858 | 1158 void gaim_conv_placement_remove_fnc(const char *id); |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1159 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1160 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1161 * Returns the name of the conversation placement function at the |
5858 | 1162 * specified id. |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1163 * |
5858 | 1164 * @param id The id. |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1165 * |
5858 | 1166 * @return The name of the function, or @c NULL if this id is invalid. |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1167 */ |
5858 | 1168 const char *gaim_conv_placement_get_name(const char *id); |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1169 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1170 /** |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1171 * Returns a pointer to the conversation placement function at the |
5858 | 1172 * specified id. |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1173 * |
5858 | 1174 * @param id The id. |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1175 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1176 * @return A pointer to the function. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1177 */ |
5858 | 1178 GaimConvPlacementFunc gaim_conv_placement_get_fnc(const char *id); |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1179 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1180 /** |
5858 | 1181 * Returns the id of the specified conversation placement function. |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1182 * |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1183 * @param fnc A pointer to the registered function. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1184 * |
5858 | 1185 * @return The id of the conversation, or NULL if the function is not |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1186 * registered. |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1187 */ |
5858 | 1188 const char *gaim_conv_placement_get_fnc_id(GaimConvPlacementFunc fnc); |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4465
diff
changeset
|
1189 |
4481
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1190 /*@}*/ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1191 |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1192 /**************************************************************************/ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1193 /** @name UI Registration Functions */ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1194 /**************************************************************************/ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1195 /*@{*/ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1196 |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1197 /** |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1198 * Sets the UI operations structure to be used in all gaim conversation |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1199 * windows. |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1200 * |
5207
2819f90a20ba
[gaim-migrate @ 5575]
Christian Hammond <chipx86@chipx86.com>
parents:
5034
diff
changeset
|
1201 * @param ops The UI operations structure. |
4481
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1202 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1203 void gaim_set_win_ui_ops(GaimWindowUiOps *ops); |
4481
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1204 |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1205 /** |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1206 * Returns the gaim window UI operations structure to be used in |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1207 * new windows. |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1208 * |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1209 * @return A filled-out GaimWindowUiOps structure. |
4481
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1210 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
1211 GaimWindowUiOps *gaim_get_win_ui_ops(void); |
4481
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1212 |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1213 /** |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1214 * Initializes the conversation subsystem. |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1215 */ |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1216 void gaim_conversation_init(void); |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5858
diff
changeset
|
1217 |
4481
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1218 /*@}*/ |
b30b0a02ada0
[gaim-migrate @ 4756]
Christian Hammond <chipx86@chipx86.com>
parents:
4476
diff
changeset
|
1219 |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1220 #ifdef __cplusplus |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1221 } |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1222 #endif |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1223 |
4890
89cb14edf8cf
[gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
4877
diff
changeset
|
1224 #endif /* _GAIM_CONVERSATION_H_ */ |