Yattm - unified GTK instant-messaging client logo
   [Generated for version 0.2-17 - Mon Jan 6 19:01:23 GMT+1 2003]

Home - Main Page - Data Structures - File List - Data Fields - Globals

plugin_api.h

Go to the documentation of this file.
00001 /*
00002  * Yattm 
00003  *
00004  * Copyright (C) 1999, Torrey Searle <tsearle@uci.edu>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 /* Plugin */
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 /* GUI */
00059 
00060 #define IS_ebmCallbackData(x) (x->CDType>=ebmCALLBACKDATA)
00061 /* Names of menus and the data structure passed to callbacks for them */
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;      /* Name of the contact we're chatting with */
00091     char *remote_account;   /* The actual account name the contact is using */
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 /* eb_add_menu_item returns a tag, which can be used by eb_remove_menu_item 
00104  * label:   The name of the menu item to add to the menu
00105  * menu_name:   The name of the menu to add the item to, as in EB_IMPORT_MENU
00106  * eb_menu_callback: The function to call when the menu item is selected
00107  * type:    The expected type of data passed to the callback for this menu
00108  * data:    Any user data to be passed along with the menu data
00109  */
00110 void *eb_add_menu_item(char *label, char *menu_name, eb_menu_callback callback, ebmType type, void *data);
00111 /* FIXME: Want an eb_add_menu_item_condition function */
00112 /* tag comes from a call to eb_add_menu_item, returns 0 on success */
00113 int eb_remove_menu_item(char *menu_name, void *tag);
00114 
00115 /* File */
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 /* Returns a tag to be used by eb_input_remove */
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 /* Service */
00131 
00132 /* Debugging */
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 } /* extern "C" */
00144 #endif
00145 
00146 #endif /* _PLUGIN_API_H */

Contact: Andy Maloney     [Documentation generated by doxygen]