IAnjutaProjectManager

## IAnjutaProjectManager IAnjutaProjectManager — Interface for project managers |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <libanjuta/interfaces/ianjuta-project-manager.h>

    #define             IANJUTA_PROJECT_MANAGER_ERROR
    #define             IANJUTA_PROJECT_MANAGER_PROJECT_ROOT_URI
    #define             IANJUTA_PROJECT_MANAGER_CURRENT_PROJECT
    #define             IANJUTA_PROJECT_MANAGER_CURRENT_URI
    struct              IAnjutaProjectManagerIface;
    GQuark              ianjuta_project_manager_error_quark (void);
    GFile *             ianjuta_project_manager_add_group   (IAnjutaProjectManager *obj,
                                                             const gchar *name,
                                                             GFile *default_group,
                                                             GError **err);
    GFile *             ianjuta_project_manager_add_source  (IAnjutaProjectManager *obj,
                                                             const gchar *name,
                                                             GFile *default_target,
                                                             GError **err);
    GFile *             ianjuta_project_manager_add_source_quiet
                                                            (IAnjutaProjectManager *obj,
                                                             const gchar *name,
                                                             GFile *target,
                                                             GError **err);
    GList *             ianjuta_project_manager_add_sources (IAnjutaProjectManager *obj,
                                                             GList *names,
                                                             GFile *default_target,
                                                             GError **err);
    GFile *             ianjuta_project_manager_add_target  (IAnjutaProjectManager *obj,
                                                             const gchar *name,
                                                             GFile *default_group,
                                                             GError **err);
    guint               ianjuta_project_manager_get_capabilities
                                                            (IAnjutaProjectManager *obj,
                                                             GError **err);
    GList *             ianjuta_project_manager_get_children
                                                            (IAnjutaProjectManager *obj,
                                                             GFile *parent,
                                                             gint children_type,
                                                             GError **err);
    IAnjutaProject *    ianjuta_project_manager_get_current_project
                                                            (IAnjutaProjectManager *obj,
                                                             GError **err);
    GList *             ianjuta_project_manager_get_elements
                                                            (IAnjutaProjectManager *obj,
                                                             AnjutaProjectNodeType element_type,
                                                             GError **err);
    GList *             ianjuta_project_manager_get_packages
                                                            (IAnjutaProjectManager *obj,
                                                             GError **err);
    GFile *             ianjuta_project_manager_get_parent  (IAnjutaProjectManager *obj,
                                                             GFile *element,
                                                             GError **err);
    GFile *             ianjuta_project_manager_get_selected
                                                            (IAnjutaProjectManager *obj,
                                                             GError **err);
    AnjutaProjectNodeType ianjuta_project_manager_get_target_type
                                                            (IAnjutaProjectManager *obj,
                                                             GFile *target,
                                                             GError **err);
    GList *             ianjuta_project_manager_get_targets (IAnjutaProjectManager *obj,
                                                             AnjutaProjectNodeType target_type,
                                                             GError **err);
    gboolean            ianjuta_project_manager_is_open     (IAnjutaProjectManager *obj,
                                                             GError **err);
    gboolean            ianjuta_project_manager_remove_file (IAnjutaProjectManager *obj,
                                                             GFile *file,
                                                             GError **err);

## Description

## Details

### IANJUTA_PROJECT_MANAGER_ERROR

    #define IANJUTA_PROJECT_MANAGER_ERROR ianjuta_project_manager_error_quark()

### IANJUTA_PROJECT_MANAGER_PROJECT_ROOT_URI

    #define IANJUTA_PROJECT_MANAGER_PROJECT_ROOT_URI "project_root_uri"

Anjuta shell value set by project manager to the project root uri.

### IANJUTA_PROJECT_MANAGER_CURRENT_PROJECT

    #define IANJUTA_PROJECT_MANAGER_CURRENT_PROJECT "project_manager_current_project"

Anjuta shell value set by project manager to the current project object which implement IAnjutaProject interface.

### IANJUTA_PROJECT_MANAGER_CURRENT_URI

    #define IANJUTA_PROJECT_MANAGER_CURRENT_URI "project_manager_current_uri"

Anjuta shell value set by project manager to the current uri.

### struct IAnjutaProjectManagerIface

    struct IAnjutaProjectManagerIface {
    	GTypeInterface g_iface;

    	/* Signal */
    	void (*element_added) (IAnjutaProjectManager *obj, GFile *element);
    	/* Signal */
    	void (*element_removed) (IAnjutaProjectManager *obj, GFile *element);
    	/* Signal */
    	void (*element_selected) (IAnjutaProjectManager *obj, GFile *element);
    	/* Signal */
    	void (*project_loaded) (IAnjutaProjectManager *obj, GError *error);

    	GFile* (*add_group) (IAnjutaProjectManager *obj, const gchar *name,  GFile *default_group, GError **err);
    	GFile* (*add_source) (IAnjutaProjectManager *obj, const gchar *name,  GFile *default_target, GError **err);
    	GFile* (*add_source_quiet) (IAnjutaProjectManager *obj, const gchar *name,  GFile *target, GError **err);
    	GList* (*add_sources) (IAnjutaProjectManager *obj, GList* names,  GFile *default_target, GError **err);
    	GFile* (*add_target) (IAnjutaProjectManager *obj, const gchar *name,  GFile *default_group, GError **err);
    	guint (*get_capabilities) (IAnjutaProjectManager *obj, GError **err);
    	GList* (*get_children) (IAnjutaProjectManager *obj, GFile *parent,  gint children_type, GError **err);
    	IAnjutaProject* (*get_current_project) (IAnjutaProjectManager *obj, GError **err);
    	GList* (*get_elements) (IAnjutaProjectManager *obj, AnjutaProjectNodeType element_type, GError **err);
    	GList* (*get_packages) (IAnjutaProjectManager *obj, GError **err);
    	GFile* (*get_parent) (IAnjutaProjectManager *obj, GFile *element, GError **err);
    	GFile* (*get_selected) (IAnjutaProjectManager *obj, GError **err);
    	AnjutaProjectNodeType (*get_target_type) (IAnjutaProjectManager *obj, GFile *target, GError **err);
    	GList* (*get_targets) (IAnjutaProjectManager *obj, AnjutaProjectNodeType target_type, GError **err);
    	gboolean (*is_open) (IAnjutaProjectManager *obj, GError **err);
    	gboolean (*remove_file) (IAnjutaProjectManager *obj, GFile *file, GError **err);
    };

### ianjuta_project_manager_error_quark ()

    GQuark              ianjuta_project_manager_error_quark (void);

### ianjuta_project_manager_add_group ()

    GFile *             ianjuta_project_manager_add_group   (IAnjutaProjectManager *obj,
                                                             const gchar *name,
                                                             GFile *default_group,
                                                             GError **err);

Prompts the user to add a new group to the project. The user can select a parent group different from the one set as default.

`obj` : | Self.
`name` : | Group name or URI.
`default_group` : | A GFile corresponding to the default parent group or `NULL` if don't care. [allow-none]
`err` : | Error propagation and reporting.
Returns : | A GFile corresponding to the new group added in the project. You own the returned file; use `g_object_unref()` to release it. [transfer full]

### ianjuta_project_manager_add_source ()

    GFile *             ianjuta_project_manager_add_source  (IAnjutaProjectManager *obj,
                                                             const gchar *name,
                                                             GFile *default_target,
                                                             GError **err);

Prompts the user to add a file to the project. If the user selects multiple files only the first source file is returned.

You can add non existing file. In this case the element_added signal will be emitted with a non existing file. So it is up to the caller to reemit this signal later when the file is created.

`obj` : | Self.
`name` : | Source name or URI.
`default_target` : | A GFile corresponding to the default target or group or `NULL` if you don't care. [allow-none]
`err` : | Error propagation and reporting.
Returns : | A GFile corresponding to the new source file in the project view. You own the returned file; use `g_object_unref()` to release it. [transfer full]

### ianjuta_project_manager_add_source_quiet ()

    GFile *             ianjuta_project_manager_add_source_quiet
                                                            (IAnjutaProjectManager *obj,
                                                             const gchar *name,
                                                             GFile *target,
                                                             GError **err);

Adds a file to the project without prompting the user.

You can add non existing file. In this case the element_added signal will be emitted with a non existing file. So it is up to the caller to reemit this signal later when the file is created.

`obj` : | Self.
`name` : | Source name or URI.
`target` : | A GFile corresponding to the parent target or group.
`err` : | Error propagation and reporting.
Returns : | A GFile corresponding to the new source file in the project view. You own the returned file; use `g_object_unref()` to release it. [transfer full]

### ianjuta_project_manager_add_sources ()

    GList *             ianjuta_project_manager_add_sources (IAnjutaProjectManager *obj,
                                                             GList *names,
                                                             GFile *default_target,
                                                             GError **err);

Prompts the user to add several files to the project. Depending on the project backend, it can be possible that the source files must be located in a particular directory.

You can add non existing file. In this case the element_added signal will be emitted with a non existing file. So it is up to the caller to reemit this signal later when the file is created.

`obj` : | Self.
`names` : | Sources name or URI to add. [element-type utf8]
`default_target` : | A GFile corresponding to the default target or group or `NULL` if don't care. [allow-none]
`err` : | Error propagation and reporting.
Returns : | A list of GFile corresponding to all new source files added in the project. You own the list with the the returned files; use `g_list_free()` and `g_object_unref()` on each file to release them. [element-type GFile][transfer full]

### ianjuta_project_manager_add_target ()

    GFile *             ianjuta_project_manager_add_target  (IAnjutaProjectManager *obj,
                                                             const gchar *name,
                                                             GFile *default_group,
                                                             GError **err);

Prompts the user to add a new target to the project. The user can select a parent group different from the one set as default.

`obj` : | Self
`name` : | Target name or URI.
`default_group` : | A GFile corresponding to the default parent group or `NULL` if don't care. [allow-none]
`err` : | Error propagation and reporting.
Returns : | A GFile corresponding to the new target added in the project. You own the returned file; use `g_object_unref()` to release it. [transfer full]

### ianjuta_project_manager_get_capabilities ()

    guint               ianjuta_project_manager_get_capabilities
                                                            (IAnjutaProjectManager *obj,
                                                             GError **err);

Gets the capabilites of project whether it can add group, target sources etc.

`obj` : | Self
`err` : | Error propagation and reporting.
Returns : | Supported capabilites.

### ianjuta_project_manager_get_children ()

    GList *             ianjuta_project_manager_get_children
                                                            (IAnjutaProjectManager *obj,
                                                             GFile *parent,
                                                             gint children_type,
                                                             GError **err);

Recursively gets the list of all children below the corresponding parent having the specify type.

`obj` : | Self
`parent` : | A GFile corresponding to the parent.
`children_type` : | Select one element type: source, group or target
`err` : | Error propagation and reporting.
Returns : | The list of GFile corresponding to all children or `NULL` if the element has no children with the corresponding type. Free the returned * list with `g_list_free()` and the files with `g_object_unref()`. [element-type GFile][transfer full]

### ianjuta_project_manager_get_current_project ()

    IAnjutaProject *    ianjuta_project_manager_get_current_project
                                                            (IAnjutaProjectManager *obj,
                                                             GError **err);

Gets the current project.

`obj` : | Self
`err` : | Error propagation and reporting.
Returns : | the currently active project. NULL if none is there. [transfer none]

### ianjuta_project_manager_get_elements ()

    GList *             ianjuta_project_manager_get_elements
                                                            (IAnjutaProjectManager *obj,
                                                             AnjutaProjectNodeType element_type,
                                                             GError **err);

Get a list of all elements of this type in the project.

`obj` : | Self
`element_type` : | Select one element type: source, group or target
`err` : | Error propagation and reporting.
Returns : | Get list of GFile corresponding to all valid elements or `NULL` if there are no elements of this type. Free the returned list with `g_list_free()` and the files with `g_object_unref()`. [element-type GFile][transfer full]

### ianjuta_project_manager_get_packages ()

    GList *             ianjuta_project_manager_get_packages
                                                            (IAnjutaProjectManager *obj,
                                                             GError **err);

`obj` : | Self
`err` : | Error propagation and reporting.
Returns : | the list of pkg-config packages that the current project requires in it's configure.ac. Can be NULL if there is no project opened currently or no package is required. [element-type utf8][transfer container]

### ianjuta_project_manager_get_parent ()

    GFile *             ianjuta_project_manager_get_parent  (IAnjutaProjectManager *obj,
                                                             GFile *element,
                                                             GError **err);

Gets the parent of the corresponding child.

`obj` : | Self
`element` : | A GFile corresponding to one child.
`err` : | Error propagation and reporting.
Returns : | The parent of the child, or `NULL` if the element is the root.

### ianjuta_project_manager_get_selected ()

    GFile *             ianjuta_project_manager_get_selected
                                                            (IAnjutaProjectManager *obj,
                                                             GError **err);

Gets the currently selected element in the project manager view.

`obj` : | Self
`err` : | Error propagation and reporting.
Returns : | A GFile corresponding to the selected element in the project view. You own the returned file; use `g_object_unref()` to release it. [transfer full]

### ianjuta_project_manager_get_target_type ()

    AnjutaProjectNodeType ianjuta_project_manager_get_target_type
                                                            (IAnjutaProjectManager *obj,
                                                             GFile *target,
                                                             GError **err);

Get the type of the corresponding target: program, library...

`obj` : | Self
`target` : | A GFile corresponding to a target
`err` : | Error propagation and reporting.
Returns : | Return the type of the target.

### ianjuta_project_manager_get_targets ()

    GList *             ianjuta_project_manager_get_targets (IAnjutaProjectManager *obj,
                                                             AnjutaProjectNodeType target_type,
                                                             GError **err);

Get a list of targets in the project with the corresponding type.

`obj` : | Self
`target_type` : | type of the target
`err` : | Error propagation and reporting.
Returns : | A list of GFile corresponding to each target of the requested type or `NULL` if none exists. Free the returned list with `g_list_free()` and the files with `g_object_unref()`. [element-type GFile][transfer full]

### ianjuta_project_manager_is_open ()

    gboolean            ianjuta_project_manager_is_open     (IAnjutaProjectManager *obj,
                                                             GError **err);

Gets whether a project is currently opened.

`obj` : | Self
`err` : | Error propagation and reporting.
Returns : | `TRUE` if a project is opened.

### ianjuta_project_manager_remove_file ()

    gboolean            ianjuta_project_manager_remove_file (IAnjutaProjectManager *obj,
                                                             GFile *file,
                                                             GError **err);

Remove a source file from the project. If the file is used in several targets, it is removed from all targets. The file could be removed from the disk.

`obj` : | Self.
`file` : | A GFile that will be removed from the project
`err` : | Error propagation and reporting.
Returns : | `TRUE` if the file has been removed from the project else `FALSE`