## WebKitSpellChecker

WebKitSpellChecker — the spell checking API for WebKit

## Functions

void | webkit_spell_checker_check_spelling_of_string ()
char ** | webkit_spell_checker_get_guesses_for_word ()
void | webkit_spell_checker_update_spell_checking_languages ()
char * | webkit_spell_checker_get_autocorrect_suggestions_for_misspelled_word ()
void | webkit_spell_checker_learn_word ()
void | webkit_spell_checker_ignore_word ()

## Types and Values

| WebKitSpellChecker

## Object Hierarchy

        GInterface
        ╰── WebKitSpellChecker

## Prerequisites

WebKitSpellChecker requires GObject.

## Description

WebKitSpellChecker provides APIs for the spell checking functionality used internally by WebKit to perform spell checking in editable areas. This can be used, for example, by browsers to implement custom spell checking context menus or sophisticated auto-correct features.

## Functions

### webkit_spell_checker_check_spelling_of_string ()

    void
    webkit_spell_checker_check_spelling_of_string
                                   (WebKitSpellChecker *checker,
                                    const char *string,
                                    int *misspelling_location,
                                    int *misspelling_length);

Checks `string` for misspellings using `checker` , storing the location and length of the first misspelling in `misspelling_location` and `misspelling_length` respectively.

#### Parameters

checker | a WebKitSpellChecker |
string | the string to check for misspellings |
misspelling_location | a pointer to an integer to store the location of the first misspelling. | [out][allow-none]
misspelling_length | a pointer to an integer to store the length of the first misspelling. | [out][allow-none]

Since: 1.5.1

### webkit_spell_checker_get_guesses_for_word ()

    char **
    webkit_spell_checker_get_guesses_for_word
                                   (WebKitSpellChecker *checker,
                                    const char *word,
                                    const char *context);

Returns a `NULL`-terminated array of guesses for corrections of the misspelled word `word` .

#### Parameters

checker | a WebKitSpellChecker |
word | the misspelled word |
context | the surrounding context of the misspelled word. | [allow-none]

#### Returns

a newly allocated `NULL`-terminated array of suggested corrections for a misspelled word `word` . Free it with `g_strfreev` when done with it.

[transfer full]

Since: 1.5.1

### webkit_spell_checker_update_spell_checking_languages ()

    void
    webkit_spell_checker_update_spell_checking_languages
                                   (WebKitSpellChecker *checker,
                                    const char *languages);

Sets `languages` as the list of languages to use by `checker` . The accepted format is a list of comma (',') separated language codes of the form 'en_US', ie, language_VARIANT.

#### Parameters

checker | a WebKitSpellChecker |
languages | a string of languages to use for `checker` . | [allow-none]

Since: 1.5.1

### webkit_spell_checker_get_autocorrect_suggestions_for_misspelled_word ()

    char *
    webkit_spell_checker_get_autocorrect_suggestions_for_misspelled_word
                                   (WebKitSpellChecker *checker,
                                    const char *word);

Returns a suggestion for a word to use in an "autocorrect" feature.

#### Parameters

checker | a WebKitSpellChecker |
word | a misspelled word |

#### Returns

the suggestion for the autocorrection of `word` .

[transfer full]

Since: 1.5.1

### webkit_spell_checker_learn_word ()

    void
    webkit_spell_checker_learn_word (WebKitSpellChecker *checker,
                                     const char *word);

Instructs the `checker` to add `word` to its dictionary as a properly spelled word. The word will be learned permanently in the user's personal dictionary.

#### Parameters

checker | a WebKitSpellChecker |
word | the word to learn |

Since: 1.5.1

### webkit_spell_checker_ignore_word ()

    void
    webkit_spell_checker_ignore_word (WebKitSpellChecker *checker,
                                      const char *word);

Instructs the `checker` to ignore `word` as a misspelling for this session.

#### Parameters

checker | a WebKitSpellChecker |
word | the word to ignore |

Since: 1.5.1

## Types and Values

### WebKitSpellChecker

    typedef struct _WebKitSpellChecker WebKitSpellChecker;