## WebKitSpellChecker WebKitSpellChecker — the spell checking API for WebKit |

## Synopsis

                        WebKitSpellChecker;
    void                webkit_spell_checker_check_spelling_of_string
                                                            (WebKitSpellChecker *checker,
                                                             const char *string,
                                                             int *misspelling_location,
                                                             int *misspelling_length);
    char **             webkit_spell_checker_get_guesses_for_word
                                                            (WebKitSpellChecker *checker,
                                                             const char *word,
                                                             const char *context);
    void                webkit_spell_checker_update_spell_checking_languages
                                                            (WebKitSpellChecker *checker,
                                                             const char *languages);
    char *              webkit_spell_checker_get_autocorrect_suggestions_for_misspelled_word
                                                            (WebKitSpellChecker *checker,
                                                             const char *word);
    void                webkit_spell_checker_learn_word     (WebKitSpellChecker *checker,
                                                             const char *word);
    void                webkit_spell_checker_ignore_word    (WebKitSpellChecker *checker,
                                                             const char *word);

## 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.

## Details

### WebKitSpellChecker

    typedef struct _WebKitSpellChecker WebKitSpellChecker;

### 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.

`checker` : | a WebKitSpellChecker
`string` : | the string to check for misspellings
`misspelling_location` : | (out) (allow-none) a pointer to an integer to store the location of the first misspelling
`misspelling_length` : | (out) (allow-none) a pointer to an integer to store the length of the first misspelling

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`.

`checker` : | a WebKitSpellChecker
`word` : | the misspelled word
`context` : | (allow-none) the surrounding context of the misspelled word
Returns : | (transfer full) a newly allocated `NULL`-terminated array of suggested corrections for a misspelled word `word`. Free it with `g_strfreev` when done with it.

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.

`checker` : | a WebKitSpellChecker
`languages` : | (allow-none) a string of languages to use for `checker`

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.

`checker` : | a WebKitSpellChecker
`word` : | a misspelled word
Returns : | (transfer full) the suggestion for the autocorrection of `word`

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.

`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.

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

Since 1.5.1