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