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