## IAnjutaFileSavable

IAnjutaFileSavable — Implemented by plugins that can save files.

## Stability Level

Unstable, unless otherwise indicated

## Functions

GQuark | ianjuta_file_savable_error_quark ()
gboolean | ianjuta_file_savable_is_conflict ()
gboolean | ianjuta_file_savable_is_dirty ()
gboolean | ianjuta_file_savable_is_read_only ()
void | ianjuta_file_savable_save ()
void | ianjuta_file_savable_save_as ()
void | ianjuta_file_savable_set_dirty ()

## Signals

void | saved | Run Last
void | update-save-ui | Run Last

## Types and Values

#define | IANJUTA_FILE_SAVABLE_ERROR

## Object Hierarchy

        GInterface
        ╰── IAnjutaFileSavable

## Includes

    #include <libanjuta/interfaces/ianjuta-file-savable.h>

## Description

Plugins implementing IAnjutaFile inteface that can also save files should also implement this interface.

## Functions

### ianjuta_file_savable_error_quark ()

    GQuark
    ianjuta_file_savable_error_quark (void);

### ianjuta_file_savable_is_conflict ()

    gboolean
    ianjuta_file_savable_is_conflict (IAnjutaFileSavable *obj,
                                      GError **err);

Return is the file is in conflict. It means the file has been modified externally and the user needs to tell which version he wants to use.

#### Parameters

obj | Self |
err | Error propagation and reporting |

#### Returns

TRUE if conflict, FALSE otherwise.

### ianjuta_file_savable_is_dirty ()

    gboolean
    ianjuta_file_savable_is_dirty (IAnjutaFileSavable *obj,
                                   GError **err);

Returns the dirty status of the content.

#### Parameters

obj | Self |
err | Error propagation and reporting |

#### Returns

TRUE if dirty, FALSE otherwise.

### ianjuta_file_savable_is_read_only ()

    gboolean
    ianjuta_file_savable_is_read_only (IAnjutaFileSavable *obj,
                                       GError **err);

Return is the file is read-only

#### Parameters

obj | Self |
err | Error propagation and reporting |

#### Returns

TRUE if read-only, FALSE otherwise.

### ianjuta_file_savable_save ()

    void
    ianjuta_file_savable_save (IAnjutaFileSavable *obj,
                               GError **err);

Saves the content to the original file from which it was loaded. The signal saved is always emitted even if the save fails.

#### Parameters

obj | Self |
err | Error propagation and reporting |

### ianjuta_file_savable_save_as ()

    void
    ianjuta_file_savable_save_as (IAnjutaFileSavable *obj,
                                  GFile *file,
                                  GError **err);

Saves the content to a different File. The signal saved is always emitted even if the save fails.

#### Parameters

obj | Self |
file | File to save the content. |
err | Error propagation and reporting |

### ianjuta_file_savable_set_dirty ()

    void
    ianjuta_file_savable_set_dirty (IAnjutaFileSavable *obj,
                                    gboolean dirty,
                                    GError **err);

if `dirty` is TRUE, sets dirty for the content. Save point will be left and the content will be considered not saved. Otherwise, content will considered saved and save-point will be entered.

#### Parameters

obj | Self |
dirty | Whether the file was edited or not |
err | Error propagation and reporting |

## Types and Values

### IANJUTA_FILE_SAVABLE_ERROR

    #define IANJUTA_FILE_SAVABLE_ERROR ianjuta_file_savable_error_quark()

## Signal Details

### The `“saved”` signal

    void
    user_function (IAnjutaFileSavable *obj,
                   GFile              *file,
                   gpointer            user_data)

This signal is emitted when the content is saved.

#### Parameters

obj | Self |
file | file where the content is saved or NULL if save failed |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“update-save-ui”` signal

    void
    user_function (IAnjutaFileSavable *ianjutafilesavable,
                   gpointer            user_data)

Flags: Run Last

## See Also

IAnjutaFile