MaliitSettingsEntry

MaliitSettingsEntry — settings entry

Stability Level

Stable, unless otherwise indicated

Synopsis

#include <maliit/maliitsettingsentry.h>

struct              MaliitSettingsEntry;
struct              MaliitSettingsEntryClass;
GHashTable *        maliit_settings_entry_get_attributes
                                                        (MaliitSettingsEntry *entry);
const gchar *       maliit_settings_entry_get_description
                                                        (MaliitSettingsEntry *entry);
MaliitSettingsEntryType maliit_settings_entry_get_entry_type
                                                        (MaliitSettingsEntry *entry);
const gchar *       maliit_settings_entry_get_key       (MaliitSettingsEntry *entry);
GVariant *          maliit_settings_entry_get_value     (MaliitSettingsEntry *entry);
gboolean            maliit_settings_entry_is_value_valid
                                                        (MaliitSettingsEntry *entry,
                                                         GVariant *value);
void                maliit_settings_entry_set_value     (MaliitSettingsEntry *entry,
                                                         GVariant *value);
gboolean            maliit_settings_entry_is_current_value_valid
                                                        (MaliitSettingsEntry *entry);

Object Hierarchy

  GObject
   +----MaliitSettingsEntry

Properties

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

Signals

  "value-changed"                                  : Run First

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()).

Details

struct MaliitSettingsEntry

struct MaliitSettingsEntry;

struct MaliitSettingsEntryClass

struct MaliitSettingsEntryClass {
    GObjectClass parent_class;
};

GObjectClass parent_class;

The parent class.

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.

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.

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.

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.

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.

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.

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().

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.

entry :

The MaliitSettingsEntry. [transfer none]

Returns :

TRUE if valid, otherwise FALSE

Property Details

The "attributes" property

  "attributes"               GHashTable*           : Read / Write / Construct Only

Attributes of the entry.


The "description" property

  "description"              gchar*                : Read / Write / Construct Only

Description of the entry.

Default value: ""


The "extension" property

  "extension"                MaliitAttributeExtension*  : Write / Construct Only

MaliitAttributeExtension used by this entry.


The "extension-key" property

  "extension-key"            gchar*                : Read / Write / Construct Only

Key of the entry.

Default value: ""


The "type" property

  "type"                     MaliitSettingsEntryType  : Read / Write / Construct Only

Type of the entry

Default value: MALIIT_STRING_TYPE


The "valid" property

  "valid"                    gboolean              : Read / Write / Construct Only

Whether entry's value is valid.

Default value: FALSE


The "value" property

  "value"                    GVariant*             : Read / Write / Construct Only

Value of the entry.

Allowed values: GVariant<*>

Default value: 0

Signal Details

The "value-changed" signal

void                user_function                      (MaliitSettingsEntry *entry,
                                                        gpointer             user_data)      : Run First

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

entry :

The MaliitSettingsEntry emitting the signal.

user_data :

user data set when the signal handler was connected.

See Also

MaliitSettingsEntry, MaliitPluginSettings