IdeFileSettings: LibIDE Reference Manual

## IdeFileSettings IdeFileSettings |

## Functions

#define | IDE_TYPE_FILE_SETTINGS
IdeFileSettings * | ide_file_settings_new ()
IdeFile * | ide_file_settings_get_file ()
gboolean | ide_file_settings_get_settled ()
#define | IDE_FILE_SETTINGS_PROPERTY()

## Properties

gchar * | encoding | Read / Write
gboolean | encoding-set | Read / Write
IdeFile * | 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-trailing-newline | Read / Write
gboolean | insert-trailing-newline-set | Read / Write
GtkSourceNewlineType | newline-type | Read / Write
gboolean | newline-type-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
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_FILE_SETTINGS_EXTENSION_POINT
struct | IdeFileSettingsClass
| IdeFileSettings

## Object Hierarchy

        GObject
        ╰── IdeObject
            ╰── IdeFileSettings

## Description

## Functions

### IDE_TYPE_FILE_SETTINGS

    #define IDE_TYPE_FILE_SETTINGS            (ide_file_settings_get_type())

### ide_file_settings_new ()

    IdeFileSettings *
    ide_file_settings_new (IdeFile *file);

### ide_file_settings_get_file ()

    IdeFile *
    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]

### 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.

### IDE_FILE_SETTINGS_PROPERTY()

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

## Types and Values

### 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 `“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”                     IdeFile *

The IdeFile 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-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 `“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 `“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 `“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