## IAnjutaEditorSelection IAnjutaEditorSelection — Text editor selection interface |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <libanjuta/interfaces/ianjuta-editor-selection.h>

    #define             IANJUTA_EDITOR_SELECTION_ERROR
                        IAnjutaEditorSelection;
                        IAnjutaEditorSelectionIface;
    GQuark              ianjuta_editor_selection_error_quark
                                                            (void);
    void                ianjuta_editor_selection_clear      (IAnjutaEditorSelection *obj,
                                                             GError **err);
    void                ianjuta_editor_selection_copy       (IAnjutaEditorSelection *obj,
                                                             GError **err);
    void                ianjuta_editor_selection_cut        (IAnjutaEditorSelection *obj,
                                                             GError **err);
    gchar*              ianjuta_editor_selection_get        (IAnjutaEditorSelection *obj,
                                                             GError **err);
    gint                ianjuta_editor_selection_get_end    (IAnjutaEditorSelection *obj,
                                                             GError **err);
    gint                ianjuta_editor_selection_get_start  (IAnjutaEditorSelection *obj,
                                                             GError **err);
    void                ianjuta_editor_selection_paste      (IAnjutaEditorSelection *obj,
                                                             GError **err);
    void                ianjuta_editor_selection_replace    (IAnjutaEditorSelection *obj,
                                                             const gchar *text,
                                                             gint length,
                                                             GError **err);
    void                ianjuta_editor_selection_select_all (IAnjutaEditorSelection *obj,
                                                             GError **err);
    void                ianjuta_editor_selection_select_block
                                                            (IAnjutaEditorSelection *obj,
                                                             GError **err);
    void                ianjuta_editor_selection_select_function
                                                            (IAnjutaEditorSelection *obj,
                                                             GError **err);
    void                ianjuta_editor_selection_select_to_brace
                                                            (IAnjutaEditorSelection *obj,
                                                             GError **err);
    void                ianjuta_editor_selection_set        (IAnjutaEditorSelection *obj,
                                                             gint start,
                                                             gint end,
                                                             gboolean backward,
                                                             GError **err);

## Object Hierarchy

      GInterface
       +----IAnjutaEditorSelection

## Prerequisites

IAnjutaEditorSelection requires IAnjutaEditor and GObject.

## Description

## Details

### IANJUTA_EDITOR_SELECTION_ERROR

    #define IANJUTA_EDITOR_SELECTION_ERROR ianjuta_editor_selection_error_quark()

### IAnjutaEditorSelection

    typedef struct _IAnjutaEditorSelection IAnjutaEditorSelection;

### IAnjutaEditorSelectionIface

    typedef struct {
    	IAnjutaEditorIface g_iface;

    	void (*clear) (IAnjutaEditorSelection *obj, GError **err);
    	void (*copy) (IAnjutaEditorSelection *obj, GError **err);
    	void (*cut) (IAnjutaEditorSelection *obj, GError **err);
    	gchar* (*get) (IAnjutaEditorSelection *obj, GError **err);
    	gint (*get_end) (IAnjutaEditorSelection *obj, GError **err);
    	gint (*get_start) (IAnjutaEditorSelection *obj, GError **err);
    	void (*paste) (IAnjutaEditorSelection *obj, GError **err);
    	void (*replace) (IAnjutaEditorSelection *obj, const gchar *text,  gint length, GError **err);
    	void (*select_all) (IAnjutaEditorSelection *obj, GError **err);
    	void (*select_block) (IAnjutaEditorSelection *obj, GError **err);
    	void (*select_function) (IAnjutaEditorSelection *obj, GError **err);
    	void (*select_to_brace) (IAnjutaEditorSelection *obj, GError **err);
    	void (*set) (IAnjutaEditorSelection *obj, gint start,  gint end,  gboolean backward, GError **err);
    } IAnjutaEditorSelectionIface;

### ianjuta_editor_selection_error_quark ()

    GQuark              ianjuta_editor_selection_error_quark
                                                            (void);

Returns : |

### ianjuta_editor_selection_clear ()

    void                ianjuta_editor_selection_clear      (IAnjutaEditorSelection *obj,
                                                             GError **err);

Clear selection

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

### ianjuta_editor_selection_copy ()

    void                ianjuta_editor_selection_copy       (IAnjutaEditorSelection *obj,
                                                             GError **err);

Copy selection to clipboard.

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

### ianjuta_editor_selection_cut ()

    void                ianjuta_editor_selection_cut        (IAnjutaEditorSelection *obj,
                                                             GError **err);

Cut selection to clipboard.

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

### ianjuta_editor_selection_get ()

    gchar*              ianjuta_editor_selection_get        (IAnjutaEditorSelection *obj,
                                                             GError **err);

Gets curerntly selected text in editor.

`obj` : | Self
`err` : | Error propagation and reporting
Returns : | A newly allocated buffer of currently selected characters. NULL if there is no selection. The returned buffer must be freed after use.

### ianjuta_editor_selection_get_end ()

    gint                ianjuta_editor_selection_get_end    (IAnjutaEditorSelection *obj,
                                                             GError **err);

Get end position of selection.

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

### ianjuta_editor_selection_get_start ()

    gint                ianjuta_editor_selection_get_start  (IAnjutaEditorSelection *obj,
                                                             GError **err);

Gets start position of selection text. If there is no selection,

`obj` : | Self
`err` : | Error propagation and reporting
Returns : | the current carat position. Return: Start of selection

### ianjuta_editor_selection_paste ()

    void                ianjuta_editor_selection_paste      (IAnjutaEditorSelection *obj,
                                                             GError **err);

Paste clipboard at current position.

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

### ianjuta_editor_selection_replace ()

    void                ianjuta_editor_selection_replace    (IAnjutaEditorSelection *obj,
                                                             const gchar *text,
                                                             gint length,
                                                             GError **err);

Replaces currently selected text with the `text`. Only `length` amount of characters are used from `text` buffer to replace.

`obj` : | Self
`text` : | Replacement text.
`length` : | Length of the text to used in `text`.
`err` : | Error propagation and reporting

### ianjuta_editor_selection_select_all ()

    void                ianjuta_editor_selection_select_all (IAnjutaEditorSelection *obj,
                                                             GError **err);

`obj` : |
`err` : |

### ianjuta_editor_selection_select_block ()

    void                ianjuta_editor_selection_select_block
                                                            (IAnjutaEditorSelection *obj,
                                                             GError **err);

Selects current block of code. The definition of block of code depends on highlight mode used (programming language). Some highlight mode does not have block concept, in that case this method does not do anything.

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

### ianjuta_editor_selection_select_function ()

    void                ianjuta_editor_selection_select_function
                                                            (IAnjutaEditorSelection *obj,
                                                             GError **err);

Select current function block. The definition of function block depends on highlight mode used (programming language). Some highlight mode does not have function concept, in that case this method does not do anything.

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

### ianjuta_editor_selection_select_to_brace ()

    void                ianjuta_editor_selection_select_to_brace
                                                            (IAnjutaEditorSelection *obj,
                                                             GError **err);

Select to brace. Some highlight mode does not have braces concept, in that case, this method does not do anything.

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

### ianjuta_editor_selection_set ()

    void                ianjuta_editor_selection_set        (IAnjutaEditorSelection *obj,
                                                             gint start,
                                                             gint end,
                                                             gboolean backward,
                                                             GError **err);

Select characters between start and end

`obj` : | Self
`start` : | Begin of selection
`end` : | End of selection
`backward` : | Direction of search
`err` : | Error propagation and reporting