## gok-data

gok-data

## Synopsis

    #define             GOK_SETTINGS_FILE
    #define             MAX_KEY_SPACING
    #define             MAX_KEY_WIDTH
    #define             MIN_KEY_WIDTH
    #define             MAX_KEY_HEIGHT
    #define             MIN_KEY_HEIGHT
    void                gok_data_initialize                 (void);
    GokSetting*         gok_data_construct_setting          (void);
    gboolean            gok_data_read_settings              (void);
    gboolean            gok_data_write_settings             (void);
    gboolean            gok_data_get_setting                (gchar *NameAccessMethod,
                                                             gchar *NameSetting,
                                                             gint *Value,
                                                             gchar **ValueString);
    gboolean            gok_data_create_setting             (gchar *NameAccessMethod,
                                                             gchar *NameSetting,
                                                             gint Value,
                                                             gchar *pValueString);
    void                gok_data_close                      (void);
    gboolean            gok_data_set_setting                (gchar *NameAccessMethod,
                                                             gchar *NameSetting,
                                                             gint Value,
                                                             gchar *ValueString);
    gint                gok_data_get_key_width              (void);
    void                gok_data_set_key_width              (gint Width);
    gint                gok_data_get_key_height             (void);
    void                gok_data_set_key_height             (gint Height);
    gint                gok_data_get_key_spacing            (void);
    void                gok_data_set_key_spacing            (gint Spacing);
    gint                gok_data_get_keyboard_x             (void);
    void                gok_data_set_keyboard_x             (gint X);
    gint                gok_data_get_keyboard_y             (void);
    void                gok_data_set_keyboard_y             (gint Y);
    gboolean            gok_data_get_keysize_priority       (void);
    void                gok_data_set_keysize_priority       (gboolean bFlag);
    char*               gok_data_get_name_accessmethod      (void);
    void                gok_data_set_name_accessmethod      (const gchar *Name);
    gboolean            gok_data_get_wordcomplete           (void);
    void                gok_data_set_wordcomplete           (gboolean bTrueFalse);
    gint                gok_data_get_num_predictions        (void);
    void                gok_data_set_num_predictions        (gint Number);
    gboolean            gok_data_restore_settings           (void);
    void                gok_data_backup_setting             (GokSetting *pSetting);
    gboolean            gok_data_restore_setting            (GokSetting *pSetting);
    gboolean            gok_data_get_control_values         (GokControl *pControl);
    gboolean            gok_data_get_use_gtkplus_theme      (void);
    void                gok_data_set_use_gtkplus_theme      (gboolean bTrueFalse);

## Description

## Details

### GOK_SETTINGS_FILE

    #define GOK_SETTINGS_FILE "gok-settings.xml"

### MAX_KEY_SPACING

    #define MAX_KEY_SPACING 100

### MAX_KEY_WIDTH

    #define MAX_KEY_WIDTH 200

### MIN_KEY_WIDTH

    #define MIN_KEY_WIDTH 5

### MAX_KEY_HEIGHT

    #define MAX_KEY_HEIGHT 100

### MIN_KEY_HEIGHT

    #define MIN_KEY_HEIGHT 5

### gok_data_initialize ()

    void                gok_data_initialize                 (void);

Call this before using the Data. All data is initialized here.

### gok_data_construct_setting ()

    GokSetting*         gok_data_construct_setting          (void);

Creates a new GokSetting structure.

Returns : | A pointer to the new setting, NULL if setting was not created.

### gok_data_read_settings ()

    gboolean            gok_data_read_settings              (void);

Reads in the settings from disk. The settings are stored in a list with the first item * in m_pSettingFirst.

Returns : | TRUE if the settings were read in correctly, FALSE if not.

### gok_data_write_settings ()

    gboolean            gok_data_write_settings             (void);

Returns : |

### gok_data_get_setting ()

    gboolean            gok_data_get_setting                (gchar *NameAccessMethod,
                                                             gchar *NameSetting,
                                                             gint *Value,
                                                             gchar **ValueString);

Gets a value for an access method setting.

`NameAccessMethod` : | Name of the access method that contains the setting.
`NameSetting` : | Name of the setting you want. This string may specify more than one setting with the various names seperated by '+'. In this case, only the first name will be used.
`Value` : | Will contain the setting value if the function returns TRUE. This may be NULL in which case it will not be filled in.
`ValueString` : | Will contain a pointer to the value string. This name be NULL in which case it will not be filled in.
Returns : | TRUE if the GokData has the setting, FALSE if not.

### gok_data_create_setting ()

    gboolean            gok_data_create_setting             (gchar *NameAccessMethod,
                                                             gchar *NameSetting,
                                                             gint Value,
                                                             gchar *pValueString);

Creates a new setting and stores it in GConf.

`NameAccessMethod` : | Name of the access method that uses the setting.
`NameSetting` : | Name of the setting.
`Value` : | Setting value.
Returns : | TRUE if the new setting was created, FALSE if not.

### gok_data_close ()

    void                gok_data_close                      (void);

Frees any memory used by the data.

### gok_data_set_setting ()

    gboolean            gok_data_set_setting                (gchar *NameAccessMethod,
                                                             gchar *NameSetting,
                                                             gint Value,
                                                             gchar *ValueString);

Sets a value for an access method.

`NameAccessMethod` : | Name of the access method that contains the setting.
`NameSetting` : | Name of the setting you want. You may specify more than one setting by seperating the setting names by "+".
`Value` : | Will contain the setting value if the function returns TRUE.
Returns : | TRUE if the setting was changed, FALSE if not.

### gok_data_get_key_width ()

    gint                gok_data_get_key_width              (void);

Returns : | The key width.

### gok_data_set_key_width ()

    void                gok_data_set_key_width              (gint Width);

`Width` : | The new key width

### gok_data_get_key_height ()

    gint                gok_data_get_key_height             (void);

Returns : | The key height.

### gok_data_set_key_height ()

    void                gok_data_set_key_height             (gint Height);

`Height` : | The new key height.

### gok_data_get_key_spacing ()

    gint                gok_data_get_key_spacing            (void);

Returns : | The key spacing.

### gok_data_set_key_spacing ()

    void                gok_data_set_key_spacing            (gint Spacing);

`Spacing` : | The new key spacing.

### gok_data_get_keyboard_x ()

    gint                gok_data_get_keyboard_x             (void);

Returns : | The horizontal location of the keyboard.

### gok_data_set_keyboard_x ()

    void                gok_data_set_keyboard_x             (gint X);

`X` : | Horizontal position of the keyboard.

### gok_data_get_keyboard_y ()

    gint                gok_data_get_keyboard_y             (void);

Returns : | The vertical position of the keyboard.

### gok_data_set_keyboard_y ()

    void                gok_data_set_keyboard_y             (gint Y);

`Y` : | Vertical position of the keyboard.

### gok_data_get_keysize_priority ()

    gboolean            gok_data_get_keysize_priority       (void);

Returns : | TRUE if the keyboard should use the keysize to determine the keyboard size, FALSE if not.

### gok_data_set_keysize_priority ()

    void                gok_data_set_keysize_priority       (gboolean bFlag);

`bFlag` : | TRUE if the keysize should be used to determine keyboard size.

### gok_data_get_name_accessmethod ()

    char*               gok_data_get_name_accessmethod      (void);

Returns : | Pointer to the name of the current access method.

### gok_data_set_name_accessmethod ()

    void                gok_data_set_name_accessmethod      (const gchar *Name);

Records the new access method and stores it in GConf.

`Name` : | Name of the current access method.

### gok_data_get_wordcomplete ()

    gboolean            gok_data_get_wordcomplete           (void);

Returns : | TRUE if word completion is turned on, FALSE if it's turned off.

### gok_data_set_wordcomplete ()

    void                gok_data_set_wordcomplete           (gboolean bTrueFalse);

`bTrueFalse` : | The flag setting the word completion state.

### gok_data_get_num_predictions ()

    gint                gok_data_get_num_predictions        (void);

Returns : | The maximum number of word predictions.

### gok_data_set_num_predictions ()

    void                gok_data_set_num_predictions        (gint Number);

`Number` : | Maximum number of word predictions.

### gok_data_restore_settings ()

    gboolean            gok_data_restore_settings           (void);

Restores the values for all the settings.

Returns : | TRUE if any restored setting was different from the current setting. Returns FALSE if all the restored settings are the same as the current settings.

### gok_data_backup_setting ()

    void                gok_data_backup_setting             (GokSetting *pSetting);

Backs up the values for the given setting.

`pSetting` : | Pointer to the setting that will be backed up.

### gok_data_restore_setting ()

    gboolean            gok_data_restore_setting            (GokSetting *pSetting);

Restores the values for the given setting.

`pSetting` : | Pointer to the setting that will be restored.
Returns : | TRUE if the backup setting is different from the current setting. Returns FALSE if the backup setting is the same as the current setting.

### gok_data_get_control_values ()

    gboolean            gok_data_get_control_values         (GokControl *pControl);

Gets the values from the settings for the given control.

Returns : | TRUE if the value was updated, FALSE if not.

### gok_data_get_use_gtkplus_theme ()

    gboolean            gok_data_get_use_gtkplus_theme      (void);

Returns : | TRUE if we should use the Gtk+ theme, FALSE if we should not.

### gok_data_set_use_gtkplus_theme ()

    void                gok_data_set_use_gtkplus_theme      (gboolean bTrueFalse);

`bTrueFalse` : | The flag setting whether to use the Gtk+ theme or not.