| GtkSpell Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | Signals | ||||
#include <gtkspell/gtkspell.h> struct GtkSpellChecker; GtkSpellChecker * gtk_spell_checker_new (void); gboolean gtk_spell_checker_attach (GtkSpellChecker *spell,GtkTextView *view); void gtk_spell_checker_detach (GtkSpellChecker *spell); gboolean gtk_spell_checker_set_language (GtkSpellChecker *spell,const gchar *lang,GError **error); const gchar * gtk_spell_checker_get_language (GtkSpellChecker *spell); GList * gtk_spell_checker_get_language_list (void); gchar * gtk_spell_checker_decode_language_code (const gchar *lang); void gtk_spell_checker_recheck_all (GtkSpellChecker *spell); GtkSpellChecker * gtk_spell_checker_get_from_text_view (GtkTextView *view); GtkWidget * gtk_spell_checker_get_suggestions_menu (GtkSpellChecker *spell,GtkTextIter *iter); enum GtkSpellError;
struct GtkSpellChecker;
The GtkSpellChecker struct contains only private fields.
GtkSpellChecker * gtk_spell_checker_new (void);
Create a new GtkSpellChecker object.
Returns : |
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!
|
A GtkSpellChecker. |
|
The GtkTextView to attach to. |
Returns : |
TRUE on success, FALSE on failure. |
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!
|
A GtkSpellChecker. |
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.
|
The GtkSpellChecker object. |
|
The language to use, as a locale specifier (i.e. "en_US"). If NULL, attempt to use the default system locale (LANG). [allow-none] |
|
Return location for error. [out][allow-none] |
Returns : |
FALSE if there was an error. |
const gchar * gtk_spell_checker_get_language (GtkSpellChecker *spell);
Fetches the current language.
|
a GtkSpellChecker |
Returns : |
the current language. This string is owned by the spell object and must not be modified or freed. |
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 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 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
void gtk_spell_checker_recheck_all (GtkSpellChecker *spell);
Recheck the spelling in the entire buffer.
|
The GtkSpellChecker object. |
GtkSpellChecker * gtk_spell_checker_get_from_text_view
(GtkTextView *view);
Retrieves the GtkSpellChecker object attached to a text view.
|
A GtkTextView. |
Returns : |
the GtkSpellChecker object, or NULL if there is no GtkSpellChecker
attached to view. [transfer none]
|
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.
|
A GtkSpellChecker. |
|
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]
|
"language-changed" signalvoid user_function (GtkSpellChecker *spell,
gchar *lang,
gpointer user_data) : Run Last
The ::language-changed signal is emitted when the user selects a new spelling language from the context menu.
|
the GtkSpellChecker object which received the signal. |
|
the new language which was selected. |
|
user data set when the signal handler was connected. |