00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _PLUGIN_API_H
00023 #define _PLUGIN_API_H
00024
00025 #include "input_list.h"
00026 #include "account.h"
00027
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031
00032
00033 #define API_MAJOR_VERSION 0
00034 #define API_MINOR_VERSION 1
00035 typedef enum {
00036 PLUGIN_SERVICE=1,
00037 PLUGIN_UTILITY,
00038 PLUGIN_SOUND,
00039 PLUGIN_LOG,
00040 PLUGIN_GUI,
00041 PLUGIN_UNKNOWN
00042 } PLUGIN_TYPE;
00043
00044 typedef int (*eb_plugin_func)();
00045
00046 typedef struct {
00047 PLUGIN_TYPE type;
00048 char *brief_desc;
00049 char *full_desc;
00050 char *version;
00051 char *date;
00052 int *ref_count;
00053 eb_plugin_func init;
00054 eb_plugin_func finish;
00055 input_list *prefs;
00056 } PLUGIN_INFO;
00057
00058
00059
00060 #define IS_ebmCallbackData(x) (x->CDType>=ebmCALLBACKDATA)
00061
00062 #define EB_IMPORT_MENU "IMPORT MENU"
00063 #define IS_ebmImportData(x) (x->CDType==ebmIMPORTDATA)
00064 #define EB_PROFILE_MENU "PROFILE MENU"
00065 #define IS_ebmProfileData(x) (x->CDType==ebmPROFILEDATA)
00066 #define EB_CHAT_WINDOW_MENU "CHAT MENU"
00067 #define EB_CONTACT_MENU "CONTACT MENU"
00068 #define IS_ebmContactData(x) (x->CDType==ebmCONTACTDATA)
00069
00070 typedef enum {
00071 ebmCALLBACKDATA=10,
00072 ebmIMPORTDATA,
00073 ebmCONTACTDATA,
00074 ebmPROFILEDATA
00075 } ebmType;
00076
00077 typedef struct {
00078 ebmType CDType;
00079 void *user_data;
00080 } ebmCallbackData;
00081
00082
00083 typedef struct {
00084 ebmCallbackData cd;
00085 char *MenuName;
00086 } ebmImportData;
00087
00088 typedef struct {
00089 ebmCallbackData cd;
00090 char *contact;
00091 char *remote_account;
00092 } ebmContactData;
00093
00094 typedef void (*eb_callback_action) (void *data, int value);
00095 typedef void (*eb_menu_callback) (ebmCallbackData *data);
00096
00097 ebmCallbackData *ebmProfileData_new(eb_local_account * ela);
00098 ebmImportData *ebmImportData_new();
00099 ebmContactData *ebmContactData_new();
00100 void eb_set_active_menu_status(GSList *status_menu, int status);
00101 void eb_do_dialog(char *message, char *title, eb_callback_action action, void *data);
00102
00103
00104
00105
00106
00107
00108
00109
00110 void *eb_add_menu_item(char *label, char *menu_name, eb_menu_callback callback, ebmType type, void *data);
00111
00112
00113 int eb_remove_menu_item(char *menu_name, void *tag);
00114
00115
00116 typedef enum {
00117 EB_INPUT_READ = 1 << 0,
00118 EB_INPUT_WRITE = 1 << 1,
00119 EB_INPUT_EXCEPTION = 1 << 2
00120 } eb_input_condition;
00121
00122 typedef void (*eb_input_function) (void *data, int source, eb_input_condition condition);
00123
00124
00125 int eb_input_add(int fd, eb_input_condition condition, eb_input_function function,
00126 void *callback_data);
00127 void eb_input_remove(int tag);
00128 const char *eb_config_dir();
00129
00130
00131
00132
00133 #include "debug.h"
00134
00135 #if defined(__MINGW32__) && defined(__IN_PLUGIN__)
00136 __declspec(dllimport) gint do_plugin_debug;
00137 #else
00138 extern gint do_plugin_debug;
00139 #endif
00140 #define DBG_MOD do_plugin_debug
00141
00142 #ifdef __cplusplus
00143 }
00144 #endif
00145
00146 #endif