gtkspell

gtkspell

Functions

Properties

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkSpellChecker

Includes

#include <gtkspell/gtkspell.h>

Description

Functions

gtk_spell_checker_new ()

GtkSpellChecker *
gtk_spell_checker_new (void);

Create a new GtkSpellChecker object.

Returns

a new GtkSpellChecker object.


gtk_spell_checker_attach ()

gboolean
gtk_spell_checker_attach (GtkSpellChecker *spell,
                          GtkTextView *view);

Attach GtkSpellChecker object to view .

Note: Please read the tutorial section of the documentation to make sure you don't leak references!

Parameters

spell

A GtkSpellChecker.

 

view

The GtkTextView to attach to.

 

Returns

TRUE on success, FALSE on failure.


gtk_spell_checker_detach ()

void
gtk_spell_checker_detach (GtkSpellChecker *spell);

Detaches this GtkSpellChecker from its GtkTextView. Use gtk_spell_checker_get_from_text_view() to retrieve a GtkSpellChecker from a GtkTextView. If the GtkSpellChecker is not attached to any GtkTextView, the function silently exits.

Note: if the GtkSpellChecker is owned by the GtkTextView, you must take a reference to it to prevent it from being automatically destroyed. Please read the tutorial section of the documentation!

Parameters

spell

A GtkSpellChecker.

 

gtk_spell_checker_set_language ()

gboolean
gtk_spell_checker_set_language (GtkSpellChecker *spell,
                                const gchar *lang,
                                GError **error);

Set the language on spell to lang , possibily returning an error in error .

Parameters

spell

The GtkSpellChecker object.

 

lang

The language to use, as a locale specifier (i.e. "en_US"). If NULL, attempt to use the default system locale (LANG).

[allow-none]

error

Return location for error.

[out][allow-none]

Returns

FALSE if there was an error.


gtk_spell_checker_get_language ()

const gchar *
gtk_spell_checker_get_language (GtkSpellChecker *spell);

Fetches the current language.

Parameters

spell

a GtkSpellChecker

 

Returns

the current language. This string is owned by the spell object and must not be modified or freed.


gtk_spell_checker_get_language_list ()

GList *
gtk_spell_checker_get_language_list (void);

Requests the list of available languages from the enchant broker.

Returns

a GList of the available languages. Use g_list_free_full with g_free to free the list after use.

[transfer full][element-type utf8]

Since: 3.0.3


gtk_spell_checker_decode_language_code ()

gchar *
gtk_spell_checker_decode_language_code
                               (const gchar *lang);

Translates the language code to a human readable format (i.e. "en_US" -> "English (United States)"). Note: If the iso-codes package is not available, the unchanged code is returned.

Parameters

lang

The language locale specifier (i.e. "en_US").

 

Returns

The translated language specifier. Use g_free to free the returned string after use.

[transfer full]

Since: 3.0.3


gtk_spell_checker_check_word ()

gboolean
gtk_spell_checker_check_word (GtkSpellChecker *spell,
                              const gchar *word);

Check the specified word.

Parameters

spell

The GtkSpellChecker object.

 

word

The word to check.

 

Returns

TRUE if the word is correctly spelled, FALSE otherwise.

Since: 3.0.8


gtk_spell_checker_recheck_all ()

void
gtk_spell_checker_recheck_all (GtkSpellChecker *spell);

Recheck the spelling in the entire buffer.

Parameters

spell

The GtkSpellChecker object.

 

gtk_spell_checker_add_to_dictionary ()

void
gtk_spell_checker_add_to_dictionary (GtkSpellChecker *spell,
                                     const gchar *word);

Add the specified word to the user dictionary.

Parameters

spell

The GtkSpellChecker object.

 

word

The word to add to the user dictionary.

 

Since: 3.0.9


gtk_spell_checker_ignore_word ()

void
gtk_spell_checker_ignore_word (GtkSpellChecker *spell,
                               const gchar *word);

Add the specified word to the user ignore list.

Parameters

spell

The GtkSpellChecker object.

 

word

The word to add to the user ignore list.

 

Since: 3.0.9


gtk_spell_checker_get_from_text_view ()

GtkSpellChecker *
gtk_spell_checker_get_from_text_view (GtkTextView *view);

Retrieves the GtkSpellChecker object attached to a text view.

Parameters

view

A GtkTextView.

 

Returns

the GtkSpellChecker object, or NULL if there is no GtkSpellChecker attached to view .

[transfer none]


gtk_spell_checker_get_suggestions ()

GList *
gtk_spell_checker_get_suggestions (GtkSpellChecker *spell,
                                   const gchar *word);

Retreives a list of spelling suggestions for the specified word.

Parameters

spell

A GtkSpellChecker.

 

word

The word for which to fetch suggestions

 

Returns

the list of spelling suggestions for the specified word, or NULL if there are no suggestions.

[transfer full][element-type utf8]

Since: 3.0.8


gtk_spell_checker_get_suggestions_menu ()

GtkWidget *
gtk_spell_checker_get_suggestions_menu
                               (GtkSpellChecker *spell,
                                GtkTextIter *iter);

Retrieves a submenu of replacement spellings, or NULL if the word at iter is not misspelt.

Parameters

spell

A GtkSpellChecker.

 

iter

Textiter of position in buffer to be corrected if necessary.

 

Returns

the GtkMenu widget, or NULL if there is no need for a menu.

[transfer full]

Types and Values

struct GtkSpellChecker

struct GtkSpellChecker;

The GtkSpellChecker struct contains only private fields.


enum GtkSpellError

Error codes used for GtkSpell errors.

Members

GTK_SPELL_ERROR_BACKEND

Error code for backend errors

 

Property Details

The “decode-language-codes” property

  “decode-language-codes”    gboolean

Whether to show decoded language codes in the context menu (requires the iso-codes package).

Flags: Read / Write

Default value: FALSE

Signal Details

The “language-changed” signal

void
user_function (GtkSpellChecker *spell,
               gchar           *lang,
               gpointer         user_data)

The ::language-changed signal is emitted when the user selects a new spelling language from the context menu.

Parameters

spell

the GtkSpellChecker object which received the signal.

 

lang

the new language which was selected.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last