## InfTextMoveOperation InfTextMoveOperation |

## Synopsis

                        InfTextMoveOperation;
    InfTextMoveOperation * inf_text_move_operation_new      (guint position,
                                                             gint length);
    guint               inf_text_move_operation_get_position
                                                            (InfTextMoveOperation *operation);
    gint                inf_text_move_operation_get_length  (InfTextMoveOperation *operation);
    void                inf_text_move_operation_transform_insert
                                                            (guint insert_position,
                                                             guint insert_length,
                                                             guint *move_position,
                                                             gint *move_length,
                                                             gboolean left_gravity);
    void                inf_text_move_operation_transform_delete
                                                            (guint delete_position,
                                                             guint delete_length,
                                                             guint *move_position,
                                                             gint *move_length);

## Object Hierarchy

      GObject
       +----InfTextMoveOperation

## Implemented Interfaces

InfTextMoveOperation implements InfAdoptedOperation.

## Properties

      "length"                   gint                  : Read / Write / Construct Only
      "position"                 guint                 : Read / Write / Construct Only

## Description

## Details

### InfTextMoveOperation

    typedef struct _InfTextMoveOperation InfTextMoveOperation;

### inf_text_move_operation_new ()

    InfTextMoveOperation * inf_text_move_operation_new      (guint position,
                                                             gint length);

Creates a new move operation that, when applied, changes the caret and selection of the applying user.

`position` : | The position to place the user's caret at.
`length` : | The number of characters to select. Negative means selection towards the beginning of the buffer.
Returns : | A new InfTextMoveOperation.

### inf_text_move_operation_get_position ()

    guint               inf_text_move_operation_get_position
                                                            (InfTextMoveOperation *operation);

Returns the position at which `operation` places the user's cursor.

`operation` : | A InfTextMoveOperation.
Returns : | The position of `operation`.

### inf_text_move_operation_get_length ()

    gint                inf_text_move_operation_get_length  (InfTextMoveOperation *operation);

Returns the length to which `operation` changes the user's selection. Negative means selection towards the beginning of the buffer.

`operation` : | A InfTextMoveOperation.
Returns : | The length of `operation`.

### inf_text_move_operation_transform_insert ()

    void                inf_text_move_operation_transform_insert
                                                            (guint insert_position,
                                                             guint insert_length,
                                                             guint *move_position,
                                                             gint *move_length,
                                                             gboolean left_gravity);

Changes *`move_position` and *`move_length` so that they point to the same region when `insert_length` characters are inserted at `insert_position`.

If text is inserted at the same position as `move_position`, then `move_position` is kept at the position it currently is if `left_gravity` is `TRUE`, otherwise it is shifted to the right.

If *`move_length` is nonzero, then the selection length is never enlarged if text is inserted at the selection bounds, not depending on whether `left_gravity` is set or not.

`insert_position` : | The position at which text is inserted.
`insert_length` : | The number of inserted characters.
`move_position` : | Points to the character offset to which the caret is moved.
`move_length` : | Points to the number of characters selected. Negative means towards the beginning.
`left_gravity` : | Whether the move position and length have left gravity.

### inf_text_move_operation_transform_delete ()

    void                inf_text_move_operation_transform_delete
                                                            (guint delete_position,
                                                             guint delete_length,
                                                             guint *move_position,
                                                             gint *move_length);

Changes *`move_position` and *`move_length` so that they point to the same region when `delete_length` characters are deleted starting from `delete_position`.

`delete_position` : | The position at which text is deleted.
`delete_length` : | The number of deleted characters.
`move_position` : | Points to the character offset to which the caret is moved.
`move_length` : | Points to the number of characters selected. Negative means towards the beginning.

## Property Details

### The `"length"` property

      "length"                   gint                  : Read / Write / Construct Only

The number of characters of the selected text.

Default value: 0

### The `"position"` property

      "position"                 guint                 : Read / Write / Construct Only

Position where to place the user's caret at.

Default value: 0