MaliitSettingsEntry

MaliitSettingsEntry — settings entry

Stability Level

Stable, unless otherwise indicated

Functions

Properties

GHashTable * attributes Read / Write / Construct Only
gchar * description Read / Write / Construct Only
MaliitAttributeExtension * extension Write / Construct Only
gchar * extension-key Read / Write / Construct Only
MaliitSettingsEntryType type Read / Write / Construct Only
gboolean valid Read / Write / Construct Only
GVariant * value Read / Write / Construct Only

Signals

void value-changed Run First

Types and Values

Object Hierarchy

    GObject
    ╰── MaliitSettingsEntry

Includes

#include <maliit/maliitsettingsentry.h>

Description

The MaliitSettingsEntry is a class holding single plugin setting. It can be one of several available types (MaliitSettingsEntryType). It can also have some attributes like value domain (MALIIT_SETTING_VALUE_DOMAIN()), default value (MALIIT_SETTING_DEFAULT_VALUE) and value ranges (MALIIT_SETTING_VALUE_RANGE_MIN() and MALIIT_SETTING_VALUE_RANGE_MAX()).

Functions

maliit_settings_entry_get_attributes ()

GHashTable *
maliit_settings_entry_get_attributes (MaliitSettingsEntry *entry);

Gets attributes of the entry. The keys of the attributes are MALIIT_SETTING_VALUE_DOMAIN(), MALIIT_SETTING_VALUE_DOMAIN_DESCRIPTIONS(), MALIIT_SETTING_VALUE_RANGE_MIN(), MALIIT_SETTING_VALUE_RANGE_MAX() and MALIIT_SETTING_DEFAULT_VALUE(). Note that these keys don't have to exist in attributes.

Parameters

entry

The MaliitSettingsEntry.

[transfer none]

Returns

Attributes. Returned value should not be modified nor freed.

[transfer none][element-type utf8 GLib.Variant]


maliit_settings_entry_get_description ()

const gchar *
maliit_settings_entry_get_description (MaliitSettingsEntry *entry);

Gets description of the entry.

Parameters

entry

The MaliitSettingsEntry.

[transfer none]

Returns

A description. Returned value should not be modified nor freed.

[transfer none]


maliit_settings_entry_get_entry_type ()

MaliitSettingsEntryType
maliit_settings_entry_get_entry_type (MaliitSettingsEntry *entry);

Gets type of the entry.

Parameters

entry

The MaliitSettingsEntry.

[transfer none]

Returns

A type.


maliit_settings_entry_get_key ()

const gchar *
maliit_settings_entry_get_key (MaliitSettingsEntry *entry);

Gets key of the entry.

Parameters

entry

The MaliitSettingsEntry.

[transfer none]

Returns

A key. Returned value should not be modified nor freed.

[transfer none]


maliit_settings_entry_get_value ()

GVariant *
maliit_settings_entry_get_value (MaliitSettingsEntry *entry);

Gets value of the entry. Check its validity with maliit_settings_entry_is_current_value_valid() before using it.

Parameters

entry

The MaliitSettingsEntry.

[transfer none]

Returns

A value.

[transfer none]


maliit_settings_entry_is_value_valid ()

gboolean
maliit_settings_entry_is_value_valid (MaliitSettingsEntry *entry,
                                      GVariant *value);

Checks whether the value is valid one for the entry.

Parameters

entry

The MaliitSettingsEntry.

[transfer none]

value

The GVariant.

[transfer none]

Returns

TRUE if valid, otherwise FALSE.


maliit_settings_entry_set_value ()

void
maliit_settings_entry_set_value (MaliitSettingsEntry *entry,
                                 GVariant *value);

Sets a new value of the entry. Before setting new value, validate it with maliit_settings_entry_is_value_valid().

Parameters

entry

The MaliitSettingsEntry.

[transfer none]

value

The GVariant.

[transfer none]

maliit_settings_entry_is_current_value_valid ()

gboolean
maliit_settings_entry_is_current_value_valid
                               (MaliitSettingsEntry *entry);

Gets whether current value of the entry is valid.

Parameters

entry

The MaliitSettingsEntry.

[transfer none]

Returns

TRUE if valid, otherwise FALSE

Types and Values

struct MaliitSettingsEntry

struct MaliitSettingsEntry;

struct MaliitSettingsEntryClass

struct MaliitSettingsEntryClass {
    GObjectClass parent_class;
};

Members

Property Details

The “attributes” property

  “attributes”               GHashTable *

Attributes of the entry.

Flags: Read / Write / Construct Only


The “description” property

  “description”              gchar *

Description of the entry.

Flags: Read / Write / Construct Only

Default value: ""


The “extension” property

  “extension”                MaliitAttributeExtension *

MaliitAttributeExtension used by this entry.

Flags: Write / Construct Only


The “extension-key” property

  “extension-key”            gchar *

Key of the entry.

Flags: Read / Write / Construct Only

Default value: ""


The “type” property

  “type”                     MaliitSettingsEntryType

Type of the entry

Flags: Read / Write / Construct Only

Default value: MALIIT_STRING_TYPE


The “valid” property

  “valid”                    gboolean

Whether entry's value is valid.

Flags: Read / Write / Construct Only

Default value: FALSE


The “value” property

  “value”                    GVariant *

Value of the entry.

Flags: Read / Write / Construct Only

Allowed values: GVariant<*>

Default value: 0

Signal Details

The “value-changed” signal

void
user_function (MaliitSettingsEntry *entry,
               gpointer             user_data)

Emitted when value of the entry was changed in the plugin.

Parameters

entry

The MaliitSettingsEntry emitting the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First

See Also

MaliitSettingsEntry, MaliitPluginSettings