Top |
GtkSpellChecker *
gtk_spell_checker_new (void
);
Create a new GtkSpellChecker object.
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!
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!
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
.
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] |
const gchar *
gtk_spell_checker_get_language (GtkSpellChecker *spell
);
Fetches the current language.
GList *
gtk_spell_checker_get_language_list (void
);
Requests the list of available languages from the enchant broker.
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
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.
The translated language specifier. Use g_free to free the returned string after use.
[transfer full]
Since: 3.0.3
gboolean gtk_spell_checker_check_word (GtkSpellChecker *spell
,const gchar *word
);
Check the specified word.
Since: 3.0.8
void
gtk_spell_checker_recheck_all (GtkSpellChecker *spell
);
Recheck the spelling in the entire buffer.
void gtk_spell_checker_add_to_dictionary (GtkSpellChecker *spell
,const gchar *word
);
Add the specified word to the user dictionary.
Since: 3.0.9
void gtk_spell_checker_ignore_word (GtkSpellChecker *spell
,const gchar *word
);
Add the specified word to the user ignore list.
Since: 3.0.9
GtkSpellChecker *
gtk_spell_checker_get_from_text_view (GtkTextView *view
);
Retrieves the GtkSpellChecker object attached to a text view.
the GtkSpellChecker object, or NULL
if there is no GtkSpellChecker
attached to view
.
[transfer none]
GList * gtk_spell_checker_get_suggestions (GtkSpellChecker *spell
,const gchar *word
);
Retreives a list of spelling suggestions for the specified word.
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
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.
struct GtkSpellChecker;
The GtkSpellChecker struct contains only private fields.
“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
“language-changed”
signalvoid 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.
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