jplugin.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef JPLUGIN_H
00019 #define JPLUGIN_H
00020
00021 #include <qstring.h>
00022 #include <stdlib.h>
00023 #include <stdio.h>
00024 #include <klibloader.h>
00025
00026 extern "C" {
00027 #undef signals
00028 #include "JPilotAPI/libplugin.h"
00029
00030 #define signals protected
00031
00032
00033
00034
00039
00040 typedef int (*T_get_name)(char *name, int len);
00041 typedef int (*T_get_menu_name)(char *name, int len);
00042 typedef int (*T_get_help_name)(char *name, int len);
00043 typedef int (*T_get_db_name)(char *db_name, int len);
00044 typedef int (*T_startup)(jp_startup_info *info);
00045 typedef int (*T_gui)(GtkWidget *vbox, GtkWidget *hbox, unsigned int unique_id);
00046 typedef int (*T_help)(char **text, int *width, int *height);
00047 typedef int (*T_print)();
00048 typedef int (*T_gui_cleanup)(void);
00049 typedef int (*T_pre_sync)(void);
00050 typedef int (*T_sync)(int sd);
00051 typedef int (*T_search)(char *search_string, int case_sense, struct search_result **sr);
00052 typedef int (*T_post_sync)(void);
00053 typedef int (*T_exit_cleanup)(void);
00054 typedef void (*T_versionM)(int *major_version, int *minor_version);
00055
00056 }
00057
00058
00059
00060
00061 struct plugin_s {
00062 bool sync_on;
00063 unsigned char user_only;
00064 QString fullpath;
00065 QString name;
00066 QString menu_name;
00067 QString help_name;
00068 QString db_name;
00069 int number;
00070 };
00071
00072
00073 class JPlugin {
00074 public:
00075 JPlugin();
00076 JPlugin(QString filename);
00077 ~JPlugin();
00078 bool unload();
00079 bool load(QString fn);
00080 void init_info_null(struct plugin_s *p);
00081 void exit_info(struct plugin_s *);
00082 bool get_plugin_info(struct plugin_s *p, QString path);
00083
00084 int startup(jp_startup_info*si);
00085 int gui(GtkWidget*vbox, GtkWidget*hbox, unsigned int uID);
00086 int gui_cleanup();
00087 int help(char** text, int*width, int*height);
00088 int pre_sync();
00089 int sync(int sd);
00090 int post_sync();
00091 int exit_cleanup();
00092 bool hasGui();
00093
00094 bool loaded;
00095 plugin_s info;
00096 KLibrary *lib;
00097 };
00098
00099
00100
00101
00102 #endif
This file is part of the documentation for kpilot Library Version 3.2.2.