ide-project: LibIDE Reference Manual

## ide-project ide-project |

## Functions

#define | IDE_TYPE_PROJECT
IdeProjectItem * | ide_project_get_root ()
const gchar * | ide_project_get_name ()
const gchar * | ide_project_get_id ()
IdeFile * | ide_project_get_file_for_path ()
IdeFile * | ide_project_get_project_file ()
void | ide_project_reader_lock ()
void | ide_project_reader_unlock ()
void | ide_project_writer_lock ()
void | ide_project_writer_unlock ()
void | ide_project_add_file ()
IdeProjectFiles * | ide_project_get_files ()
void | ide_project_rename_file_async ()
gboolean | ide_project_rename_file_finish ()
void | ide_project_trash_file_async ()
gboolean | ide_project_trash_file_finish ()

## Properties

gchar * | id | Read
gchar * | name | Read
IdeProjectItem * | root | Read / Write / Construct Only

## Types and Values

| IdeProject

## Object Hierarchy

        GObject
        ╰── IdeObject
            ╰── IdeProject

## Description

## Functions

### IDE_TYPE_PROJECT

    #define IDE_TYPE_PROJECT (ide_project_get_type())

### ide_project_get_root ()

    IdeProjectItem *
    ide_project_get_root (IdeProject *self);

Retrieves the root item of the project tree.

You must be holding the reader lock while calling and using the result of this function. Other thread may be accessing or modifying the tree without your knowledge. See `ide_project_reader_lock()` and `ide_project_reader_unlock()` for more information.

If you need to modify the tree, you must hold a writer lock that has been acquired with `ide_project_writer_lock()` and released with `ide_project_writer_unlock()` when you are no longer modifiying the tree.

#### Returns

An IdeProjectItem.

[transfer none]

### ide_project_get_name ()

    const gchar *
    ide_project_get_name (IdeProject *self);

### ide_project_get_id ()

    const gchar *
    ide_project_get_id (IdeProject *self);

### ide_project_get_file_for_path ()

    IdeFile *
    ide_project_get_file_for_path (IdeProject *self,
                                   const gchar *path);

Retrieves an IdeFile for the path specified. IdeFile provides access to language specific features via `ide_file_get_language()`.

You must hold the reader lock while calling this function. See `ide_project_reader_lock()` and `ide_project_reader_unlock()` for more information.

#### Parameters

path | A relative path from the project root. |

#### Returns

An IdeFile or `NULL` if no matching file could be found.

[transfer full][nullable]

### ide_project_get_project_file ()

    IdeFile *
    ide_project_get_project_file (IdeProject *self,
                                  GFile *gfile);

Gets a new IdeFile representing `gfile` .

#### Parameters

self | A IdeProject. |
gfile | A GFile. |

#### Returns

An IdeFile.

[transfer full]

### ide_project_reader_lock ()

    void
    ide_project_reader_lock (IdeProject *self);

### ide_project_reader_unlock ()

    void
    ide_project_reader_unlock (IdeProject *self);

### ide_project_writer_lock ()

    void
    ide_project_writer_lock (IdeProject *self);

### ide_project_writer_unlock ()

    void
    ide_project_writer_unlock (IdeProject *self);

### ide_project_add_file ()

    void
    ide_project_add_file (IdeProject *self,
                          IdeProjectFile *file);

### ide_project_get_files ()

    IdeProjectFiles *
    ide_project_get_files (IdeProject *self);

Gets the IdeProjectFiles instance within the project tree. If it has not yet been loaded, `NULL` is returned.

#### Parameters

self | A IdeProject. |

#### Returns

An IdeProjectFiles or `NULL`.

[transfer none][nullable]

### ide_project_rename_file_async ()

    void
    ide_project_rename_file_async (IdeProject *self,
                                   GFile *orig_file,
                                   GFile *new_file,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

### ide_project_rename_file_finish ()

    gboolean
    ide_project_rename_file_finish (IdeProject *self,
                                    GAsyncResult *result,
                                    GError **error);

### ide_project_trash_file_async ()

    void
    ide_project_trash_file_async (IdeProject *self,
                                  GFile *file,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

### ide_project_trash_file_finish ()

    gboolean
    ide_project_trash_file_finish (IdeProject *self,
                                   GAsyncResult *result,
                                   GError **error);

## Types and Values

### IdeProject

    typedef struct _IdeProject IdeProject;

## Property Details

### The `“id”` property

      “id”                       gchar *

The unique project identifier.

Flags: Read

Default value: NULL

### The `“name”` property

      “name”                     gchar *

The name of the project.

Flags: Read

Default value: NULL

### The `“root”` property

      “root”                     IdeProjectItem *

The root object for the project.

Flags: Read / Write / Construct Only