EPlugin: Evolution Utilities Reference Manual

## EPlugin EPlugin |

## Functions

gint | e_plugin_construct ()
gint | e_plugin_load_plugins ()
GSList * | e_plugin_list_plugins ()
gpointer | e_plugin_get_symbol ()
gpointer | e_plugin_invoke ()
void | e_plugin_enable ()
GtkWidget * | e_plugin_get_configure_widget ()
gchar * | e_plugin_xml_prop ()
gchar * | e_plugin_xml_prop_domain ()
gint | e_plugin_xml_int ()
gchar * | e_plugin_xml_content ()
gchar * | e_plugin_xml_content_domain ()
EPluginHook * | e_plugin_hook_new ()
void | e_plugin_hook_enable ()
guint32 | e_plugin_hook_mask ()
guint32 | e_plugin_hook_id ()

## Properties

gboolean | enabled | Read / Write

## Types and Values

#define | E_PLUGIN_CLASSID
struct | EPluginAuthor
enum | EPluginFlags
struct | EPlugin
struct | EPluginHook
struct | EPluginHookTargetMap
struct | EPluginHookTargetKey

## Object Hierarchy

        GObject
        ├── EPlugin
        ╰── EPluginHook
            ├── EConfigHook
            ├── EEventHook
            ├── EImportHook
            ╰── EPluginUIHook

## Description

## Functions

### e_plugin_construct ()

    gint
    e_plugin_construct (EPlugin *plugin,
                        xmlNodePtr root);

Helper to invoke the construct virtual method.

#### Parameters

plugin | an EPlugin |
root | The XML root node of the sub-tree containing the plugin definition. |

#### Returns

The return from the construct virtual method.

### e_plugin_load_plugins ()

    gint
    e_plugin_load_plugins (void);

Scan the search path, looking for plugin definitions, and load them into memory.

#### Returns

Returns -1 if an error occurred.

### e_plugin_list_plugins ()

    GSList *
    e_plugin_list_plugins (void);

### e_plugin_get_symbol ()

    gpointer
    e_plugin_get_symbol (EPlugin *plugin,
                         const gchar *name);

Helper to fetch a symbol name from a plugin.

#### Parameters

plugin | an EPlugin |
name | The name of the symbol to fetch. The format of this name will depend on the EPlugin type and its language conventions. |

#### Returns

the symbol value, or `NULL` if not found

### e_plugin_invoke ()

    gpointer
    e_plugin_invoke (EPlugin *plugin,
                     const gchar *name,
                     gpointer data);

Helper to invoke the invoke virtual method.

#### Parameters

plugin | an EPlugin |
name | The name of the function to invoke. The format of this name will depend on the EPlugin type and its language conventions. |
data | The argument to the function. Its actual type depends on the hook on which the function resides. It is up to the called function to get this right. |

#### Returns

The return of the plugin invocation.

### e_plugin_enable ()

    void
    e_plugin_enable (EPlugin *plugin,
                     gint state);

Set the enable state of a plugin.

THIS IS NOT FULLY IMPLEMENTED YET

#### Parameters

plugin | an EPlugin |
state | `TRUE` to enable, `FALSE` to disable |

### e_plugin_get_configure_widget ()

    GtkWidget *
    e_plugin_get_configure_widget (EPlugin *plugin);

Plugin itself should have implemented "e_plugin_lib_get_configure_widget" function * of prototype EPluginLibGetConfigureWidgetFunc.

#### Parameters

plugin | an EPlugin |

#### Returns

Configure widget or `NULL`

### e_plugin_xml_prop ()

    gchar *
    e_plugin_xml_prop (xmlNodePtr node,
                       const gchar *id);

A static helper function to look up a property on an XML node, and ensure it is allocated in GLib system memory.

#### Parameters

node | An XML node. |
id | The name of the property to retrieve. |

#### Returns

The property, allocated in GLib memory, or NULL if no such property exists.

### e_plugin_xml_prop_domain ()

    gchar *
    e_plugin_xml_prop_domain (xmlNodePtr node,
                              const gchar *id,
                              const gchar *domain);

A static helper function to look up a property on an XML node, and translate it based on `domain` .

#### Parameters

node | An XML node. |
id | The name of the property to retrieve. |
domain | The translation domain for this string. |

#### Returns

The property, allocated in GLib memory, or NULL if no such property exists.

### e_plugin_xml_int ()

    gint
    e_plugin_xml_int (xmlNodePtr node,
                      const gchar *id,
                      gint def);

A static helper function to look up a property on an XML node as an integer. If the property doesn't exist, then `def` is returned as a default value instead.

#### Parameters

node | An XML node. |
id | The name of the property to retrieve. |
def | A default value if the property doesn't exist. Can be used to determine if the property isn't set. |

#### Returns

The value if set, or `def` if not.

### e_plugin_xml_content ()

    gchar *
    e_plugin_xml_content (xmlNodePtr node);

A static helper function to retrieve the entire textual content of an XML node, and ensure it is allocated in GLib system memory. If GLib isn't using the system malloc them it must copy the content.

#### Returns

The node content, allocated in GLib memory.

### e_plugin_xml_content_domain ()

    gchar *
    e_plugin_xml_content_domain (xmlNodePtr node,
                                 const gchar *domain);

A static helper function to retrieve the entire textual content of an XML node, and ensure it is allocated in GLib system memory. If GLib isn't using the system malloc them it must copy the content.

#### Returns

The node content, allocated in GLib memory.

### e_plugin_hook_new ()

    EPluginHook *
    e_plugin_hook_new (EPlugin *plugin,
                       xmlNodePtr root);

### e_plugin_hook_enable ()

    void
    e_plugin_hook_enable (EPluginHook *plugin_hook,
                          gint state);

Set the enabled state of the plugin hook. This is called by the plugin code.

THIS IS NOT FULY IMEPLEMENTED YET

### e_plugin_hook_mask ()

    guint32
    e_plugin_hook_mask (xmlNodePtr root,
                        const EPluginHookTargetKey *map,
                        const gchar *prop);

This is a static helper function which looks up a property `prop` on the XML node `root` , and then uses the `map` table to convert it into a bitmask. The property value is a comma separated list of enumeration strings which are indexed into the `map` table.

#### Parameters

root | An XML node. |
map | A zero-fill terminated array of EPluginHookTargeKeys used to map a string with a bit value. |
prop | The property name. |

#### Returns

A bitmask representing the inclusive-or of all of the integer values of the corresponding string id's stored in the `map` .

### e_plugin_hook_id ()

    guint32
    e_plugin_hook_id (xmlNodePtr root,
                      const EPluginHookTargetKey *map,
                      const gchar *prop);

This is a static helper function which looks up a property `prop` on the XML node `root` , and then uses the `map` table to convert it into an integer.

This is used as a helper wherever you need to represent an enumerated value in the XML.

#### Returns

If the `prop` value is in `map` , then the corresponding integer value, if not, then ~0.

## Types and Values

### E_PLUGIN_CLASSID

    #define E_PLUGIN_CLASSID "org.gnome.evolution.plugin"

### struct EPluginAuthor

    struct EPluginAuthor {
    	gchar *name;
    	gchar *email;
    };

### enum EPluginFlags

#### Members

E_PLUGIN_FLAGS_SYSTEM_PLUGIN |  |

### struct EPlugin

    struct EPlugin;

### struct EPluginHook

    struct EPluginHook;

### struct EPluginHookTargetMap

    struct EPluginHookTargetMap {
    	const gchar *type;
    	gint id;
    	const EPluginHookTargetKey *mask_bits; /* null terminated array */
    };

### struct EPluginHookTargetKey

    struct EPluginHookTargetKey {
    	const gchar *key;
    	guint32 value;
    };

## Property Details

### The `“enabled”` property

      “enabled”                  gboolean

Whether the plugin is enabled.

Flags: Read / Write

Default value: TRUE