Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

prpl.h

Go to the documentation of this file.
00001 
00026 /* this file should be all that prpls need to include. therefore, by including
00027  * this file, they should get glib, proxy, gaim_connection, prpl, etc. */
00028 
00029 #ifndef _GAIM_PRPL_H_
00030 #define _GAIM_PRPL_H_
00031 
00032 typedef struct _GaimPluginProtocolInfo GaimPluginProtocolInfo;
00033 
00034 /**************************************************************************/
00036 /**************************************************************************/
00045 typedef enum
00046 {
00047     GAIM_PROTO_TOC = 0,     
00048     GAIM_PROTO_OSCAR,       
00049     GAIM_PROTO_YAHOO,       
00050     GAIM_PROTO_ICQ,         
00051     GAIM_PROTO_MSN,         
00052     GAIM_PROTO_IRC,         
00053     GAIM_PROTO_FTP,         
00054     GAIM_PROTO_VGATE,       
00055     GAIM_PROTO_JABBER,      
00056     GAIM_PROTO_NAPSTER,     
00057     GAIM_PROTO_ZEPHYR,      
00058     GAIM_PROTO_GADUGADU,    
00059     GAIM_PROTO_SAMETIME,    
00060     GAIM_PROTO_TLEN,        
00061     GAIM_PROTO_RVP,         
00062     GAIM_PROTO_BACKRUB,     
00063     GAIM_PROTO_MOO,         
00064     GAIM_PROTO_ELVIN,       
00065     GAIM_PROTO_TREPIA,      
00066     GAIM_PROTO_BATTLENET,   
00067     GAIM_PROTO_SSCP,    
00068     GAIM_PROTO_BLOGGER, 
00069     /* If you add any more prpl numbers,  then a curse will
00070      * be placed upon your keyboard the likes of which the
00071      * world has never known. prpl numbers are no longer
00072      * necessary.  --Nathan
00073      * */
00074     GAIM_PROTO_UNTAKEN      
00076 } GaimProtocol;
00077 
00078 
00080 #define GAIM_PRPL_DESC(x) \
00081         "Allows gaim to use the " (x) " protocol.\n\n"      \
00082         "Now that you have loaded this protocol, use the "  \
00083         "Account Editor to add an account that uses this "  \
00084         "protocol. You can access the Account Editor from " \
00085         "the \"Accounts\" button on the login window or "   \
00086         "in the \"Tools\" menu in the buddy list window."
00087 
00089 #define GAIM_PROTO_DEFAULT "prpl-oscar"
00090 
00096 typedef enum
00097 {
00098     GAIM_CONV_IM_AUTO_RESP = 0x0001,    
00099     GAIM_CONV_IM_IMAGES    = 0x0002     
00101 } GaimConvImFlags;
00102 
00103 #include "blist.h"
00104 #include "proxy.h"
00105 #include "plugin.h"
00106 
00112 typedef enum
00113 {
00118 #if 0
00119     #define OPT_PROTO_HTML            0x00000001 this should be per-connection */
00120 #endif
00121 
00130     OPT_PROTO_CORRECT_TIME = 0x00000002,
00131 
00139     OPT_PROTO_UNIQUE_CHATNAME = 0x00000004,
00140 
00146     OPT_PROTO_CHAT_TOPIC = 0x00000008,
00147 
00154     OPT_PROTO_NO_PASSWORD = 0x00000010,
00155 
00161     OPT_PROTO_MAIL_CHECK = 0x00000020,
00162 
00168     OPT_PROTO_BUDDY_ICON = 0x00000040,
00169 
00175     OPT_PROTO_IM_IMAGE = 0x00000080,
00176 
00183     OPT_PROTO_PASSWORD_OPTIONAL = 0x00000100,
00184 
00190     OPT_PROTO_USE_POINTSIZE = 0x00000200
00191 
00192 } GaimProtocolOptions;
00193 
00195 #define GAIM_AWAY_CUSTOM _("Custom")
00196 
00198 struct _GaimRoomlist;
00199 struct _GaimRoomlistRoom;
00200 
00207 struct _GaimPluginProtocolInfo
00208 {
00209     unsigned int api_version;     
00211     GaimProtocolOptions options;  
00213     GList *user_splits;      /* A GList of GaimAccountUserSplit */
00214     GList *protocol_options; /* A GList of GaimAccountOption    */
00215 
00220     const char *(*list_icon)(GaimAccount *account, GaimBuddy *buddy);
00221 
00226     void (*list_emblems)(GaimBuddy *buddy, char **se, char **sw,
00227                           char **nw, char **ne);
00228 
00233     char *(*status_text)(GaimBuddy *buddy);
00234 
00238     char *(*tooltip_text)(GaimBuddy *buddy);
00239 
00240     GList *(*away_states)(GaimConnection *gc);
00241     GList *(*actions)(GaimConnection *gc);
00242 
00243     GList *(*buddy_menu)(GaimConnection *, const char *);
00244     GList *(*chat_info)(GaimConnection *);
00245 
00246     /* All the server-related functions */
00247 
00248     /*
00249      * A lot of these (like get_dir) are protocol-dependent and should
00250      * be removed. ones like set_dir (which is also protocol-dependent)
00251      * can stay though because there's a dialog (i.e. the prpl says you
00252      * can set your dir info, the ui shows a dialog and needs to call
00253      * set_dir in order to set it)
00254      */
00255     void (*login)(GaimAccount *);
00256     void (*close)(GaimConnection *);
00257     int  (*send_im)(GaimConnection *, const char *who,
00258                     const char *message,
00259                     GaimConvImFlags flags);
00260     void (*set_info)(GaimConnection *, const char *info);
00261     int  (*send_typing)(GaimConnection *, const char *name, int typing);
00262     void (*get_info)(GaimConnection *, const char *who);
00263     void (*set_away)(GaimConnection *, const char *state, const char *message);
00264     void (*set_dir)(GaimConnection *, const char *first,
00265                     const char *middle, const char *last,
00266                     const char *maiden, const char *city,
00267                     const char *state, const char *country, int web);
00268     void (*get_dir)(GaimConnection *, const char *who);
00269     void (*dir_search)(GaimConnection *, const char *first,
00270                        const char *middle, const char *last,
00271                        const char *maiden, const char *city,
00272                        const char *state, const char *country,
00273                        const char *email);
00274     void (*set_idle)(GaimConnection *, int idletime);
00275     void (*change_passwd)(GaimConnection *, const char *old_pass,
00276                           const char *new_pass);
00277     void (*add_buddy)(GaimConnection *, const char *name, GaimGroup *group);
00278     void (*add_buddies)(GaimConnection *, GList *buddies);
00279     void (*remove_buddy)(GaimConnection *, const char *name,
00280                         const char *group);
00281     void (*remove_buddies)(GaimConnection *, GList *buddies,
00282                            const char *group);
00283     void (*add_permit)(GaimConnection *, const char *name);
00284     void (*add_deny)(GaimConnection *, const char *name);
00285     void (*rem_permit)(GaimConnection *, const char *name);
00286     void (*rem_deny)(GaimConnection *, const char *name);
00287     void (*set_permit_deny)(GaimConnection *);
00288     void (*warn)(GaimConnection *, const char *who, int anonymous);
00289     void (*join_chat)(GaimConnection *, GHashTable *components);
00290     void (*reject_chat)(GaimConnection *, GHashTable *components);
00291     void (*chat_invite)(GaimConnection *, int id,
00292                         const char *who, const char *message);
00293     void (*chat_leave)(GaimConnection *, int id);
00294     void (*chat_whisper)(GaimConnection *, int id,
00295                          const char *who, const char *message);
00296     int  (*chat_send)(GaimConnection *, int id, const char *message);
00297     void (*keepalive)(GaimConnection *);
00298 
00299     /* new user registration */
00300     void (*register_user)(GaimAccount *);
00301 
00302     /* get "chat buddy" info and away message */
00303     void (*get_cb_info)(GaimConnection *, int, const char *who);
00304     void (*get_cb_away)(GaimConnection *, int, const char *who);
00305 
00306     /* save/store buddy's alias on server list/roster */
00307     void (*alias_buddy)(GaimConnection *, const char *who,
00308                         const char *alias);
00309 
00310     /* change a buddy's group on a server list/roster */
00311     void (*group_buddy)(GaimConnection *, const char *who,
00312                         const char *old_group, const char *new_group);
00313 
00314     /* rename a group on a server list/roster */
00315     void (*rename_group)(GaimConnection *, const char *old_group,
00316                          const char *new_group, GList *members);
00317 
00318     void (*buddy_free)(GaimBuddy *);
00319 
00320     void (*convo_closed)(GaimConnection *, const char *who);
00321 
00322     const char *(*normalize)(const GaimAccount *, const char *);
00323 
00324     void (*set_buddy_icon)(GaimConnection *, const char *filename);
00325 
00326     void (*remove_group)(GaimConnection *gc, const char *group);
00327 
00328     char *(*get_cb_real_name)(GaimConnection *gc, int id, const char *who);
00329 
00330     void (*set_chat_topic)(GaimConnection *gc, int id, const char *topic);
00331 
00332     GaimChat *(*find_blist_chat)(GaimAccount *account, const char *name);
00333 
00334     /* room listing prpl callbacks */
00335     struct _GaimRoomlist *(*roomlist_get_list)(GaimConnection *gc);
00336     void (*roomlist_cancel)(struct _GaimRoomlist *list);
00337     void (*roomlist_expand_category)(struct _GaimRoomlist *list, struct _GaimRoomlistRoom *category);
00338 
00339     /* Chat specific menu in the buddy list */
00340     GList *(*chat_menu)(GaimConnection *, GHashTable *);
00341 };
00342 
00343 #define GAIM_IS_PROTOCOL_PLUGIN(plugin) \
00344     ((plugin)->info->type == GAIM_PLUGIN_PROTOCOL)
00345 
00346 #define GAIM_PLUGIN_PROTOCOL_INFO(plugin) \
00347     ((GaimPluginProtocolInfo *)(plugin)->info->extra_info)
00348 
00349 #define GAIM_PRPL_API_VERSION 2
00350 
00351 #ifdef __cplusplus
00352 extern "C" {
00353 #endif
00354 
00362 const char *gaim_prpl_num_to_id(GaimProtocol protocol);
00363 
00371 GaimProtocol gaim_prpl_id_to_num(const char *id);
00372 
00378 GaimPlugin *gaim_find_prpl(const char *id);
00379 
00380 #ifdef __cplusplus
00381 }
00382 #endif
00383 
00384 #endif /* _PRPL_H_ */

Generated on Sun Aug 29 03:45:05 2004 for gaim by doxygen 1.3.4