Mercurial > pidgin
annotate src/prpl.h @ 12192:fb89d3a31c19
[gaim-migrate @ 14494]
Deconflict key bindings and fix a capitalization normalization I missed. Keybindings suck. I agree that GTK+ should do this automagically.
committer: Tailor Script <tailor@pidgin.im>
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Tue, 22 Nov 2005 22:47:59 +0000 |
| parents | cbebda5f019c |
| children | 4d3119205a33 |
| 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 |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
38 /** |
| 6622 | 39 * Flags applicable to outgoing/incoming IMs from prpls. |
| 40 */ | |
| 41 typedef enum | |
| 42 { | |
|
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
43 GAIM_CONV_IM_AUTO_RESP = 0x0001, /**< Auto response. */ |
|
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
44 GAIM_CONV_IM_IMAGES = 0x0002 /**< Contains images. */ |
| 9584 | 45 } GaimConvImFlags; |
|
8749
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
8713
diff
changeset
|
46 |
| 9584 | 47 typedef enum |
| 48 { | |
| 49 GAIM_CONV_CHAT_WHISPER = 0x0001, /**< Whispered message.*/ | |
| 10104 | 50 GAIM_CONV_CHAT_DELAYED = 0x0002, /**< Delayed message. */ |
| 51 GAIM_CONV_CHAT_ALERT = 0x0004 /**< Alert message. */ | |
| 9584 | 52 } GaimConvChatFlags; |
| 6622 | 53 |
| 9318 | 54 typedef enum { |
| 55 GAIM_ICON_SCALE_DISPLAY = 0x01, /**< We scale the icon when we display it */ | |
| 56 GAIM_ICON_SCALE_SEND = 0x02 /**< We scale the icon before we send it to the server */ | |
| 57 } GaimIconScaleRules; | |
| 58 | |
| 59 | |
| 9308 | 60 /** |
| 61 * A description of a Buddy Icon specification. This tells Gaim what kind of image file | |
| 62 * it should give this prpl, and what kind of image file it should expect back. | |
| 9316 | 63 * Dimensions less than 1 should be ignored and the image not scaled. |
| 9308 | 64 */ |
| 65 typedef struct { | |
| 66 char *format; /**< This is a comma-delimited list of image formats or NULL if icons are not supported. | |
| 67 * The core nor the prpl will actually check to see if the data it's given matches this, it's entirely | |
| 68 * up to the UI to do what it wants */ | |
| 9318 | 69 int min_width; /**< The minimum width of this icon */ |
| 70 int min_height; /**< The minimum height of this icon */ | |
| 71 int max_width; /**< The maximum width of this icon */ | |
| 72 int max_height; /**< The maximum height of this icon */ | |
| 73 GaimIconScaleRules scale_rules; /**< How to stretch this icon */ | |
| 9308 | 74 } GaimBuddyIconSpec; |
| 75 | |
| 9999 | 76 /** |
|
11035
11e465b55fe6
[gaim-migrate @ 12922]
Gary Kramlich <grim@reaperworld.com>
parents:
10870
diff
changeset
|
77 * This \#define exists just to make it easier to fill out the buddy icon |
| 9999 | 78 * field in the prpl info struct for protocols that couldn't care less. |
| 79 */ | |
| 9318 | 80 #define NO_BUDDY_ICONS {NULL, 0, 0, 0, 0, 0} |
| 9308 | 81 |
| 8573 | 82 #include "blist.h" |
|
12143
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
12024
diff
changeset
|
83 #include "ft.h" |
| 8573 | 84 #include "proxy.h" |
| 85 #include "plugin.h" | |
| 12024 | 86 #include "media.h" |
| 9999 | 87 #include "roomlist.h" |
| 9944 | 88 #include "status.h" |
|
11475
7fab28c991f3
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11462
diff
changeset
|
89 #include "whiteboard.h" |
| 8573 | 90 |
| 9713 | 91 struct proto_chat_entry { |
| 92 char *label; | |
| 93 char *identifier; | |
| 10475 | 94 gboolean required; |
| 9713 | 95 gboolean is_int; |
| 96 int min; | |
| 97 int max; | |
| 98 gboolean secret; | |
| 99 }; | |
| 100 | |
| 6622 | 101 /** |
|
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
102 * Protocol options |
|
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 * 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
|
105 */ |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
106 typedef enum |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
107 { |
|
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 * Use a unique name, not an alias, for chat rooms. |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
110 * |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
111 * Jabber lets you choose what name you want for chat. |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
112 * 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
|
113 * it gets annoying. |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
114 */ |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
115 OPT_PROTO_UNIQUE_CHATNAME = 0x00000004, |
|
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 /** |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
118 * Chat rooms have topics. |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
119 * |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
120 * IRC and Jabber support this. |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
121 */ |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
122 OPT_PROTO_CHAT_TOPIC = 0x00000008, |
|
1370
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
123 |
|
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
124 /** |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
125 * Don't require passwords for sign-in. |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
126 * |
| 9999 | 127 * Zephyr doesn't require passwords, so there's no |
| 128 * need for a password prompt. | |
|
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 OPT_PROTO_NO_PASSWORD = 0x00000010, |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
131 |
|
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 * Notify on new mail. |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
134 * |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
135 * MSN and Yahoo notify you when you have new mail. |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
136 */ |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
137 OPT_PROTO_MAIL_CHECK = 0x00000020, |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
138 |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
139 /** |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
140 * Images in IMs. |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
141 * |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
142 * Oscar lets you send images in direct IMs. |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
143 */ |
| 9999 | 144 OPT_PROTO_IM_IMAGE = 0x00000040, |
|
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
145 |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
146 /** |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
147 * Allow passwords to be optional. |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
148 * |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
149 * Passwords in IRC are optional, and are needed for certain |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
150 * functionality. |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
151 */ |
| 9999 | 152 OPT_PROTO_PASSWORD_OPTIONAL = 0x00000080, |
|
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
153 |
| 5367 | 154 /** |
| 155 * Allows font size to be specified in sane point size | |
| 156 * | |
| 157 * Probably just Jabber and Y!M | |
| 158 */ | |
| 11358 | 159 OPT_PROTO_USE_POINTSIZE = 0x00000100, |
| 160 | |
| 161 /** | |
| 162 * Set the Register button active when screenname is not given. | |
| 163 * | |
| 164 * Gadu-Gadu doesn't need a screenname to register new account. | |
| 165 */ | |
| 166 OPT_PROTO_REGISTER_NOSCREENNAME = 0x00000200, | |
| 5367 | 167 |
|
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
168 } GaimProtocolOptions; |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
169 |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
170 /** |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
171 * A protocol plugin information structure. |
|
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
172 * |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
173 * Every protocol plugin initializes this structure. It is the gateway |
| 10160 | 174 * between gaim and the protocol plugin. Many of this callbacks can be |
| 10162 | 175 * 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
|
176 */ |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
177 struct _GaimPluginProtocolInfo |
|
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
178 { |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
179 GaimProtocolOptions options; /**< Protocol options. */ |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
180 |
|
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
181 GList *user_splits; /* A GList of GaimAccountUserSplit */ |
|
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
182 GList *protocol_options; /* A GList of GaimAccountOption */ |
| 10160 | 183 |
| 9308 | 184 GaimBuddyIconSpec icon_spec; /* The icon spec. */ |
| 10160 | 185 |
|
6451
6f16136b41e5
[gaim-migrate @ 6960]
Christian Hammond <chipx86@chipx86.com>
parents:
6418
diff
changeset
|
186 /** |
|
6f16136b41e5
[gaim-migrate @ 6960]
Christian Hammond <chipx86@chipx86.com>
parents:
6418
diff
changeset
|
187 * Returns the base icon name for the given buddy and account. |
| 10160 | 188 * If buddy is NULL, it will return the name to use for the account's |
| 189 * icon. This must be implemented. | |
| 4687 | 190 */ |
| 6695 | 191 const char *(*list_icon)(GaimAccount *account, GaimBuddy *buddy); |
| 4687 | 192 |
| 193 /** | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
194 * Fills the four char**'s with string identifiers for "emblems" |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
195 * that the UI will interpret and display as relevant |
| 4687 | 196 */ |
| 9952 | 197 void (*list_emblems)(GaimBuddy *buddy, const char **se, const char **sw, |
| 198 const char **nw, const char **ne); | |
| 4722 | 199 |
| 200 /** | |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
201 * Gets a short string representing this buddy's status. This will |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
202 * be shown on the buddy list. |
| 4722 | 203 */ |
| 6695 | 204 char *(*status_text)(GaimBuddy *buddy); |
|
6451
6f16136b41e5
[gaim-migrate @ 6960]
Christian Hammond <chipx86@chipx86.com>
parents:
6418
diff
changeset
|
205 |
| 4724 | 206 /** |
| 207 * Gets a string to put in the buddy list tooltip. | |
| 208 */ | |
| 6695 | 209 char *(*tooltip_text)(GaimBuddy *buddy); |
|
6451
6f16136b41e5
[gaim-migrate @ 6960]
Christian Hammond <chipx86@chipx86.com>
parents:
6418
diff
changeset
|
210 |
| 10200 | 211 /** |
| 212 * This must be implemented, and must add at least the offline | |
| 213 * and online states. | |
| 214 */ | |
| 9950 | 215 GList *(*status_types)(GaimAccount *account); |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
216 |
| 9030 | 217 GList *(*blist_node_menu)(GaimBlistNode *node); |
|
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
218 GList *(*chat_info)(GaimConnection *); |
| 9754 | 219 GHashTable *(*chat_info_defaults)(GaimConnection *, const char *chat_name); |
|
1333
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1318
diff
changeset
|
220 |
|
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
221 /* All the server-related functions */ |
| 10160 | 222 |
| 223 /** This must be implemented. */ | |
| 11837 | 224 void (*login)(GaimAccount *); |
| 10160 | 225 |
| 226 /** This must be implemented. */ | |
|
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
227 void (*close)(GaimConnection *); |
| 11693 | 228 |
| 229 /** | |
| 230 * This PRPL function should return a positive value on success. | |
| 231 * If the message is too big to be sent, return -E2BIG. If | |
| 232 * the account is not connected, return -ENOTCONN. If the | |
| 233 * PRPL is unable to send the message for another reason, return | |
| 234 * some other negative value. You can use one of the valid | |
| 235 * errno values, or just big something. If the message should | |
| 236 * not be echoed to the conversation window, return 0. | |
| 237 */ | |
|
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
238 int (*send_im)(GaimConnection *, const char *who, |
| 6982 | 239 const char *message, |
|
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
240 GaimConvImFlags flags); |
| 11693 | 241 |
| 5954 | 242 void (*set_info)(GaimConnection *, const char *info); |
| 6059 | 243 int (*send_typing)(GaimConnection *, const char *name, int typing); |
|
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
244 void (*get_info)(GaimConnection *, const char *who); |
| 9949 | 245 void (*set_status)(GaimAccount *account, GaimStatus *status); |
| 246 | |
|
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
247 void (*set_idle)(GaimConnection *, int idletime); |
|
5946
209cae24a51d
[gaim-migrate @ 6387]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
248 void (*change_passwd)(GaimConnection *, const char *old_pass, |
|
209cae24a51d
[gaim-migrate @ 6387]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
249 const char *new_pass); |
| 9285 | 250 void (*add_buddy)(GaimConnection *, GaimBuddy *buddy, GaimGroup *group); |
| 251 void (*add_buddies)(GaimConnection *, GList *buddies, GList *groups); | |
| 252 void (*remove_buddy)(GaimConnection *, GaimBuddy *buddy, GaimGroup *group); | |
| 253 void (*remove_buddies)(GaimConnection *, GList *buddies, GList *groups); | |
|
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
254 void (*add_permit)(GaimConnection *, const char *name); |
|
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
255 void (*add_deny)(GaimConnection *, const char *name); |
|
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
256 void (*rem_permit)(GaimConnection *, const char *name); |
|
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
257 void (*rem_deny)(GaimConnection *, const char *name); |
|
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
258 void (*set_permit_deny)(GaimConnection *); |
|
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
259 void (*join_chat)(GaimConnection *, GHashTable *components); |
| 8562 | 260 void (*reject_chat)(GaimConnection *, GHashTable *components); |
| 9917 | 261 char *(*get_chat_name)(GHashTable *components); |
|
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
262 void (*chat_invite)(GaimConnection *, int id, |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
263 const char *who, const char *message); |
|
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
264 void (*chat_leave)(GaimConnection *, int id); |
|
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
265 void (*chat_whisper)(GaimConnection *, int id, |
| 6059 | 266 const char *who, const char *message); |
| 267 int (*chat_send)(GaimConnection *, int id, const char *message); | |
|
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
268 void (*keepalive)(GaimConnection *); |
|
1713
14caa7df478c
[gaim-migrate @ 1723]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1626
diff
changeset
|
269 |
|
2827
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2773
diff
changeset
|
270 /* new user registration */ |
|
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
271 void (*register_user)(GaimAccount *); |
| 2956 | 272 |
| 273 /* get "chat buddy" info and away message */ | |
| 6059 | 274 void (*get_cb_info)(GaimConnection *, int, const char *who); |
| 275 void (*get_cb_away)(GaimConnection *, int, const char *who); | |
|
2827
51999a36c0b1
[gaim-migrate @ 2840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2773
diff
changeset
|
276 |
| 3136 | 277 /* save/store buddy's alias on server list/roster */ |
|
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
278 void (*alias_buddy)(GaimConnection *, const char *who, |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
279 const char *alias); |
| 3136 | 280 |
| 281 /* change a buddy's group on a server list/roster */ | |
|
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5538
diff
changeset
|
282 void (*group_buddy)(GaimConnection *, const char *who, |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
283 const char *old_group, const char *new_group); |
| 3136 | 284 |
| 3348 | 285 /* rename a group on a server list/roster */ |
| 9285 | 286 void (*rename_group)(GaimConnection *, const char *old_name, |
| 287 GaimGroup *group, GList *moved_buddies); | |
| 3348 | 288 |
| 6695 | 289 void (*buddy_free)(GaimBuddy *); |
|
2607
e0d4a23aac89
[gaim-migrate @ 2620]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2582
diff
changeset
|
290 |
| 6059 | 291 void (*convo_closed)(GaimConnection *, const char *who); |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
292 |
| 7322 | 293 const char *(*normalize)(const GaimAccount *, const char *); |
|
6451
6f16136b41e5
[gaim-migrate @ 6960]
Christian Hammond <chipx86@chipx86.com>
parents:
6418
diff
changeset
|
294 |
| 5842 | 295 void (*set_buddy_icon)(GaimConnection *, const char *filename); |
|
6885
66dd420d3d23
[gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents:
6846
diff
changeset
|
296 |
| 9285 | 297 void (*remove_group)(GaimConnection *gc, GaimGroup *group); |
| 7398 | 298 |
| 299 char *(*get_cb_real_name)(GaimConnection *gc, int id, const char *who); | |
| 7971 | 300 |
| 301 void (*set_chat_topic)(GaimConnection *gc, int id, const char *topic); | |
| 7999 | 302 |
| 303 GaimChat *(*find_blist_chat)(GaimAccount *account, const char *name); | |
| 8113 | 304 |
| 305 /* room listing prpl callbacks */ | |
| 9999 | 306 GaimRoomlist *(*roomlist_get_list)(GaimConnection *gc); |
| 307 void (*roomlist_cancel)(GaimRoomlist *list); | |
| 308 void (*roomlist_expand_category)(GaimRoomlist *list, GaimRoomlistRoom *category); | |
| 9466 | 309 |
| 310 /* file transfer callbacks */ | |
| 311 gboolean (*can_receive_file)(GaimConnection *, const char *who); | |
| 312 void (*send_file)(GaimConnection *, const char *who, const char *filename); | |
|
12143
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
12024
diff
changeset
|
313 GaimXfer *(*new_xfer)(GaimConnection *, const char *who); |
|
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
12024
diff
changeset
|
314 |
|
11475
7fab28c991f3
[gaim-migrate @ 13717]
Gary Kramlich <grim@reaperworld.com>
parents:
11462
diff
changeset
|
315 GaimWhiteboardPrplOps *whiteboard_prpl_ops; |
| 12024 | 316 GaimMediaPrplOps *media_prpl_ops; |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
317 }; |
|
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2232
diff
changeset
|
318 |
|
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
319 #define GAIM_IS_PROTOCOL_PLUGIN(plugin) \ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
320 ((plugin)->info->type == GAIM_PLUGIN_PROTOCOL) |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
321 |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
322 #define GAIM_PLUGIN_PROTOCOL_INFO(plugin) \ |
|
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5148
diff
changeset
|
323 ((GaimPluginProtocolInfo *)(plugin)->info->extra_info) |
| 981 | 324 |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
325 #ifdef __cplusplus |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
326 extern "C" { |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
327 #endif |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
328 |
| 9944 | 329 /**************************************************************************/ |
| 330 /** @name Protocol Plugin API */ | |
| 331 /**************************************************************************/ | |
| 332 /*@{*/ | |
| 333 | |
| 334 /** | |
| 335 * Notifies Gaim that an account's idle state and time have changed. | |
| 336 * | |
| 337 * This is meant to be called from protocol plugins. | |
| 338 * | |
| 339 * @param account The account. | |
| 340 * @param idle The user's idle state. | |
| 341 * @param idle_time The user's idle time. | |
| 342 */ | |
| 343 void gaim_prpl_got_account_idle(GaimAccount *account, gboolean idle, | |
| 344 time_t idle_time); | |
| 345 | |
| 346 /** | |
| 347 * Notifies Gaim of an account's log-in time. | |
| 348 * | |
| 349 * This is meant to be called from protocol plugins. | |
| 350 * | |
| 351 * @param account The account the user is on. | |
| 352 * @param login_time The user's log-in time. | |
| 353 */ | |
| 10870 | 354 void gaim_prpl_got_account_login_time(GaimAccount *account, time_t login_time); |
| 9944 | 355 |
| 356 /** | |
| 357 * Notifies Gaim that an account's status has changed. | |
| 358 * | |
| 359 * This is meant to be called from protocol plugins. | |
| 360 * | |
| 361 * @param account The account the user is on. | |
| 362 * @param status_id The status ID. | |
| 363 * @param attr_id The first attribute ID, or NULL for no attribute updates. | |
| 364 * @param ... A NULL-terminated list of attribute IDs and values, | |
| 365 * beginning with the value for @a attr_id. | |
| 366 */ | |
| 367 void gaim_prpl_got_account_status(GaimAccount *account, | |
| 368 const char *status_id, const char *attr_id, | |
| 369 ...); | |
| 370 /** | |
| 371 * Notifies Gaim that a user's idle state and time have changed. | |
| 372 * | |
| 373 * This is meant to be called from protocol plugins. | |
| 374 * | |
| 375 * @param account The account the user is on. | |
| 376 * @param name The screen name of the user. | |
| 377 * @param idle The user's idle state. | |
| 10860 | 378 * @param idle_time The user's idle time. This is the time at |
| 379 * which the user became idle, in seconds since | |
| 380 * the epoch. | |
| 9944 | 381 */ |
| 382 void gaim_prpl_got_user_idle(GaimAccount *account, const char *name, | |
| 383 gboolean idle, time_t idle_time); | |
| 384 | |
| 385 /** | |
| 386 * Notifies Gaim of a user's log-in time. | |
| 387 * | |
| 388 * This is meant to be called from protocol plugins. | |
| 389 * | |
| 390 * @param account The account the user is on. | |
| 391 * @param name The screen name of the user. | |
| 392 * @param login_time The user's log-in time. | |
| 393 */ | |
| 394 void gaim_prpl_got_user_login_time(GaimAccount *account, const char *name, | |
| 395 time_t login_time); | |
| 396 | |
| 397 /** | |
| 398 * Notifies Gaim that a user's status has changed. | |
| 399 * | |
| 400 * This is meant to be called from protocol plugins. | |
| 401 * | |
| 402 * @param account The account the user is on. | |
| 403 * @param name The screen name of the user. | |
| 404 * @param status_id The status ID. | |
| 405 * @param attr_id The first attribute ID, or NULL for no attribute updates. | |
| 406 * @param ... A NULL-terminated list of attribute IDs and values, | |
| 407 * beginning with the value for @a attr_id. | |
| 408 */ | |
| 409 void gaim_prpl_got_user_status(GaimAccount *account, const char *name, | |
| 410 const char *status_id, const char *attr_id, ...); | |
| 411 /** | |
| 412 * Informs the server that an account's status changed. | |
| 413 * | |
| 10447 | 414 * @param account The account the user is on. |
| 415 * @param old_status The previous status. | |
| 416 * @param new_status The status that was activated, or deactivated | |
| 417 * (in the case of independent statuses). | |
| 9944 | 418 */ |
| 10447 | 419 void gaim_prpl_change_account_status(GaimAccount *account, |
| 420 GaimStatus *old_status, | |
| 421 GaimStatus *new_status); | |
| 9944 | 422 |
| 10006 | 423 /** |
| 424 * Retrieves the list of stock status types from a prpl. | |
| 425 * | |
| 426 * @param account The account the user is on. | |
| 427 * @param presence The presence for which we're going to get statuses | |
| 428 * | |
| 429 * @return List of statuses | |
| 430 */ | |
| 431 GList *gaim_prpl_get_statuses(GaimAccount *account, GaimPresence *presence); | |
| 432 | |
| 9944 | 433 /*@}*/ |
| 434 | |
| 435 /**************************************************************************/ | |
| 436 /** @name Protocol Plugin Subsystem API */ | |
| 437 /**************************************************************************/ | |
| 438 /*@{*/ | |
| 439 | |
|
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
440 /** |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
441 * Finds a protocol plugin structure of the specified type. |
|
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
442 * |
| 9000 | 443 * @param id The protocol plugin; |
|
4557
53ce3af93edb
[gaim-migrate @ 4837]
Christian Hammond <chipx86@chipx86.com>
parents:
4514
diff
changeset
|
444 */ |
| 7956 | 445 GaimPlugin *gaim_find_prpl(const char *id); |
| 981 | 446 |
| 9944 | 447 /*@}*/ |
| 448 | |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
449 #ifdef __cplusplus |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
450 } |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
451 #endif |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
452 |
|
2417
5473c8c5378d
[gaim-migrate @ 2430]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2411
diff
changeset
|
453 #endif /* _PRPL_H_ */ |
