| Anjuta Developers Reference Manual | ||||
|---|---|---|---|---|
#include <libanjuta/interfaces/ianjuta-file-savable.h> #define IANJUTA_FILE_SAVABLE_ERROR IAnjutaFileSavable; IAnjutaFileSavableIface; GQuark ianjuta_file_savable_error_quark (void); gboolean ianjuta_file_savable_is_dirty (IAnjutaFileSavable *obj, GError **err); gboolean ianjuta_file_savable_is_read_only (IAnjutaFileSavable *obj, GError **err); void ianjuta_file_savable_save (IAnjutaFileSavable *obj, GError **err); void ianjuta_file_savable_save_as (IAnjutaFileSavable *obj, GFile *file, GError **err); void ianjuta_file_savable_set_dirty (IAnjutaFileSavable *obj, gboolean dirty, GError **err);
Plugins implementing IAnjutaFile inteface that can also save files should also implement this interface.
typedef struct {
IAnjutaFileIface g_iface;
/* Signal */
void (*saved) (IAnjutaFileSavable *obj, GFile* file);
/* Signal */
void (*update_save_ui) (IAnjutaFileSavable *obj);
gboolean (*is_conflict) (IAnjutaFileSavable *obj, GError **err);
gboolean (*is_dirty) (IAnjutaFileSavable *obj, GError **err);
gboolean (*is_read_only) (IAnjutaFileSavable *obj, GError **err);
void (*save) (IAnjutaFileSavable *obj, GError **err);
void (*save_as) (IAnjutaFileSavable *obj, GFile* file, GError **err);
void (*set_dirty) (IAnjutaFileSavable *obj, gboolean dirty, GError **err);
} IAnjutaFileSavableIface;
gboolean ianjuta_file_savable_is_dirty (IAnjutaFileSavable *obj, GError **err);
Returns the dirty status of the content.
|
Self |
|
Error propagation and reporting |
Returns : |
TRUE if dirty, FALSE otherwise. |
gboolean ianjuta_file_savable_is_read_only (IAnjutaFileSavable *obj, GError **err);
Return is the file is read-only
|
Self |
|
Error propagation and reporting |
Returns : |
TRUE if read-only, FALSE otherwise. |
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.
|
Self |
|
Error propagation and reporting |
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.
|
Self |
|
File to save the content. |
|
Error propagation and reporting |
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.
|
Self |
|
|
|
Error propagation and reporting |
"saved" signalvoid user_function (IAnjutaFileSavable *obj, GObject *file, gpointer user_data) : Run Last
This signal is emitted when the content is saved.
|
Self |
|
file where the content is saved or NULL if save failed |
|
user data set when the signal handler was connected. |
"update-save-ui" signalvoid user_function (IAnjutaFileSavable *ianjutafilesavable, gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |