Top | ![]() |
![]() |
![]() |
![]() |
#define | GSPELL_CHECKER_ERROR |
GspellChecker * | gspell_checker_new () |
gboolean | gspell_checker_set_language () |
const GspellLanguage * | gspell_checker_get_language () |
gboolean | gspell_checker_check_word () |
GSList * | gspell_checker_get_suggestions () |
void | gspell_checker_add_word_to_personal () |
void | gspell_checker_add_word_to_session () |
void | gspell_checker_clear_session () |
void | gspell_checker_set_correction () |
void | add-word-to-personal | Run Last |
void | add-word-to-session | Run Last |
void | clear-session | Run Last |
GspellChecker is a spell checker. It is a wrapper around the Enchant library, to have an API based on GObject.
If the “language” is not set correctly, the spell checker
should not be used. It can happen when no dictionaries are available, in
which case gspell_checker_get_language()
returns NULL
.
#define GSPELL_CHECKER_ERROR (gspell_checker_error_quark ())
Error domain for the spell checker. Errors in this domain will be from the GspellCheckerError enumeration. See GError for more information on error domains.
GspellChecker *
gspell_checker_new (const GspellLanguage *language
);
Creates a new GspellChecker. If language
is NULL
, finds the best available
language based on the current locale.
gboolean gspell_checker_set_language (GspellChecker *checker
,const GspellLanguage *language
);
Sets the language to use for the spell checking. If language
is NULL
, finds
the best available language based on the current locale.
const GspellLanguage *
gspell_checker_get_language (GspellChecker *checker
);
gboolean gspell_checker_check_word (GspellChecker *checker
,const gchar *word
,GError **error
);
GSList * gspell_checker_get_suggestions (GspellChecker *checker
,const gchar *word
);
Gets the suggestions for word
. Free the return value with
g_slist_free_full(suggestions, g_free).
void gspell_checker_add_word_to_personal (GspellChecker *checker
,const gchar *word
);
Adds a word to the personal dictionary. It is typically saved in the user home directory.
void gspell_checker_add_word_to_session (GspellChecker *checker
,const gchar *word
);
Adds a word to the session dictionary. The session dictionary is lost when the application exits. This function is typically called when an “Ignore All” action is activated.
void
gspell_checker_clear_session (GspellChecker *checker
);
Clears the session dictionary.
void gspell_checker_set_correction (GspellChecker *checker
,const gchar *word
,const gchar *replacement
);
Informs the spell checker that word
is replaced/corrected by replacement
.
An error code used with GSPELL_CHECKER_ERROR
in a GError returned
from a spell-checker-related function.
“language”
property“language” GspellLanguage *
The GspellLanguage used.
Flags: Read / Write / Construct
“add-word-to-personal”
signalvoid user_function (GspellChecker *spell_checker, gchar *word, gpointer user_data)
Emitted when a word is added to the personal dictionary.
spell_checker |
the GspellChecker. |
|
word |
the added word. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“add-word-to-session”
signalvoid user_function (GspellChecker *spell_checker, gchar *word, gpointer user_data)
Emitted when a word is added to the session dictionary. The session dictionary is lost when the application exits.
spell_checker |
the GspellChecker. |
|
word |
the added word. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“clear-session”
signalvoid user_function (GspellChecker *spell_checker, gpointer user_data)
Emitted when the session dictionary is cleared.
spell_checker |
the GspellChecker. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last