## AnjutaPluginManager AnjutaPluginManager — Plugins management and activation |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <libanjuta/anjuta-plugin-manager.h>

                        AnjutaPluginManagerPriv;
                        AnjutaPluginManager;
    AnjutaPluginManager* anjuta_plugin_manager_new          (GObject *shell,
                                                             AnjutaStatus *status,
                                                             GList *plugin_search_paths);
    GObject*            anjuta_plugin_manager_get_plugin    (AnjutaPluginManager *plugin_manager,
                                                             const gchar *iface_name);
    GObject*            anjuta_plugin_manager_get_plugin_by_id
                                                            (AnjutaPluginManager *plugin_manager,
                                                             const gchar *plugin_id);
    gboolean            anjuta_plugin_manager_unload_plugin (AnjutaPluginManager *plugin_manager,
                                                             GObject *plugin);
    gboolean            anjuta_plugin_manager_unload_plugin_by_id
                                                            (AnjutaPluginManager *plugin_manager,
                                                             const gchar *plugin_id);
    GList*              anjuta_plugin_manager_get_active_plugins
                                                            (AnjutaPluginManager *plugin_manager);
    GtkWidget*          anjuta_plugin_manager_get_dialog    (AnjutaPluginManager *plugin_manager);
    GList*              anjuta_plugin_manager_query         (AnjutaPluginManager *plugin_manager,
                                                             const gchar *section_name,
                                                             const gchar *attribute_name,
                                                             const gchar *attribute_value,
                                                             ...);
    AnjutaPluginDescription* anjuta_plugin_manager_select   (AnjutaPluginManager *plugin_manager,
                                                             gchar *title,
                                                             gchar *description,
                                                             GList *plugin_descriptions);
    GObject*            anjuta_plugin_manager_select_and_activate
                                                            (AnjutaPluginManager *plugin_manager,
                                                             gchar *title,
                                                             gchar *description,
                                                             GList *plugin_descriptions);
    void                anjuta_plugin_manager_unload_all_plugins
                                                            (AnjutaPluginManager *plugin_manager);
    #define             anjuta_plugin_manager_get_interface (plugin_manager, iface_type, error)

## Object Hierarchy

      GObject
       +----AnjutaPluginManager

## Properties

      "activated-plugins"        gpointer              : Read
      "available-plugins"        gpointer              : Read
      "profiles"                 gpointer              : Read
      "shell"                    GObject               : Read / Write / Construct
      "status"                   AnjutaStatus          : Read / Write / Construct

## Signals

      "plugin-activated"                               : Run First
      "plugin-deactivated"                             : Run First

## Description

## Details

### AnjutaPluginManagerPriv

    typedef struct _AnjutaPluginManagerPriv AnjutaPluginManagerPriv;

### AnjutaPluginManager

    typedef struct _AnjutaPluginManager AnjutaPluginManager;

### anjuta_plugin_manager_new ()

    AnjutaPluginManager* anjuta_plugin_manager_new          (GObject *shell,
                                                             AnjutaStatus *status,
                                                             GList *plugin_search_paths);

`shell` : |
`status` : |
`plugin_search_paths` : |
Returns : |

### anjuta_plugin_manager_get_plugin ()

    GObject*            anjuta_plugin_manager_get_plugin    (AnjutaPluginManager *plugin_manager,
                                                             const gchar *iface_name);

Searches the currently available plugins to find the one which implements the given interface as primary interface and returns it. If the plugin is not yet loaded, it will be loaded and activated. The returned object is garanteed to be an implementor of the interface (as exported by the plugin metafile). It only searches from the pool of plugin objects loaded in this shell and can only search by primary interface. If there are more objects implementing this primary interface, user might be prompted to select one from them (and might give the option to use it as default for future queries). A typical usage of this function is:

    GObject *docman =
        anjuta_plugin_manager_get_plugin (plugin_manager, "IAnjutaDocumentManager", error);

Notice that this function takes the interface name string as string, unlike `anjuta_plugins_get_interface()` which takes the type directly.

`plugin_manager` : |
`iface_name` : |
Returns : |

### anjuta_plugin_manager_get_plugin_by_id ()

    GObject*            anjuta_plugin_manager_get_plugin_by_id
                                                            (AnjutaPluginManager *plugin_manager,
                                                             const gchar *plugin_id);

`plugin_manager` : |
`plugin_id` : |
Returns : |

### anjuta_plugin_manager_unload_plugin ()

    gboolean            anjuta_plugin_manager_unload_plugin (AnjutaPluginManager *plugin_manager,
                                                             GObject *plugin);

`plugin_manager` : |
`plugin` : |
Returns : |

### anjuta_plugin_manager_unload_plugin_by_id ()

    gboolean            anjuta_plugin_manager_unload_plugin_by_id
                                                            (AnjutaPluginManager *plugin_manager,
                                                             const gchar *plugin_id);

`plugin_manager` : |
`plugin_id` : |
Returns : |

### anjuta_plugin_manager_get_active_plugins ()

    GList*              anjuta_plugin_manager_get_active_plugins
                                                            (AnjutaPluginManager *plugin_manager);

`plugin_manager` : |
Returns : |

### anjuta_plugin_manager_get_dialog ()

    GtkWidget*          anjuta_plugin_manager_get_dialog    (AnjutaPluginManager *plugin_manager);

`plugin_manager` : |
Returns : |

### anjuta_plugin_manager_query ()

    GList*              anjuta_plugin_manager_query         (AnjutaPluginManager *plugin_manager,
                                                             const gchar *section_name,
                                                             const gchar *attribute_name,
                                                             const gchar *attribute_value,
                                                             ...);

`plugin_manager` : |
`section_name` : |
`attribute_name` : |
`attribute_value` : |
`...` : |
Returns : |

### anjuta_plugin_manager_select ()

    AnjutaPluginDescription* anjuta_plugin_manager_select   (AnjutaPluginManager *plugin_manager,
                                                             gchar *title,
                                                             gchar *description,
                                                             GList *plugin_descriptions);

`plugin_manager` : |
`title` : |
`description` : |
`plugin_descriptions` : |
Returns : |

### anjuta_plugin_manager_select_and_activate ()

    GObject*            anjuta_plugin_manager_select_and_activate
                                                            (AnjutaPluginManager *plugin_manager,
                                                             gchar *title,
                                                             gchar *description,
                                                             GList *plugin_descriptions);

`plugin_manager` : |
`title` : |
`description` : |
`plugin_descriptions` : |
Returns : |

### anjuta_plugin_manager_unload_all_plugins ()

    void                anjuta_plugin_manager_unload_all_plugins
                                                            (AnjutaPluginManager *plugin_manager);

`plugin_manager` : |

### anjuta_plugin_manager_get_interface()

    #define             anjuta_plugin_manager_get_interface(plugin_manager, iface_type, error)

Equivalent to `anjuta_plugin_manager_get_object()`, but additionally typecasts returned object to the interface type. It also takes interface type directly. A usage of this function is:

    IAnjutaDocumentManager *docman =
        anjuta_plugin_manager_get_interface (plugin_manager, IAnjutaDocumentManager, error);

`plugin_manager` : |
`iface_type` : |
`error` : |

## Property Details

### The "`activated-plugins`" property

      "activated-plugins"        gpointer              : Read

Currently activated plugins.

### The "`available-plugins`" property

      "available-plugins"        gpointer              : Read

Currently available plugins found in plugin paths.

### The "`profiles`" property

      "profiles"                 gpointer              : Read

Current stack of profiles.

### The "`shell`" property

      "shell"                    GObject               : Read / Write / Construct

Anjuta shell for which the plugins are.

### The "`status`" property

      "status"                   AnjutaStatus          : Read / Write / Construct

Anjuta status to use in loading and unloading of plugins.

## Signal Details

### The "plugin-activated" signal

    void                user_function                      (AnjutaPluginManager *anjutapluginmanager,
                                                            gpointer             arg1,
                                                            AnjutaPlugin        *arg2,
                                                            gpointer             user_data)                : Run First

`anjutapluginmanager` : | the object which received the signal.
`arg1` : |
`arg2` : |
`user_data` : | user data set when the signal handler was connected.

### The "plugin-deactivated" signal

    void                user_function                      (AnjutaPluginManager *anjutapluginmanager,
                                                            gpointer             arg1,
                                                            AnjutaPlugin        *arg2,
                                                            gpointer             user_data)                : Run First

`anjutapluginmanager` : | the object which received the signal.
`arg1` : |
`arg2` : |
`user_data` : | user data set when the signal handler was connected.

## See Also

AnjutaPlugin, AnjutaProfileManager