## ianjuta-editor

ianjuta-editor —

##

# Synopsis

    enum        IAnjutaEditorError;
    #define     IANJUTA_EDITOR_ERROR
    struct      IAnjutaEditor;
    struct      IAnjutaEditorIface;
    GQuark      ianjuta_editor_error_quark      (void);
    void        ianjuta_editor_append           (IAnjutaEditor *obj,
                                                 const gchar *text,
                                                 gint length,
                                                 GError **err);
    gboolean    ianjuta_editor_can_redo         (IAnjutaEditor *obj,
                                                 GError **err);
    gboolean    ianjuta_editor_can_undo         (IAnjutaEditor *obj,
                                                 GError **err);
    void        ianjuta_editor_erase_all        (IAnjutaEditor *obj,
                                                 GError **err);
    gchar*      ianjuta_editor_get_attributes   (IAnjutaEditor *obj,
                                                 gint start,
                                                 gint end,
                                                 GError **err);
    gint        ianjuta_editor_get_column       (IAnjutaEditor *obj,
                                                 GError **err);
    gchar*      ianjuta_editor_get_current_word (IAnjutaEditor *obj,
                                                 GError **err);
    const gchar* ianjuta_editor_get_filename    (IAnjutaEditor *obj,
                                                 GError **err);
    gint        ianjuta_editor_get_length       (IAnjutaEditor *obj,
                                                 GError **err);
    gint        ianjuta_editor_get_line_begin_position
                                                (IAnjutaEditor *obj,
                                                 gint line,
                                                 GError **err);
    gint        ianjuta_editor_get_line_end_position
                                                (IAnjutaEditor *obj,
                                                 gint line,
                                                 GError **err);
    int         ianjuta_editor_get_line_from_position
                                                (IAnjutaEditor *obj,
                                                 int position,
                                                 GError **err);
    gint        ianjuta_editor_get_lineno       (IAnjutaEditor *obj,
                                                 GError **err);
    gboolean    ianjuta_editor_get_overwrite    (IAnjutaEditor *obj,
                                                 GError **err);
    gint        ianjuta_editor_get_position     (IAnjutaEditor *obj,
                                                 GError **err);
    gchar*      ianjuta_editor_get_text         (IAnjutaEditor *obj,
                                                 gint start,
                                                 gint end,
                                                 GError **err);
    void        ianjuta_editor_goto_line        (IAnjutaEditor *obj,
                                                 gint lineno,
                                                 GError **err);
    void        ianjuta_editor_goto_position    (IAnjutaEditor *obj,
                                                 gint position,
                                                 GError **err);
    void        ianjuta_editor_insert           (IAnjutaEditor *obj,
                                                 int position,
                                                 const gchar *text,
                                                 gint length,
                                                 GError **err);
    void        ianjuta_editor_redo             (IAnjutaEditor *obj,
                                                 GError **err);
    void        ianjuta_editor_set_popup_menu   (IAnjutaEditor *obj,
                                                 GtkWidget *menu,
                                                 GError **err);
    void        ianjuta_editor_undo             (IAnjutaEditor *obj,
                                                 GError **err);

## Object Hierarchy

      GInterface
       +----IAnjutaEditor

## Prerequisites

IAnjutaEditor requires GObject.

## Known Derived Interfaces

IAnjutaEditor is required by IAnjutaEditorConvert, IAnjutaEditorView, IAnjutaEditorSelection, IAnjutaEditorAssist, IAnjutaEditorLineMode and IAnjutaEditorFolds.

## Description

## Details

### enum IAnjutaEditorError

    typedef enum {
    	IANJUTA_EDITOR_DOESNT_EXIST
    } IAnjutaEditorError;

### IANJUTA_EDITOR_ERROR

    #define IANJUTA_EDITOR_ERROR ianjuta_editor_error_quark()

### struct IAnjutaEditor

    struct IAnjutaEditor;

### struct IAnjutaEditorIface

    struct IAnjutaEditorIface {

    	GTypeInterface g_iface;

    	/* Signal */
    	void (*char_added) (IAnjutaEditor *obj, gint position, gchar ch);
    	/* Signal */
    	void (*update_ui) (IAnjutaEditor *obj);

    	void (*append) (IAnjutaEditor *obj, const gchar *text, gint length, GError **err);
    	gboolean (*can_redo) (IAnjutaEditor *obj, GError **err);
    	gboolean (*can_undo) (IAnjutaEditor *obj, GError **err);
    	void (*erase_all) (IAnjutaEditor *obj, GError **err);
    	gchar* (*get_attributes) (IAnjutaEditor *obj, gint start, gint end, GError **err);
    	gint (*get_column) (IAnjutaEditor *obj, GError **err);
    	gchar* (*get_current_word) (IAnjutaEditor *obj, GError **err);
    	const gchar* (*get_filename) (IAnjutaEditor *obj, GError **err);
    	gint (*get_length) (IAnjutaEditor *obj, GError **err);
    	gint (*get_line_begin_position) (IAnjutaEditor *obj, gint line, GError **err);
    	gint (*get_line_end_position) (IAnjutaEditor *obj, gint line, GError **err);
    	int (*get_line_from_position) (IAnjutaEditor *obj, int position, GError **err);
    	gint (*get_lineno) (IAnjutaEditor *obj, GError **err);
    	gboolean (*get_overwrite) (IAnjutaEditor *obj, GError **err);
    	gint (*get_position) (IAnjutaEditor *obj, GError **err);
    	gchar* (*get_text) (IAnjutaEditor *obj, gint start, gint end, GError **err);
    	void (*goto_line) (IAnjutaEditor *obj, gint lineno, GError **err);
    	void (*goto_position) (IAnjutaEditor *obj, gint position, GError **err);
    	void (*insert) (IAnjutaEditor *obj, int position, const gchar *text, gint length, GError **err);
    	void (*redo) (IAnjutaEditor *obj, GError **err);
    	void (*set_popup_menu) (IAnjutaEditor *obj, GtkWidget *menu, GError **err);
    	void (*undo) (IAnjutaEditor *obj, GError **err);

    };

### ianjuta_editor_error_quark ()

    GQuark      ianjuta_editor_error_quark      (void);

Returns : |

### ianjuta_editor_append ()

    void        ianjuta_editor_append           (IAnjutaEditor *obj,
                                                 const gchar *text,
                                                 gint length,
                                                 GError **err);

Appends `length` characters from `text` buffer at the end of editor buffer. If `length` is -1, the whole `text` is used.

`obj` : | Self
`text` : | Text to append.
`length` : | Length of `text` to use.
`err` : | Error propagation and reporting

### ianjuta_editor_can_redo ()

    gboolean    ianjuta_editor_can_redo         (IAnjutaEditor *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_editor_can_undo ()

    gboolean    ianjuta_editor_can_undo         (IAnjutaEditor *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_editor_erase_all ()

    void        ianjuta_editor_erase_all        (IAnjutaEditor *obj,
                                                 GError **err);

Empties the whole editor buffer. There will be zero characters.

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

### ianjuta_editor_get_attributes ()

    gchar*      ianjuta_editor_get_attributes   (IAnjutaEditor *obj,
                                                 gint start,
                                                 gint end,
                                                 GError **err);

Gets the character attributes for characters between begining position and end position (including themselves). Character attributes are really only meaningful in the editor context from which it was taken. Therefore, the returned data is mainly to be passed back to the editor.

Character attributes chould contain display information of the character, such as font, size, color, highlight information etc.

`obj` : | Self
`start` : | Begining position
`end` : | End position
`err` : | Error propagation and reporting
Returns : | A buffer of character attributes, indexed in sequence for characters starting at begining position and ending at end position. The returned buffer must be freed when no longer required.

### ianjuta_editor_get_column ()

    gint        ianjuta_editor_get_column       (IAnjutaEditor *obj,
                                                 GError **err);

`obj` : |
`err` : |
Returns : |

### ianjuta_editor_get_current_word ()

    gchar*      ianjuta_editor_get_current_word (IAnjutaEditor *obj,
                                                 GError **err);

Obtains the word on which carat is currently on.

`obj` : | Self
`err` : | Error propagation and reporting
Returns : | Current word.

### ianjuta_editor_get_filename ()

    const gchar* ianjuta_editor_get_filename    (IAnjutaEditor *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_editor_get_length ()

    gint        ianjuta_editor_get_length       (IAnjutaEditor *obj,
                                                 GError **err);

Get length of complete text in editor. This will be the total number of characters in the file or buffer.

`obj` : | Self
`err` : | Error propagation and reporting
Returns : | Text length.

### ianjuta_editor_get_line_begin_position ()

    gint        ianjuta_editor_get_line_begin_position
                                                (IAnjutaEditor *obj,
                                                 gint line,
                                                 GError **err);

fixme

`obj` : | Self
`line` : | fixme
`err` : | Error propagation and reporting.
Returns : | fixme

### ianjuta_editor_get_line_end_position ()

    gint        ianjuta_editor_get_line_end_position
                                                (IAnjutaEditor *obj,
                                                 gint line,
                                                 GError **err);

fixme

`obj` : | Self
`line` : | fixme
`err` : | Error propagation and reporting.
Returns : | fixme

### ianjuta_editor_get_line_from_position ()

    int         ianjuta_editor_get_line_from_position
                                                (IAnjutaEditor *obj,
                                                 int position,
                                                 GError **err);

`obj` : |
`position` : |
`err` : |
Returns : |

### ianjuta_editor_get_lineno ()

    gint        ianjuta_editor_get_lineno       (IAnjutaEditor *obj,
                                                 GError **err);

Obtains current line number on which carat is.

`obj` : | Self
`err` : | Error propagation and reporting
Returns : | Line number.

### ianjuta_editor_get_overwrite ()

    gboolean    ianjuta_editor_get_overwrite    (IAnjutaEditor *obj,
                                                 GError **err);

Obtains editor overwirte mode: TRUE = Override, FALSE = Insert.

`obj` : | Self
`err` : | Error propagation and reporting
Returns : | editor mode.

### ianjuta_editor_get_position ()

    gint        ianjuta_editor_get_position     (IAnjutaEditor *obj,
                                                 GError **err);

Get current caret position

`obj` : | Self
`err` : | Error propagation and reporting
Returns : | Current character position since the begining of file.

### ianjuta_editor_get_text ()

    gchar*      ianjuta_editor_get_text         (IAnjutaEditor *obj,
                                                 gint start,
                                                 gint end,
                                                 GError **err);

Gets the text characters between beginning position and end position (including themselves). The characters are utf-8 encoded.

`obj` : | Self
`start` : | Begining position
`end` : | End position
`err` : | Error propagation and reporting
Returns : | A buffer of utf-8 characters. The returned buffer must be freed when no longer required.

### ianjuta_editor_goto_line ()

    void        ianjuta_editor_goto_line        (IAnjutaEditor *obj,
                                                 gint lineno,
                                                 GError **err);

Carat is moved to the given `lineno` line and text view is scrolled to bring it in viewable area of the editor.

`obj` : | Self
`lineno` : | line number where carat will be moved.
`err` : | Error propagation and reporting

### ianjuta_editor_goto_position ()

    void        ianjuta_editor_goto_position    (IAnjutaEditor *obj,
                                                 gint position,
                                                 GError **err);

Carat is moved to the given `position` and text view is scrolled to bring `position` in viewable area of the editor.

`obj` : | Self
`position` : | Character position where carat will be moved.
`err` : | Error propagation and reporting

### ianjuta_editor_insert ()

    void        ianjuta_editor_insert           (IAnjutaEditor *obj,
                                                 int position,
                                                 const gchar *text,
                                                 gint length,
                                                 GError **err);

Inserts `length` characters from `text` buffer at given `position` of editor buffer. If `length` is -1, the whole `text` is used.

`obj` : | Self
`position` : | Character position in editor where insert will take place.
`text` : | Text to append.
`length` : | Length of `text` to use.
`err` : | Error propagation and reporting

### ianjuta_editor_redo ()

    void        ianjuta_editor_redo             (IAnjutaEditor *obj,
                                                 GError **err);

Redo last undo operation

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

### ianjuta_editor_set_popup_menu ()

    void        ianjuta_editor_set_popup_menu   (IAnjutaEditor *obj,
                                                 GtkWidget *menu,
                                                 GError **err);

Set Editor popup menu. This is the menu shown in the editor when one right-clicks on it.

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

### ianjuta_editor_undo ()

    void        ianjuta_editor_undo             (IAnjutaEditor *obj,
                                                 GError **err);

Undo last operation

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