## IAnjutaDocument

IAnjutaDocument — Interface for all kind of editable resources that will be managed by IAnjutaDocumentManager

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <libanjuta/interfaces/ianjuta-document.h>

    #define             IANJUTA_DOCUMENT_ERROR
                        IAnjutaDocument;
                        IAnjutaDocumentIface;
    GQuark              ianjuta_document_error_quark        (void);
    void                ianjuta_document_begin_undo_action  (IAnjutaDocument *obj,
                                                             GError **err);
    gboolean            ianjuta_document_can_redo           (IAnjutaDocument *obj,
                                                             GError **err);
    gboolean            ianjuta_document_can_undo           (IAnjutaDocument *obj,
                                                             GError **err);
    void                ianjuta_document_clear              (IAnjutaDocument *obj,
                                                             GError **err);
    void                ianjuta_document_copy               (IAnjutaDocument *obj,
                                                             GError **err);
    void                ianjuta_document_cut                (IAnjutaDocument *obj,
                                                             GError **err);
    void                ianjuta_document_end_undo_action    (IAnjutaDocument *obj,
                                                             GError **err);
    const gchar*        ianjuta_document_get_filename       (IAnjutaDocument *obj,
                                                             GError **err);
    void                ianjuta_document_grab_focus         (IAnjutaDocument *obj,
                                                             GError **err);
    void                ianjuta_document_paste              (IAnjutaDocument *obj,
                                                             GError **err);
    void                ianjuta_document_redo               (IAnjutaDocument *obj,
                                                             GError **err);
    void                ianjuta_document_undo               (IAnjutaDocument *obj,
                                                             GError **err);

## Object Hierarchy

      GInterface
       +----IAnjutaDocument

## Prerequisites

IAnjutaDocument requires GObject.

## Signals

      "update-ui"                                      : Run Last

## Description

## Details

### IANJUTA_DOCUMENT_ERROR

    #define IANJUTA_DOCUMENT_ERROR ianjuta_document_error_quark()

### IAnjutaDocument

    typedef struct _IAnjutaDocument IAnjutaDocument;

### IAnjutaDocumentIface

    typedef struct {
    	GTypeInterface g_iface;

    	/* Signal */
    	void (*update_ui) (IAnjutaDocument *obj);

    	void (*begin_undo_action) (IAnjutaDocument *obj, GError **err);
    	gboolean (*can_redo) (IAnjutaDocument *obj, GError **err);
    	gboolean (*can_undo) (IAnjutaDocument *obj, GError **err);
    	void (*clear) (IAnjutaDocument *obj, GError **err);
    	void (*copy) (IAnjutaDocument *obj, GError **err);
    	void (*cut) (IAnjutaDocument *obj, GError **err);
    	void (*end_undo_action) (IAnjutaDocument *obj, GError **err);
    	const gchar* (*get_filename) (IAnjutaDocument *obj, GError **err);
    	void (*grab_focus) (IAnjutaDocument *obj, GError **err);
    	void (*paste) (IAnjutaDocument *obj, GError **err);
    	void (*redo) (IAnjutaDocument *obj, GError **err);
    	void (*undo) (IAnjutaDocument *obj, GError **err);
    } IAnjutaDocumentIface;

### ianjuta_document_error_quark ()

    GQuark              ianjuta_document_error_quark        (void);

Returns : |

### ianjuta_document_begin_undo_action ()

    void                ianjuta_document_begin_undo_action  (IAnjutaDocument *obj,
                                                             GError **err);

Begins the mark of undoable action. Calls to this are stacked and each must be ended with `ianjuta_document_end_action()`.

`obj` : | Self
`err` : | Error propagation and reporting

### ianjuta_document_can_redo ()

    gboolean            ianjuta_document_can_redo           (IAnjutaDocument *obj,
                                                             GError **err);

Can the editor redo the last operation?

`obj` : | Self
`err` : | Error propagation and reporting
Returns : | TRUE if editor can redo, else FALSE

### ianjuta_document_can_undo ()

    gboolean            ianjuta_document_can_undo           (IAnjutaDocument *obj,
                                                             GError **err);

Can the editor undo the last operation?

`obj` : | Self
`err` : | Error propagation and reporting
Returns : | TRUE if editor can undo, else FALSE

### ianjuta_document_clear ()

    void                ianjuta_document_clear              (IAnjutaDocument *obj,
                                                             GError **err);

Clear selection

`obj` : | Self
`err` : | Error propagation and reporting

### ianjuta_document_copy ()

    void                ianjuta_document_copy               (IAnjutaDocument *obj,
                                                             GError **err);

Copy selection to clipboard.

`obj` : | Self
`err` : | Error propagation and reporting

### ianjuta_document_cut ()

    void                ianjuta_document_cut                (IAnjutaDocument *obj,
                                                             GError **err);

Cut selection to clipboard.

`obj` : | Self
`err` : | Error propagation and reporting

### ianjuta_document_end_undo_action ()

    void                ianjuta_document_end_undo_action    (IAnjutaDocument *obj,
                                                             GError **err);

Ends the mark of undoable action.

`obj` : | Self
`err` : | Error propagation and reporting

### ianjuta_document_get_filename ()

    const gchar*        ianjuta_document_get_filename       (IAnjutaDocument *obj,
                                                             GError **err);

Allows obtaining of the filename the editor was loaded from.

`obj` : | Self
`err` : | Error propagation and reporting
Returns : | The name of the file. Not to be freed by caller.

### ianjuta_document_grab_focus ()

    void                ianjuta_document_grab_focus         (IAnjutaDocument *obj,
                                                             GError **err);

Grabs the focus.

`obj` : | Self
`err` : | Error propagation and reporting

### ianjuta_document_paste ()

    void                ianjuta_document_paste              (IAnjutaDocument *obj,
                                                             GError **err);

Paste clipboard at current position.

`obj` : | Self
`err` : | Error propagation and reporting

### ianjuta_document_redo ()

    void                ianjuta_document_redo               (IAnjutaDocument *obj,
                                                             GError **err);

Redo last undo operation

`obj` : | Self
`err` : | Error propagation and reporting

### ianjuta_document_undo ()

    void                ianjuta_document_undo               (IAnjutaDocument *obj,
                                                             GError **err);

Undo last operation

`obj` : | Self
`err` : | Error propagation and reporting

## Signal Details

### The `"update-ui"` signal

    void                user_function                      (IAnjutaDocument *obj,
                                                            gpointer         user_data)      : Run Last

This signal is emitted when the document assumes the UI must be updated because some internal state of the document has changed. For example, if current line position is changed, it needs to be reflected to the UI.

`obj` : | Self
`user_data` : | user data set when the signal handler was connected.