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