diff options
Diffstat (limited to 'e-util/e-import.h')
-rw-r--r-- | e-util/e-import.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/e-util/e-import.h b/e-util/e-import.h index 8215604c69..b0ffe3b3d5 100644 --- a/e-util/e-import.h +++ b/e-util/e-import.h @@ -185,6 +185,76 @@ void e_import_target_free(EImport *ep, gpointer o); EImportTargetURI *e_import_target_new_uri(EImport *ei, const gchar *suri, const gchar *duri); EImportTargetHome *e_import_target_new_home(EImport *ei); +/* ********************************************************************** */ + +/* import plugin target, they are closely integrated */ + +/* To implement a basic import plugin, you just need to subclass + this and initialise the class target type tables */ + +#include "e-util/e-plugin.h" + +typedef struct _EPluginHookTargetMap EImportHookTargetMap; +typedef struct _EPluginHookTargetKey EImportHookTargetMask; + +typedef struct _EImportHook EImportHook; +typedef struct _EImportHookClass EImportHookClass; + +typedef struct _EImportHookImporter EImportHookImporter; + +struct _EImportHookImporter { + EImportImporter importer; + + /* user_data == EImportHook */ + + gchar *supported; + gchar *get_widget; + gchar *import; + gchar *cancel; +}; + +/** + * struct _EImportHook - Plugin hook for importuration windows. + * + * @hook: Superclass. + * @groups: A list of EImportHookGroup's of all importuration windows + * this plugin hooks into. + * + **/ +struct _EImportHook { + EPluginHook hook; + + GSList *importers; +}; + +/** + * struct _EImportHookClass - Abstract class for importuration window + * plugin hooks. + * + * @hook_class: Superclass. + * @target_map: A table of EImportHookTargetMap structures describing + * the possible target types supported by this class. + * @import_class: The EImport derived class that this hook + * implementation drives. + * + * This is an abstract class defining the plugin hook point for + * importuration windows. + * + **/ +struct _EImportHookClass { + EPluginHookClass hook_class; + + /* EImportHookTargetMap by .type */ + GHashTable *target_map; + /* the import class these imports's belong to */ + EImportClass *import_class; +}; + +GType e_import_hook_get_type(void); + +/* for implementors */ +void e_import_hook_class_add_target_map(EImportHookClass *klass, const EImportHookTargetMap *); + G_END_DECLS #endif /* __E_IMPORT_H__ */ |