## Font Selection Font Selection — Fontconfig font selection configuration |

## Functions

FontManagerSelections * | font_manager_selections_new ()
gboolean | font_manager_selections_load ()
gboolean | font_manager_selections_save ()
gchar * | font_manager_selections_get_filepath ()

## Properties

gchar * | config-dir | Read / Write
gchar * | target-element | Read / Write
gchar * | target-file | Read / Write

## Signals

void | changed | Run Last

## Types and Values

#define | FONT_MANAGER_TYPE_SELECTIONS
struct | FontManagerSelectionsClass
| FontManagerSelections

## Object Hierarchy

        GObject
        ╰── FontManagerStringSet
            ╰── FontManagerSelections
                ├── FontManagerDirectories
                ╰── FontManagerReject

## Includes

    #include <font-manager-selections.h>

## Description

Base class for generating fontconfig configuration files which modify font selections.

## Functions

### font_manager_selections_new ()

    FontManagerSelections *
    font_manager_selections_new (void);

#### Returns

A newly created FontManagerSelections. Free the returned object using ``g_object_unref()``.

[transfer full]

### font_manager_selections_load ()

    gboolean
    font_manager_selections_load (FontManagerSelections *self);

Load `target_file` from `config_dir`

#### Parameters

self | FontManagerSelections |

#### Returns

`TRUE` if configuration was loaded successfully.

### font_manager_selections_save ()

    gboolean
    font_manager_selections_save (FontManagerSelections *self);

Saves current selections to `target_file` in `config_dir`

#### Parameters

self | FontManagerSelections |

#### Returns

`TRUE` if configuration was saved successfully.

### font_manager_selections_get_filepath ()

    gchar *
    font_manager_selections_get_filepath (FontManagerSelections *self);

#### Parameters

self | FontManagerSelections |

#### Returns

A newly allocated string containing the full filepath to current configuration file or `NULL`. Free the result using ``g_free()``.

[transfer full][nullable]

## Types and Values

### FONT_MANAGER_TYPE_SELECTIONS

    #define FONT_MANAGER_TYPE_SELECTIONS (font_manager_selections_get_type())

### struct FontManagerSelectionsClass

    struct FontManagerSelectionsClass {
        GObjectClass parent_class;

        void (* changed) (FontManagerSelections *self);

        gboolean (* load) (FontManagerSelections *self);
        gboolean (* save) (FontManagerSelections *self);
        void (* parse_selections) (FontManagerSelections *self, xmlNode *selections);
        void (* write_selections) (FontManagerSelections *self, FontManagerXmlWriter *writer);
        xmlNodePtr (* get_selections) (FontManagerSelections *self, xmlDocPtr doc);
    };

#### Members

`changed` () | emitted whenever the configuration has changed on disk |
`load` () | load configuration from file |
`save` () | save configuration to file |
`parse_selections` () | parse fontconfig selections |
`write_selections` () | write fontconfig selections |
`get_selections` () | returns an xmlNodePtr to the selectfont element |

### FontManagerSelections

    typedef struct _FontManagerSelections FontManagerSelections;

## Property Details

### The `“config-dir”` property

      “config-dir”               gchar *

Should be set to one of the directories monitored by Fontconfig for configuration files and writeable by the user.

Owner: FontManagerSelections

Flags: Read / Write

Default value: NULL

### The `“target-element”` property

      “target-element”           gchar *

Valid values: acceptfont or rejectfont

Owner: FontManagerSelections

Flags: Read / Write

Default value: NULL

### The `“target-file”` property

      “target-file”              gchar *

Should be set to a filename in the form [7][0-9]-*.conf

Owner: FontManagerSelections

Flags: Read / Write

Default value: NULL

## Signal Details

### The `“changed”` signal

    void
    user_function (FontManagerSelections *fontmanagerselections,
                   gpointer               user_data)

Flags: Run Last