00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __SERVICE_H__
00028 #define __SERVICE_H__
00029
00030 #include "chat_room.h"
00031 #include "input_list.h"
00032
00033
00034 extern int NUM_SERVICES;
00035 #define GET_SERVICE(x) eb_services[x->service_id]
00036 #define RUN_SERVICE(x) GET_SERVICE(x).sc
00037
00038 struct service_callbacks {
00039
00040 gboolean (*query_connected) (eb_account *account);
00041
00042
00043
00044 void (*login) (eb_local_account *account);
00045
00046
00047 void (*logout) (eb_local_account *account);
00048
00049
00050 void (*send_im) (eb_local_account *account_from,
00051 eb_account *account_to,
00052 gchar *message);
00053
00054
00055
00056
00057
00058 int (*send_typing) (eb_local_account *account_from,
00059 eb_account *account_to);
00060
00061
00062 eb_local_account * (*read_local_account_config) (GList * values);
00063
00064
00065 GList * (*write_local_config)( eb_local_account * account );
00066
00067
00068 eb_account * (*read_account_config) (GList * config,
00069 struct contact *contact);
00070
00071
00072 GList * (*get_states)();
00073
00074
00075 gint (*get_current_state)(eb_local_account * account);
00076
00077
00078 void (*set_current_state)(eb_local_account * account, gint state);
00079
00080
00081 char * (*check_login)(char * login, char * pass);
00082
00083
00084 void (*add_user)(eb_account * account);
00085
00086
00087 void (*del_user)(eb_account * account);
00088
00089
00090 void (*ignore_user)(eb_account * account);
00091
00092
00093 void (*unignore_user)(eb_account * account, gchar *new_group);
00094
00095
00096
00097
00098 void (*change_group)(eb_account * account, gchar *new_group);
00099
00100
00101 gboolean (*is_suitable)(eb_local_account *local, eb_account *remote);
00102
00103
00104 eb_account*(*new_account)( gchar * account );
00105
00106
00107
00108
00109
00110 gchar*(*get_status_string)(eb_account * account);
00111
00112
00113
00114
00115
00116 void (*get_status_pixmap)(eb_account * account, GdkPixmap **pm, GdkBitmap **bm);
00117
00118
00119
00120 void (*set_idle)(eb_local_account * account, gint idle );
00121
00122
00123
00124 void (*set_away)(eb_local_account * account, gchar * message );
00125
00126
00127
00128 void (*send_chat_room_message)(eb_chat_room * room, gchar * message);
00129
00130
00131
00132 void (*join_chat_room)(eb_chat_room * room);
00133 void (*leave_chat_room)(eb_chat_room * room);
00134
00135
00136
00137 eb_chat_room * (*make_chat_room)(gchar * name, eb_local_account * account);
00138
00139
00140
00141 void (*send_invite)( eb_local_account * account, eb_chat_room * room,
00142 char * user, char * message);
00143
00144 void (*accept_invite)( eb_local_account * account, void * invitation );
00145
00146 void (*decline_invite)( eb_local_account * account, void * inviatation );
00147
00148
00149
00150 void (*send_file)( eb_local_account * from, eb_account * to, char * file );
00151
00152
00153
00154
00155
00156 void (*terminate_chat)(eb_account * account );
00157
00158
00159 void(*get_info)(eb_local_account * account_from, eb_account * account_to);
00160
00161
00162
00163
00164
00165
00166 input_list * (*get_prefs)();
00167
00168
00169
00170
00171
00172 void (*read_prefs_config) (GList * values);
00173
00174
00175
00176
00177
00178
00179 GList * (*write_prefs_config)();
00180 GList * (*add_importers)(GList *);
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190 GList * (*get_smileys)(void);
00191
00192
00193
00194 gchar * (*get_color)(void);
00195 };
00196
00197
00198
00199
00200
00201 struct service {
00202 gchar *name;
00203 gint protocol_id;
00204 gboolean offline_messaging;
00205 gboolean group_chat;
00206 gboolean file_transfer;
00207 gboolean can_iconvert;
00208 struct service_callbacks *sc;
00209 };
00210
00211
00212 #ifdef __cplusplus
00213 extern "C" {
00214 #endif
00215
00216 gint add_service(struct service *Service_Info);
00217 gint get_service_id( gchar * servicename );
00218 gchar* get_service_name( gint serviceid );
00219
00220 void load_modules();
00221
00222 #if defined(__MINGW32__) && defined(__IN_PLUGIN__)
00223 __declspec(dllimport) struct service eb_services[];
00224 #else
00225 extern struct service eb_services[];
00226 #endif
00227
00228 void add_idle_check();
00229 void serv_touch_idle();
00230
00231 void rename_nick_log(char *oldnick, char *newnick);
00232
00233 GList * get_service_list();
00234
00235 #ifdef __cplusplus
00236 }
00237 #endif
00238
00239 #endif