IdeFileSettings: Builder SDK Reference

## IdeFileSettings IdeFileSettings |

## Functions

IdeFileSettings * | ide_file_settings_new ()
GFile * | ide_file_settings_get_file ()
const gchar * | ide_file_settings_get_language ()
gboolean | ide_file_settings_get_settled ()
#define | IDE_FILE_SETTINGS_PROPERTY()

## Properties

gboolean | auto-indent | Read / Write
gboolean | auto-indent-set | Read / Write
gchar * | encoding | Read / Write
gboolean | encoding-set | Read / Write
GFile * | file | Read / Write / Construct Only
IdeIndentStyle | indent-style | Read / Write
gboolean | indent-style-set | Read / Write
gint | indent-width | Read / Write
gboolean | indent-width-set | Read / Write
gboolean | insert-matching-brace | Read / Write
gboolean | insert-matching-brace-set | Read / Write
gboolean | insert-trailing-newline | Read / Write
gboolean | insert-trailing-newline-set | Read / Write
gchar * | language | Read / Write / Construct Only
GtkSourceNewlineType | newline-type | Read / Write
gboolean | newline-type-set | Read / Write
gboolean | overwrite-braces | Read / Write
gboolean | overwrite-braces-set | Read / Write
guint | right-margin-position | Read / Write
gboolean | right-margin-position-set | Read / Write
gboolean | settled | Read / Write
gboolean | show-right-margin | Read / Write
gboolean | show-right-margin-set | Read / Write
IdeSpacesStyle | spaces-style | Read / Write
gboolean | spaces-style-set | Read / Write
guint | tab-width | Read / Write
gboolean | tab-width-set | Read / Write
gboolean | trim-trailing-whitespace | Read / Write
gboolean | trim-trailing-whitespace-set | Read / Write

## Types and Values

#define | IDE_TYPE_FILE_SETTINGS
#define | IDE_FILE_SETTINGS_EXTENSION_POINT
struct | IdeFileSettingsClass
| IdeFileSettings

## Object Hierarchy

        GObject
        ╰── IdeObject
            ╰── IdeFileSettings

## Description

## Functions

### ide_file_settings_new ()

    IdeFileSettings *
    ide_file_settings_new (IdeObject *parent,
                           GFile *file,
                           const gchar *language);

### ide_file_settings_get_file ()

    GFile *
    ide_file_settings_get_file (IdeFileSettings *self);

Retrieves the underlying file that `self` refers to.

This may be used by IdeFileSettings implementations to discover additional information about the settings. For example, a modeline parser might load some portion of the file looking for modelines. An editorconfig implementation might look for ".editorconfig" files.

#### Parameters

self | An IdeFileSettings. |

#### Returns

An IdeFile.

[transfer none]

Since: 3.32

### ide_file_settings_get_language ()

    const gchar *
    ide_file_settings_get_language (IdeFileSettings *self);

If the language for file settings is known up-front, this will indicate the language identifier known to GtkSourceView such as "c" or "sh".

#### Parameters

self | a IdeFileSettings |

#### Returns

a string containing the language id or `NULL`.

[nullable]

Since: 3.32

### ide_file_settings_get_settled ()

    gboolean
    ide_file_settings_get_settled (IdeFileSettings *self);

Gets the “settled” property.

This property is `TRUE` when all of the children file settings have completed loading.

Some file setting implementations require that various I/O be performed on disk in the background. This property will change to `TRUE` when all of the settings have been loaded.

Normally, this is not a problem, since the editor will respond to changes and update them accordingly. However, if you are writing a tool that prints the file settings (such as ide-list-file-settings), you probably want to wait until the values have settled.

#### Parameters

self | An IdeFileSettings. |

#### Returns

`TRUE` if all the settings have loaded.

Since: 3.32

### IDE_FILE_SETTINGS_PROPERTY()

    #define             IDE_FILE_SETTINGS_PROPERTY(_1, name, _2, ret_type, _3, _4, _5, _6)

## Types and Values

### IDE_TYPE_FILE_SETTINGS

    #define IDE_TYPE_FILE_SETTINGS            (ide_file_settings_get_type())

### IDE_FILE_SETTINGS_EXTENSION_POINT

    #define IDE_FILE_SETTINGS_EXTENSION_POINT "org.gnome.libide.extensions.file-settings"

### struct IdeFileSettingsClass

    struct IdeFileSettingsClass {
      IdeObjectClass parent;
    };

### IdeFileSettings

    typedef struct _IdeFileSettings IdeFileSettings;

## Property Details

### The `“auto-indent”` property

      “auto-indent”              gboolean

If the the auto-indenter should be enabled.

Flags: Read / Write

Default value: FALSE

### The `“auto-indent-set”` property

      “auto-indent-set”          gboolean

If IdeFileSettings:auto-indent is set.

Flags: Read / Write

Default value: FALSE

### The `“encoding”` property

      “encoding”                 gchar *

The character encoding.

Flags: Read / Write

Default value: NULL

### The `“encoding-set”` property

      “encoding-set”             gboolean

If IdeFileSettings:encoding is set.

Flags: Read / Write

Default value: FALSE

### The `“file”` property

      “file”                     GFile *

The GFile the settings represent.

Flags: Read / Write / Construct Only

### The `“indent-style”` property

      “indent-style”             IdeIndentStyle

The indentation style.

Flags: Read / Write

Default value: IDE_INDENT_STYLE_TABS

### The `“indent-style-set”` property

      “indent-style-set”         gboolean

If IdeFileSettings:indent-style is set.

Flags: Read / Write

Default value: FALSE

### The `“indent-width”` property

      “indent-width”             gint

The indentation width, or -1 to use tab-width.

Flags: Read / Write

Allowed values: [-1,32]

Default value: -1

### The `“indent-width-set”` property

      “indent-width-set”         gboolean

If IdeFileSettings:indent-width is set.

Flags: Read / Write

Default value: FALSE

### The `“insert-matching-brace”` property

      “insert-matching-brace”    gboolean

Insert Matching Brace.

Flags: Read / Write

Default value: FALSE

### The `“insert-matching-brace-set”` property

      “insert-matching-brace-set” gboolean

If IdeFileSettings:insert-matching-brace is set.

Flags: Read / Write

Default value: FALSE

### The `“insert-trailing-newline”` property

      “insert-trailing-newline”  gboolean

If a trailing newline should be added when saving.

Flags: Read / Write

Default value: FALSE

### The `“insert-trailing-newline-set”` property

      “insert-trailing-newline-set” gboolean

If IdeFileSettings:insert-trailing-newline is set.

Flags: Read / Write

Default value: FALSE

### The `“language”` property

      “language”                 gchar *

The language the settings represent.

Flags: Read / Write / Construct Only

Default value: NULL

### The `“newline-type”` property

      “newline-type”             GtkSourceNewlineType

The type of newline to use at the end of each line.

Flags: Read / Write

Default value: GTK_SOURCE_NEWLINE_TYPE_LF

### The `“newline-type-set”` property

      “newline-type-set”         gboolean

If IdeFileSettings:newline-type is set.

Flags: Read / Write

Default value: FALSE

### The `“overwrite-braces”` property

      “overwrite-braces”         gboolean

Type over existing braces.

Flags: Read / Write

Default value: FALSE

### The `“overwrite-braces-set”` property

      “overwrite-braces-set”     gboolean

If IdeFileSettings:overwrite-braces is set.

Flags: Read / Write

Default value: FALSE

### The `“right-margin-position”` property

      “right-margin-position”    guint

The position to draw the right margin, in characters.

Flags: Read / Write

Allowed values: [1,1000]

Default value: 80

### The `“right-margin-position-set”` property

      “right-margin-position-set” gboolean

If IdeFileSettings:right-margin-position is set.

Flags: Read / Write

Default value: FALSE

### The `“settled”` property

      “settled”                  gboolean

If the file settings implementations have settled.

Flags: Read / Write

Default value: FALSE

### The `“show-right-margin”` property

      “show-right-margin”        gboolean

If the right margin line should be shown in the editor.

Flags: Read / Write

Default value: FALSE

### The `“show-right-margin-set”` property

      “show-right-margin-set”    gboolean

If IdeFileSettings:show-right-margin is set.

Flags: Read / Write

Default value: FALSE

### The `“spaces-style”` property

      “spaces-style”             IdeSpacesStyle

How to add spaces when reformatting certain text. Mostly used by completions.

Flags: Read / Write

### The `“spaces-style-set”` property

      “spaces-style-set”         gboolean

If IdeFileSettings:spaces-style is set.

Flags: Read / Write

Default value: FALSE

### The `“tab-width”` property

      “tab-width”                guint

The width of a tab in characters.

Flags: Read / Write

Allowed values: [1,32]

Default value: 8

### The `“tab-width-set”` property

      “tab-width-set”            gboolean

If IdeFileSettings:tab-width is set.

Flags: Read / Write

Default value: FALSE

### The `“trim-trailing-whitespace”` property

      “trim-trailing-whitespace” gboolean

If trailing whitespace should be trimmed from lines.

Flags: Read / Write

Default value: FALSE

### The `“trim-trailing-whitespace-set”` property

      “trim-trailing-whitespace-set” gboolean

If IdeFileSettings:trim-trailing-whitespace is set.

Flags: Read / Write

Default value: FALSE