00001
00026
00027
00028
00029 #ifndef _GAIM_PRPL_H_
00030 #define _GAIM_PRPL_H_
00031
00032 typedef struct _GaimPluginProtocolInfo GaimPluginProtocolInfo;
00033
00034
00036
00040 #define GAIM_PRPL_DESC(x) \
00041 "Allows gaim to use the " (x) " protocol.\n\n" \
00042 "Now that you have loaded this protocol, use the " \
00043 "Account Editor to add an account that uses this " \
00044 "protocol. You can access the Account Editor from " \
00045 "the \"Accounts\" button on the login window or " \
00046 "in the \"Tools\" menu in the buddy list window."
00047
00049 #define GAIM_PROTO_DEFAULT "prpl-oscar"
00050
00056 typedef enum
00057 {
00058 GAIM_CONV_IM_AUTO_RESP = 0x0001,
00059 GAIM_CONV_IM_IMAGES = 0x0002
00060 } GaimConvImFlags;
00061
00062 typedef enum
00063 {
00064 GAIM_CONV_CHAT_WHISPER = 0x0001,
00065 GAIM_CONV_CHAT_DELAYED = 0x0002
00067 } GaimConvChatFlags;
00068
00069 typedef enum {
00070 GAIM_ICON_SCALE_DISPLAY = 0x01,
00071 GAIM_ICON_SCALE_SEND = 0x02
00072 } GaimIconScaleRules;
00073
00074
00080 typedef struct {
00081 char *format;
00084 int min_width;
00085 int min_height;
00086 int max_width;
00087 int max_height;
00088 GaimIconScaleRules scale_rules;
00089 } GaimBuddyIconSpec;
00090
00091
00092 #define NO_BUDDY_ICONS {NULL, 0, 0, 0, 0, 0}
00093
00094 #include "blist.h"
00095 #include "proxy.h"
00096 #include "plugin.h"
00097
00098 struct proto_chat_entry {
00099 char *label;
00100 char *identifier;
00101 gboolean is_int;
00102 int min;
00103 int max;
00104 gboolean secret;
00105 };
00106
00112 typedef enum
00113 {
00121 OPT_PROTO_UNIQUE_CHATNAME = 0x00000004,
00122
00128 OPT_PROTO_CHAT_TOPIC = 0x00000008,
00129
00136 OPT_PROTO_NO_PASSWORD = 0x00000010,
00137
00143 OPT_PROTO_MAIL_CHECK = 0x00000020,
00144
00160 OPT_PROTO_IM_IMAGE = 0x00000080,
00161
00168 OPT_PROTO_PASSWORD_OPTIONAL = 0x00000100,
00169
00175 OPT_PROTO_USE_POINTSIZE = 0x00000200
00176
00177 } GaimProtocolOptions;
00178
00180 #define GAIM_AWAY_CUSTOM _("Custom")
00181
00183 struct _GaimRoomlist;
00184 struct _GaimRoomlistRoom;
00185
00192 struct _GaimPluginProtocolInfo
00193 {
00194 GaimProtocolOptions options;
00196 GList *user_splits;
00197 GList *protocol_options;
00198
00199 GaimBuddyIconSpec icon_spec;
00200
00205 const char *(*list_icon)(GaimAccount *account, GaimBuddy *buddy);
00206
00211 void (*list_emblems)(GaimBuddy *buddy, char **se, char **sw,
00212 char **nw, char **ne);
00213
00218 char *(*status_text)(GaimBuddy *buddy);
00219
00223 char *(*tooltip_text)(GaimBuddy *buddy);
00224
00225 GList *(*away_states)(GaimConnection *gc);
00226
00227 GList *(*blist_node_menu)(GaimBlistNode *node);
00228 GList *(*chat_info)(GaimConnection *);
00229 GHashTable *(*chat_info_defaults)(GaimConnection *, const char *chat_name);
00230
00231
00232 void (*login)(GaimAccount *);
00233 void (*close)(GaimConnection *);
00234 int (*send_im)(GaimConnection *, const char *who,
00235 const char *message,
00236 GaimConvImFlags flags);
00237 void (*set_info)(GaimConnection *, const char *info);
00238 int (*send_typing)(GaimConnection *, const char *name, int typing);
00239 void (*get_info)(GaimConnection *, const char *who);
00240 void (*set_away)(GaimConnection *, const char *state, const char *message);
00241 void (*set_idle)(GaimConnection *, int idletime);
00242 void (*change_passwd)(GaimConnection *, const char *old_pass,
00243 const char *new_pass);
00244 void (*add_buddy)(GaimConnection *, GaimBuddy *buddy, GaimGroup *group);
00245 void (*add_buddies)(GaimConnection *, GList *buddies, GList *groups);
00246 void (*remove_buddy)(GaimConnection *, GaimBuddy *buddy, GaimGroup *group);
00247 void (*remove_buddies)(GaimConnection *, GList *buddies, GList *groups);
00248 void (*add_permit)(GaimConnection *, const char *name);
00249 void (*add_deny)(GaimConnection *, const char *name);
00250 void (*rem_permit)(GaimConnection *, const char *name);
00251 void (*rem_deny)(GaimConnection *, const char *name);
00252 void (*set_permit_deny)(GaimConnection *);
00253 void (*warn)(GaimConnection *, const char *who, gboolean anonymous);
00254 void (*join_chat)(GaimConnection *, GHashTable *components);
00255 void (*reject_chat)(GaimConnection *, GHashTable *components);
00256 char *(*get_chat_name)(GHashTable *components);
00257 void (*chat_invite)(GaimConnection *, int id,
00258 const char *who, const char *message);
00259 void (*chat_leave)(GaimConnection *, int id);
00260 void (*chat_whisper)(GaimConnection *, int id,
00261 const char *who, const char *message);
00262 int (*chat_send)(GaimConnection *, int id, const char *message);
00263 void (*keepalive)(GaimConnection *);
00264
00265
00266 void (*register_user)(GaimAccount *);
00267
00268
00269 void (*get_cb_info)(GaimConnection *, int, const char *who);
00270 void (*get_cb_away)(GaimConnection *, int, const char *who);
00271
00272
00273 void (*alias_buddy)(GaimConnection *, const char *who,
00274 const char *alias);
00275
00276
00277 void (*group_buddy)(GaimConnection *, const char *who,
00278 const char *old_group, const char *new_group);
00279
00280
00281 void (*rename_group)(GaimConnection *, const char *old_name,
00282 GaimGroup *group, GList *moved_buddies);
00283
00284 void (*buddy_free)(GaimBuddy *);
00285
00286 void (*convo_closed)(GaimConnection *, const char *who);
00287
00288 const char *(*normalize)(const GaimAccount *, const char *);
00289
00290 void (*set_buddy_icon)(GaimConnection *, const char *filename);
00291
00292 void (*remove_group)(GaimConnection *gc, GaimGroup *group);
00293
00294 char *(*get_cb_real_name)(GaimConnection *gc, int id, const char *who);
00295
00296 void (*set_chat_topic)(GaimConnection *gc, int id, const char *topic);
00297
00298 GaimChat *(*find_blist_chat)(GaimAccount *account, const char *name);
00299
00300
00301 struct _GaimRoomlist *(*roomlist_get_list)(GaimConnection *gc);
00302 void (*roomlist_cancel)(struct _GaimRoomlist *list);
00303 void (*roomlist_expand_category)(struct _GaimRoomlist *list, struct _GaimRoomlistRoom *category);
00304
00305
00306 gboolean (*can_receive_file)(GaimConnection *, const char *who);
00307 void (*send_file)(GaimConnection *, const char *who, const char *filename);
00308 };
00309
00310 #define GAIM_IS_PROTOCOL_PLUGIN(plugin) \
00311 ((plugin)->info->type == GAIM_PLUGIN_PROTOCOL)
00312
00313 #define GAIM_PLUGIN_PROTOCOL_INFO(plugin) \
00314 ((GaimPluginProtocolInfo *)(plugin)->info->extra_info)
00315
00316 #ifdef __cplusplus
00317 extern "C" {
00318 #endif
00319
00325 GaimPlugin *gaim_find_prpl(const char *id);
00326
00327 #ifdef __cplusplus
00328 }
00329 #endif
00330
00331 #endif