Mercurial > pidgin
annotate src/prpl.h @ 13723:1983a8fc8e72
[gaim-migrate @ 16132]
Make the ntlm code a little cleaner (to me, anyway). Add some helpful
comments (to me, anyway). And hopefully fix a bug or two (hostname,
domain, and username are all sent as UCS-2LE now).
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 04 May 2006 00:33:33 +0000 |
parents | 1ca4a579eb57 |
children | a9ff4499d9ce |
rev | line source |
---|---|
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
1 /** |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
2 * @file prpl.h Protocol Plugin functions |
5034
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
4966
diff
changeset
|
3 * @ingroup core |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
4 * |
981 | 5 * gaim |
6 * | |
8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
6451
6f16136b41e5
[gaim-migrate @ 6960]
Christian Hammond <chipx86@chipx86.com>
parents:
6418
diff
changeset
|
10 * |
981 | 11 * This program is free software; you can redistribute it and/or modify |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
25 | |
2417
5473c8c5378d
[gaim-migrate @ 2430]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2411
diff
changeset
|
26 /* this file should be all that prpls need to include. therefore, by including |
5473c8c5378d
[gaim-migrate @ 2430]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2411
diff
changeset
|
27 * this file, they should get glib, proxy, gaim_connection, prpl, etc. */ |
981 | 28 |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
29 #ifndef _GAIM_PRPL_H_ |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
30 #define _GAIM_PRPL_H_ |
2417
5473c8c5378d
[gaim-migrate @ 2430]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2411
diff
changeset
|
31 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
32 typedef struct _GaimPluginProtocolInfo GaimPluginProtocolInfo; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
33 |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
34 /**************************************************************************/ |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
35 /** @name Basic Protocol Information */ |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
36 /**************************************************************************/ |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
37 |
9318 | 38 typedef enum { |
39 GAIM_ICON_SCALE_DISPLAY = 0x01, /**< We scale the icon when we display it */ | |
40 GAIM_ICON_SCALE_SEND = 0x02 /**< We scale the icon before we send it to the server */ | |
41 } GaimIconScaleRules; | |
42 | |
43 | |
9308 | 44 /** |
45 * A description of a Buddy Icon specification. This tells Gaim what kind of image file | |
46 * it should give this prpl, and what kind of image file it should expect back. | |
9316 | 47 * Dimensions less than 1 should be ignored and the image not scaled. |
9308 | 48 */ |
49 typedef struct { | |
13327 | 50 char *format; /**< This is a comma-delimited list of image formats or NULL if icons are not supported. |
9308 | 51 * The core nor the prpl will actually check to see if the data it's given matches this, it's entirely |
52 * up to the UI to do what it wants */ | |
9318 | 53 int min_width; /**< The minimum width of this icon */ |
54 int min_height; /**< The minimum height of this icon */ | |
55 int max_width; /**< The maximum width of this icon */ | |
56 int max_height; /**< The maximum height of this icon */ | |
57 GaimIconScaleRules scale_rules; /**< How to stretch this icon */ | |
9308 | 58 } GaimBuddyIconSpec; |
59 | |
9999 | 60 /** |
11035
11e465b55fe6
[gaim-migrate @ 12922]
Gary Kramlich <grim@reaperworld.com>
parents:
10870
diff
changeset
|
61 * This \#define exists just to make it easier to fill out the buddy icon |
9999 | 62 * field in the prpl info struct for protocols that couldn't care less. |
63 */ | |
9318 | 64 #define NO_BUDDY_ICONS {NULL, 0, 0, 0, 0, 0} |
9308 | 65 |
8573 | 66 #include "blist.h" |
12216 | 67 #include "conversation.h" |
12143
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
12024
diff
changeset
|
68 #include "ft.h" |
8573 | 69 #include "proxy.h" |
70 #include "plugin.h" | |
9999 | 71 #include "roomlist.h" |
9944 | 72 #include "status.h" |
11475
7fab28c991f3
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11462
diff
changeset
|
73 #include "whiteboard.h" |
8573 | 74 |
9713 | 75 struct proto_chat_entry { |
13106
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12970
diff
changeset
|
76 const char *label; |
a0a4b44239e8
[gaim-migrate @ 15468]
Richard Laager <rlaager@wiktel.com>
parents:
12970
diff
changeset
|
77 const char *identifier; |
10475 | 78 gboolean required; |
9713 | 79 gboolean is_int; |
80 int min; | |
81 int max; | |
82 gboolean secret; | |
83 }; | |
84 | |
6622 | 85 /** |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
86 * Protocol options |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
87 * |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
88 * These should all be stuff that some plugins can do and others can't. |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
89 */ |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
90 typedef enum |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
91 { |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
92 /** |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
93 * Use a unique name, not an alias, for chat rooms. |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
94 * |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
95 * Jabber lets you choose what name you want for chat. |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
96 * So it shouldn't be pulling the alias for when you're in chat; |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
97 * it gets annoying. |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
98 */ |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
99 OPT_PROTO_UNIQUE_CHATNAME = 0x00000004, |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
100 |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
101 /** |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
102 * Chat rooms have topics. |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
103 * |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
104 * IRC and Jabber support this. |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
105 */ |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
106 OPT_PROTO_CHAT_TOPIC = 0x00000008, |
1370
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
107 |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
108 /** |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
109 * Don't require passwords for sign-in. |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
110 * |
9999 | 111 * Zephyr doesn't require passwords, so there's no |
112 * need for a password prompt. | |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
113 */ |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
114 OPT_PROTO_NO_PASSWORD = 0x00000010, |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
115 |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
116 /** |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
117 * Notify on new mail. |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
118 * |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
119 * MSN and Yahoo notify you when you have new mail. |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
120 */ |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
121 OPT_PROTO_MAIL_CHECK = 0x00000020, |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
122 |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
123 /** |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
124 * Images in IMs. |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
125 * |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
126 * Oscar lets you send images in direct IMs. |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
127 */ |
9999 | 128 OPT_PROTO_IM_IMAGE = 0x00000040, |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
129 |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
130 /** |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
131 * Allow passwords to be optional. |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
132 * |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
133 * Passwords in IRC are optional, and are needed for certain |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
134 * functionality. |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
135 */ |
9999 | 136 OPT_PROTO_PASSWORD_OPTIONAL = 0x00000080, |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
137 |
5367 | 138 /** |
139 * Allows font size to be specified in sane point size | |
140 * | |
141 * Probably just Jabber and Y!M | |
142 */ | |
11358 | 143 OPT_PROTO_USE_POINTSIZE = 0x00000100, |
144 | |
145 /** | |
146 * Set the Register button active when screenname is not given. | |
147 * | |
148 * Gadu-Gadu doesn't need a screenname to register new account. | |
149 */ | |
150 OPT_PROTO_REGISTER_NOSCREENNAME = 0x00000200, | |
5367 | 151 |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
152 } GaimProtocolOptions; |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
153 |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
154 /** |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
155 * A protocol plugin information structure. |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
156 * |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
157 * Every protocol plugin initializes this structure. It is the gateway |
10160 | 158 * between gaim and the protocol plugin. Many of this callbacks can be |
10162 | 159 * NULL. If a callback must be implemented, it has a comment indicating so. |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
160 */ |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
161 struct _GaimPluginProtocolInfo |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
162 { |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
163 GaimProtocolOptions options; /**< Protocol options. */ |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
164 |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
165 GList *user_splits; /* A GList of GaimAccountUserSplit */ |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
166 GList *protocol_options; /* A GList of GaimAccountOption */ |
10160 | 167 |
9308 | 168 GaimBuddyIconSpec icon_spec; /* The icon spec. */ |
10160 | 169 |
6451
6f16136b41e5
[gaim-migrate @ 6960]
Christian Hammond <chipx86@chipx86.com>
parents:
6418
diff
changeset
|
170 /** |
6f16136b41e5
[gaim-migrate @ 6960]
Christian Hammond <chipx86@chipx86.com>
parents:
6418
diff
changeset
|
171 * Returns the base icon name for the given buddy and account. |
10160 | 172 * If buddy is NULL, it will return the name to use for the account's |
173 * icon. This must be implemented. | |
4687 | 174 */ |
6695 | 175 const char *(*list_icon)(GaimAccount *account, GaimBuddy *buddy); |
4687 | 176 |
177 /** | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
178 * Fills the four char**'s with string identifiers for "emblems" |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
179 * that the UI will interpret and display as relevant |
4687 | 180 */ |
9952 | 181 void (*list_emblems)(GaimBuddy *buddy, const char **se, const char **sw, |
182 const char **nw, const char **ne); | |
4722 | 183 |
184 /** | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
185 * Gets a short string representing this buddy's status. This will |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
186 * be shown on the buddy list. |
4722 | 187 */ |
6695 | 188 char *(*status_text)(GaimBuddy *buddy); |
6451
6f16136b41e5
[gaim-migrate @ 6960]
Christian Hammond <chipx86@chipx86.com>
parents:
6418
diff
changeset
|
189 |
4724 | 190 /** |
12970
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12943
diff
changeset
|
191 * Allows the prpl to add text to a buddy's tooltip. |
4724 | 192 */ |
12970
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12943
diff
changeset
|
193 void (*tooltip_text)(GaimBuddy *buddy, GString *str, gboolean full); |
6451
6f16136b41e5
[gaim-migrate @ 6960]
Christian Hammond <chipx86@chipx86.com>
parents:
6418
diff
changeset
|
194 |
10200 | 195 /** |
196 * This must be implemented, and must add at least the offline | |
197 * and online states. | |
198 */ | |
9950 | 199 GList *(*status_types)(GaimAccount *account); |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
200 |
9030 | 201 GList *(*blist_node_menu)(GaimBlistNode *node); |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
202 GList *(*chat_info)(GaimConnection *); |
9754 | 203 GHashTable *(*chat_info_defaults)(GaimConnection *, const char *chat_name); |
1333
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1318
diff
changeset
|
204 |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
205 /* All the server-related functions */ |
10160 | 206 |
207 /** This must be implemented. */ | |
11837 | 208 void (*login)(GaimAccount *); |
10160 | 209 |
210 /** This must be implemented. */ | |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
211 void (*close)(GaimConnection *); |
11693 | 212 |
213 /** | |
214 * This PRPL function should return a positive value on success. | |
215 * If the message is too big to be sent, return -E2BIG. If | |
216 * the account is not connected, return -ENOTCONN. If the | |
217 * PRPL is unable to send the message for another reason, return | |
218 * some other negative value. You can use one of the valid | |
219 * errno values, or just big something. If the message should | |
220 * not be echoed to the conversation window, return 0. | |
221 */ | |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
222 int (*send_im)(GaimConnection *, const char *who, |
6982 | 223 const char *message, |
12216 | 224 GaimMessageFlags flags); |
11693 | 225 |
5954 | 226 void (*set_info)(GaimConnection *, const char *info); |
6059 | 227 int (*send_typing)(GaimConnection *, const char *name, int typing); |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
228 void (*get_info)(GaimConnection *, const char *who); |
9949 | 229 void (*set_status)(GaimAccount *account, GaimStatus *status); |
230 | |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
231 void (*set_idle)(GaimConnection *, int idletime); |
5946
209cae24a51d
[gaim-migrate @ 6387]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
232 void (*change_passwd)(GaimConnection *, const char *old_pass, |
209cae24a51d
[gaim-migrate @ 6387]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
233 const char *new_pass); |
9285 | 234 void (*add_buddy)(GaimConnection *, GaimBuddy *buddy, GaimGroup *group); |
235 void (*add_buddies)(GaimConnection *, GList *buddies, GList *groups); | |
236 void (*remove_buddy)(GaimConnection *, GaimBuddy *buddy, GaimGroup *group); | |
237 void (*remove_buddies)(GaimConnection *, GList *buddies, GList *groups); | |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
238 void (*add_permit)(GaimConnection *, const char *name); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
239 void (*add_deny)(GaimConnection *, const char *name); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
240 void (*rem_permit)(GaimConnection *, const char *name); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
241 void (*rem_deny)(GaimConnection *, const char *name); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
242 void (*set_permit_deny)(GaimConnection *); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
243 void (*join_chat)(GaimConnection *, GHashTable *components); |
8562 | 244 void (*reject_chat)(GaimConnection *, GHashTable *components); |
9917 | 245 char *(*get_chat_name)(GHashTable *components); |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
246 void (*chat_invite)(GaimConnection *, int id, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
247 const char *who, const char *message); |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
248 void (*chat_leave)(GaimConnection *, int id); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
249 void (*chat_whisper)(GaimConnection *, int id, |
6059 | 250 const char *who, const char *message); |
12216 | 251 int (*chat_send)(GaimConnection *, int id, const char *message, GaimMessageFlags flags); |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
252 void (*keepalive)(GaimConnection *); |
1713
14caa7df478c
[gaim-migrate @ 1723]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1626
diff
changeset
|
253 |
2827
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2773
diff
changeset
|
254 /* new user registration */ |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
255 void (*register_user)(GaimAccount *); |
2956 | 256 |
257 /* get "chat buddy" info and away message */ | |
6059 | 258 void (*get_cb_info)(GaimConnection *, int, const char *who); |
259 void (*get_cb_away)(GaimConnection *, int, const char *who); | |
2827
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2773
diff
changeset
|
260 |
3136 | 261 /* save/store buddy's alias on server list/roster */ |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
262 void (*alias_buddy)(GaimConnection *, const char *who, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
263 const char *alias); |
3136 | 264 |
265 /* change a buddy's group on a server list/roster */ | |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
266 void (*group_buddy)(GaimConnection *, const char *who, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
267 const char *old_group, const char *new_group); |
3136 | 268 |
3348 | 269 /* rename a group on a server list/roster */ |
9285 | 270 void (*rename_group)(GaimConnection *, const char *old_name, |
271 GaimGroup *group, GList *moved_buddies); | |
3348 | 272 |
6695 | 273 void (*buddy_free)(GaimBuddy *); |
2607
e0d4a23aac89
[gaim-migrate @ 2620]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2582
diff
changeset
|
274 |
6059 | 275 void (*convo_closed)(GaimConnection *, const char *who); |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
276 |
7322 | 277 const char *(*normalize)(const GaimAccount *, const char *); |
6451
6f16136b41e5
[gaim-migrate @ 6960]
Christian Hammond <chipx86@chipx86.com>
parents:
6418
diff
changeset
|
278 |
5842 | 279 void (*set_buddy_icon)(GaimConnection *, const char *filename); |
6885
66dd420d3d23
[gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents:
6846
diff
changeset
|
280 |
9285 | 281 void (*remove_group)(GaimConnection *gc, GaimGroup *group); |
7398 | 282 |
283 char *(*get_cb_real_name)(GaimConnection *gc, int id, const char *who); | |
7971 | 284 |
285 void (*set_chat_topic)(GaimConnection *gc, int id, const char *topic); | |
7999 | 286 |
287 GaimChat *(*find_blist_chat)(GaimAccount *account, const char *name); | |
8113 | 288 |
289 /* room listing prpl callbacks */ | |
9999 | 290 GaimRoomlist *(*roomlist_get_list)(GaimConnection *gc); |
291 void (*roomlist_cancel)(GaimRoomlist *list); | |
292 void (*roomlist_expand_category)(GaimRoomlist *list, GaimRoomlistRoom *category); | |
9466 | 293 |
294 /* file transfer callbacks */ | |
295 gboolean (*can_receive_file)(GaimConnection *, const char *who); | |
296 void (*send_file)(GaimConnection *, const char *who, const char *filename); | |
12143
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
12024
diff
changeset
|
297 GaimXfer *(*new_xfer)(GaimConnection *, const char *who); |
13327 | 298 gboolean (*offline_message)(const GaimBuddy *buddy); |
12143
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
12024
diff
changeset
|
299 |
11475
7fab28c991f3
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11462
diff
changeset
|
300 GaimWhiteboardPrplOps *whiteboard_prpl_ops; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
301 }; |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2232
diff
changeset
|
302 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
303 #define GAIM_IS_PROTOCOL_PLUGIN(plugin) \ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
304 ((plugin)->info->type == GAIM_PLUGIN_PROTOCOL) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
305 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
306 #define GAIM_PLUGIN_PROTOCOL_INFO(plugin) \ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
307 ((GaimPluginProtocolInfo *)(plugin)->info->extra_info) |
981 | 308 |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
309 #ifdef __cplusplus |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
310 extern "C" { |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
311 #endif |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
312 |
9944 | 313 /**************************************************************************/ |
314 /** @name Protocol Plugin API */ | |
315 /**************************************************************************/ | |
316 /*@{*/ | |
317 | |
318 /** | |
319 * Notifies Gaim that an account's idle state and time have changed. | |
320 * | |
321 * This is meant to be called from protocol plugins. | |
322 * | |
323 * @param account The account. | |
324 * @param idle The user's idle state. | |
325 * @param idle_time The user's idle time. | |
326 */ | |
327 void gaim_prpl_got_account_idle(GaimAccount *account, gboolean idle, | |
328 time_t idle_time); | |
329 | |
330 /** | |
331 * Notifies Gaim of an account's log-in time. | |
332 * | |
333 * This is meant to be called from protocol plugins. | |
334 * | |
335 * @param account The account the user is on. | |
336 * @param login_time The user's log-in time. | |
337 */ | |
10870 | 338 void gaim_prpl_got_account_login_time(GaimAccount *account, time_t login_time); |
9944 | 339 |
340 /** | |
341 * Notifies Gaim that an account's status has changed. | |
342 * | |
343 * This is meant to be called from protocol plugins. | |
344 * | |
345 * @param account The account the user is on. | |
346 * @param status_id The status ID. | |
347 * @param ... A NULL-terminated list of attribute IDs and values, | |
348 * beginning with the value for @a attr_id. | |
349 */ | |
350 void gaim_prpl_got_account_status(GaimAccount *account, | |
13373 | 351 const char *status_id, ...); |
9944 | 352 /** |
353 * Notifies Gaim that a user's idle state and time have changed. | |
354 * | |
355 * This is meant to be called from protocol plugins. | |
356 * | |
357 * @param account The account the user is on. | |
358 * @param name The screen name of the user. | |
359 * @param idle The user's idle state. | |
10860 | 360 * @param idle_time The user's idle time. This is the time at |
361 * which the user became idle, in seconds since | |
362 * the epoch. | |
9944 | 363 */ |
364 void gaim_prpl_got_user_idle(GaimAccount *account, const char *name, | |
365 gboolean idle, time_t idle_time); | |
366 | |
367 /** | |
368 * Notifies Gaim of a user's log-in time. | |
369 * | |
370 * This is meant to be called from protocol plugins. | |
371 * | |
372 * @param account The account the user is on. | |
373 * @param name The screen name of the user. | |
374 * @param login_time The user's log-in time. | |
375 */ | |
376 void gaim_prpl_got_user_login_time(GaimAccount *account, const char *name, | |
377 time_t login_time); | |
378 | |
379 /** | |
380 * Notifies Gaim that a user's status has changed. | |
381 * | |
382 * This is meant to be called from protocol plugins. | |
383 * | |
384 * @param account The account the user is on. | |
385 * @param name The screen name of the user. | |
386 * @param status_id The status ID. | |
387 * @param ... A NULL-terminated list of attribute IDs and values, | |
388 * beginning with the value for @a attr_id. | |
389 */ | |
390 void gaim_prpl_got_user_status(GaimAccount *account, const char *name, | |
13373 | 391 const char *status_id, ...); |
9944 | 392 /** |
393 * Informs the server that an account's status changed. | |
394 * | |
10447 | 395 * @param account The account the user is on. |
396 * @param old_status The previous status. | |
397 * @param new_status The status that was activated, or deactivated | |
398 * (in the case of independent statuses). | |
9944 | 399 */ |
10447 | 400 void gaim_prpl_change_account_status(GaimAccount *account, |
401 GaimStatus *old_status, | |
402 GaimStatus *new_status); | |
9944 | 403 |
10006 | 404 /** |
405 * Retrieves the list of stock status types from a prpl. | |
406 * | |
407 * @param account The account the user is on. | |
408 * @param presence The presence for which we're going to get statuses | |
409 * | |
410 * @return List of statuses | |
411 */ | |
412 GList *gaim_prpl_get_statuses(GaimAccount *account, GaimPresence *presence); | |
413 | |
9944 | 414 /*@}*/ |
415 | |
416 /**************************************************************************/ | |
417 /** @name Protocol Plugin Subsystem API */ | |
418 /**************************************************************************/ | |
419 /*@{*/ | |
420 | |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
421 /** |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
422 * Finds a protocol plugin structure of the specified type. |
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
423 * |
9000 | 424 * @param id The protocol plugin; |
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
425 */ |
7956 | 426 GaimPlugin *gaim_find_prpl(const char *id); |
981 | 427 |
9944 | 428 /*@}*/ |
429 | |
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
430 #ifdef __cplusplus |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
431 } |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
432 #endif |
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
433 |
2417
5473c8c5378d
[gaim-migrate @ 2430]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2411
diff
changeset
|
434 #endif /* _PRPL_H_ */ |