IdeSourceSnippet

IdeSourceSnippet — A snippet to be inserted into a file

Functions

Properties

GtkTextBuffer * buffer Read
gchar * description Read / Write
gchar * language Read / Write
GtkTextMark * mark-begin Read
GtkTextMark * mark-end Read
gint tab-stop Read
gchar * trigger Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── IdeSourceSnippet

Description

The IdeSourceSnippet represents a single snippet that may be inserted into the IdeSourceView.

Functions

ide_source_snippet_new ()

IdeSourceSnippet *
ide_source_snippet_new (const gchar *trigger,
                        const gchar *language);

Creates a new IdeSourceSnippet

Parameters

trigger

the trigger word.

[nullable]

language

the source language.

[nullable]

Returns

A new IdeSourceSnippet.

[transfer full]


ide_source_snippet_copy ()

IdeSourceSnippet *
ide_source_snippet_copy (IdeSourceSnippet *self);

Does a deep copy of the snippet.

Parameters

self

an IdeSourceSnippet

 

Returns

An IdeSourceSnippet.

[transfer full]


ide_source_snippet_get_trigger ()

const gchar *
ide_source_snippet_get_trigger (IdeSourceSnippet *self);

Gets the trigger for the source snippet

Parameters

self

a IdeSourceSnippet

 

Returns

A trigger if specified.

[nullable]


ide_source_snippet_set_trigger ()

void
ide_source_snippet_set_trigger (IdeSourceSnippet *self,
                                const gchar *trigger);

Sets the trigger for the snippet.

Parameters

self

a IdeSourceSnippet

 

trigger

the trigger word

 

ide_source_snippet_get_language ()

const gchar *
ide_source_snippet_get_language (IdeSourceSnippet *self);

Gets the language used for the source snippet.

The language identifier matches the “id” property.

Parameters

self

a IdeSourceSnippet

 

Returns

the language identifier


ide_source_snippet_set_language ()

void
ide_source_snippet_set_language (IdeSourceSnippet *self,
                                 const gchar *language);

Sets the language identifier for the snippet.

This should match the “id” identifier.

Parameters

self

a IdeSourceSnippet

 

ide_source_snippet_get_description ()

const gchar *
ide_source_snippet_get_description (IdeSourceSnippet *self);

Gets the description for the snippet.

Parameters

self

a IdeSourceSnippet

 

ide_source_snippet_set_description ()

void
ide_source_snippet_set_description (IdeSourceSnippet *self,
                                    const gchar *description);

Sets the description for the snippet.

Parameters

self

a IdeSourceSnippet

 

description

the snippet description

 

ide_source_snippet_add_chunk ()

void
ide_source_snippet_add_chunk (IdeSourceSnippet *self,
                              IdeSourceSnippetChunk *chunk);

ide_source_snippet_get_n_chunks ()

guint
ide_source_snippet_get_n_chunks (IdeSourceSnippet *self);

Gets the number of chunks in the snippet. Not all chunks are editable.

Parameters

self

a IdeSourceSnippet

 

Returns

The number of chunks.


ide_source_snippet_get_tab_stop ()

gint
ide_source_snippet_get_tab_stop (IdeSourceSnippet *self);

Gets the current tab stop for the snippet. This is changed as the user Tab's through the edit points.

Parameters

self

a IdeSourceSnippet

 

Returns

The tab stop, or -1 if unset.


ide_source_snippet_get_nth_chunk ()

IdeSourceSnippetChunk *
ide_source_snippet_get_nth_chunk (IdeSourceSnippet *self,
                                  guint n);

Gets the chunk at n .

Parameters

self

an IdeSourceSnippet

 

n

the nth chunk to get

 

Returns

an IdeSourceSnippetChunk.

[transfer none]


ide_source_snippet_get_chunk_range ()

void
ide_source_snippet_get_chunk_range (IdeSourceSnippet *self,
                                    IdeSourceSnippetChunk *chunk,
                                    GtkTextIter *begin,
                                    GtkTextIter *end);

ide_source_snippet_get_context ()

IdeSourceSnippetContext *
ide_source_snippet_get_context (IdeSourceSnippet *self);

Get's the context used for expanding the snippet.

Parameters

self

an IdeSourceSnippet

 

Returns

an IdeSourceSnippetContext.

[nullable][transfer none]

Types and Values

IDE_TYPE_SOURCE_SNIPPET

#define IDE_TYPE_SOURCE_SNIPPET (ide_source_snippet_get_type())

IdeSourceSnippet

typedef struct _IdeSourceSnippet IdeSourceSnippet;

Property Details

The “buffer” property

  “buffer”                   GtkTextBuffer *

The GtkTextBuffer for the snippet.

Flags: Read


The “description” property

  “description”              gchar *

The description for the snippet.

Flags: Read / Write

Default value: NULL


The “language” property

  “language”                 gchar *

The language for the snippet.

Flags: Read / Write

Default value: NULL


The “mark-begin” property

  “mark-begin”               GtkTextMark *

The beginning text mark.

Flags: Read


The “mark-end” property

  “mark-end”                 GtkTextMark *

The ending text mark.

Flags: Read


The “tab-stop” property

  “tab-stop”                 gint

The current tab stop.

Flags: Read

Allowed values: >= -1

Default value: -1


The “trigger” property

  “trigger”                  gchar *

The trigger for the snippet.

Flags: Read / Write

Default value: NULL