IdeIndenter: gnome-builder Reference Manual

## IdeIndenter IdeIndenter |

## Functions

#define | IDE_TYPE_INDENTER
gboolean | ide_indenter_is_trigger ()
gchar * | ide_indenter_format ()

## Properties

IdeContext * | context | Write / Construct Only

## Types and Values

struct | IdeIndenterInterface
| IdeIndenter

## Object Hierarchy

        GInterface
        ╰── IdeIndenter

## Prerequisites

IdeIndenter requires GObject.

## Description

## Functions

### IDE_TYPE_INDENTER

    #define IDE_TYPE_INDENTER (ide_indenter_get_type())

### ide_indenter_is_trigger ()

    gboolean
    ide_indenter_is_trigger (IdeIndenter *self,
                             GdkEventKey *event);

Determines if `event` should trigger an indentation request. If `TRUE` is returned then `ide_indenter_format()` will be called.

#### Parameters

self | an IdeIndenter |
event | a GdkEventKey |

#### Returns

`TRUE` if `event` should trigger an indentation request.

### ide_indenter_format ()

    gchar *
    ide_indenter_format (IdeIndenter *self,
                         GtkTextView *text_view,
                         GtkTextIter *begin,
                         GtkTextIter *end,
                         gint *cursor_offset,
                         GdkEventKey *event);

This function performs an indentation for the key press activated by `event` . The implementation is free to move the `begin` and `end` iters to swallow adjacent content. The result, a string, is the contents that will replace the content inbetween `begin` and `end` .

`cursor_offset` may be set to jump the cursor starting from `end` . Negative values are allowed.

#### Parameters

text_view | A GtkTextView |
begin | A GtkTextIter for the beginning region of text to replace. |
end | A GtkTextIter for the end region of text to replace. |
cursor_offset | The offset in characters from `end` to place the cursor. Negative values are okay. | [out]
event | The GdkEventKey that triggered the event. |

#### Returns

A string containing the replacement text, or `NULL`.

[nullable][transfer full]

## Types and Values

### struct IdeIndenterInterface

    struct IdeIndenterInterface {
      GTypeInterface parent;

      gchar    *(*format)      (IdeIndenter   *self,
                                GtkTextView   *text_view,
                                GtkTextIter   *begin,
                                GtkTextIter   *end,
                                gint          *cursor_offset,
                                GdkEventKey   *event);
      gboolean  (*is_trigger)  (IdeIndenter   *self,
                                GdkEventKey   *event);
      void      (*set_context) (IdeIndenter   *self,
                                IdeContext    *context);
    };

### IdeIndenter

    typedef struct _IdeIndenter IdeIndenter;

## Property Details

### The `“context”` property

      “context”                  IdeContext *

Context.

Flags: Write / Construct Only