## TeplFoldRegion TeplFoldRegion — Foldable region in a GtkTextBuffer |

## Functions

TeplFoldRegion * | tepl_fold_region_new ()
GtkTextBuffer * | tepl_fold_region_get_buffer ()
gboolean | tepl_fold_region_get_folded ()
void | tepl_fold_region_set_folded ()
gboolean | tepl_fold_region_get_bounds ()
void | tepl_fold_region_set_bounds ()

## Properties

GtkTextBuffer * | buffer | Read / Write / Construct Only
gboolean | folded | Read / Write

## Types and Values

| TeplFoldRegion

## Object Hierarchy

        GObject
        ╰── TeplFoldRegion

## Includes

    #include <tepl/tepl.h>

## Description

TeplFoldRegion represents a region in a GtkTextBuffer that can be folded.

When a region is being folded, a GtkTextTag with the “invisible” property is applied to the folded region. The actual start and end position of this GtkTextTag is respectively at the next new line after the start and end position of the bounds handed over to `tepl_fold_region_set_bounds()`.

## Functions

### tepl_fold_region_new ()

    TeplFoldRegion *
    tepl_fold_region_new (GtkTextBuffer *buffer,
                          const GtkTextIter *start,
                          const GtkTextIter *end);

#### Parameters

buffer | a GtkTextBuffer. |
start | a GtkTextIter. |
end | a GtkTextIter. |

#### Returns

a new TeplFoldRegion.

Since: 1.0

### tepl_fold_region_get_buffer ()

    GtkTextBuffer *
    tepl_fold_region_get_buffer (TeplFoldRegion *fold_region);

#### Parameters

fold_region | a TeplFoldRegion. |

#### Returns

the GtkTextBuffer where the fold region is applied.

[transfer none][nullable]

Since: 1.0

### tepl_fold_region_get_folded ()

    gboolean
    tepl_fold_region_get_folded (TeplFoldRegion *fold_region);

#### Parameters

fold_region | a TeplFoldRegion. |

#### Returns

whether the TeplFoldRegion is folded.

Since: 1.0

### tepl_fold_region_set_folded ()

    void
    tepl_fold_region_set_folded (TeplFoldRegion *fold_region,
                                 gboolean folded);

Folds or unfolds the region.

#### Parameters

fold_region | a TeplFoldRegion. |
folded | the new value. |

Since: 1.0

### tepl_fold_region_get_bounds ()

    gboolean
    tepl_fold_region_get_bounds (TeplFoldRegion *fold_region,
                                 GtkTextIter *start,
                                 GtkTextIter *end);

Obtains iterators pointing to the start and end of the TeplFoldRegion.

#### Parameters

fold_region | a TeplFoldRegion. |
start | iterator to initialize. | [out]
end | iterator to initialize. | [out]

#### Returns

`TRUE` on success, `FALSE` otherwise.

Since: 1.0

### tepl_fold_region_set_bounds ()

    void
    tepl_fold_region_set_bounds (TeplFoldRegion *fold_region,
                                 const GtkTextIter *start,
                                 const GtkTextIter *end);

Sets the start and end of the TeplFoldRegion.

#### Parameters

fold_region | a TeplFoldRegion. |
start | a GtkTextIter. |
end | a GtkTextIter. |

Since: 1.0

## Types and Values

### TeplFoldRegion

    typedef struct _TeplFoldRegion TeplFoldRegion;

## Property Details

### The `“buffer”` property

      “buffer”                   GtkTextBuffer *

The GtkTextBuffer where the fold region is applied. The TeplFoldRegion object has a weak reference to the buffer.

Owner: TeplFoldRegion

Flags: Read / Write / Construct Only

Since: 1.0

### The `“folded”` property

      “folded”                   gboolean

Whether the TeplFoldRegion is folded or not.

Owner: TeplFoldRegion

Flags: Read / Write

Default value: FALSE

Since: 1.0