Trait gspell::prelude::CheckerExt
source · pub trait CheckerExt: IsA<Checker> + Sealed + 'static {
// Provided methods
fn add_word_to_personal(&self, word: &str) { ... }
fn add_word_to_session(&self, word: &str) { ... }
fn check_word(&self, word: &str) -> Result<(), Error> { ... }
fn clear_session(&self) { ... }
fn language(&self) -> Option<Language> { ... }
fn suggestions(&self, word: &str) -> Vec<GString> { ... }
fn set_correction(&self, word: &str, replacement: &str) { ... }
fn set_language(&self, language: Option<&Language>) { ... }
fn connect_session_cleared<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId { ... }
fn connect_word_added_to_personal<F: Fn(&Self, &str) + 'static>(
&self,
f: F
) -> SignalHandlerId { ... }
fn connect_word_added_to_session<F: Fn(&Self, &str) + 'static>(
&self,
f: F
) -> SignalHandlerId { ... }
fn connect_language_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId { ... }
}
Expand description
Provided Methods§
sourcefn add_word_to_personal(&self, word: &str)
fn add_word_to_personal(&self, word: &str)
Adds a word to the personal dictionary. It is typically saved in the user’s home directory.
word
a word.
word_length
the byte length of word
, or -1 if word
is nul-terminated.
sourcefn add_word_to_session(&self, word: &str)
fn add_word_to_session(&self, word: &str)
Adds a word to the session dictionary. Each Checker
instance has a
different session dictionary. The session dictionary is lost when the
language
property changes or when self
is destroyed or
when clear_session()
is called.
This function is typically called for an “Ignore All” action.
word
a word.
word_length
the byte length of word
, or -1 if word
is nul-terminated.
sourcefn clear_session(&self)
fn clear_session(&self)
Clears the session dictionary.
sourcefn suggestions(&self, word: &str) -> Vec<GString>
fn suggestions(&self, word: &str) -> Vec<GString>
Gets the suggestions for word
. Free the return value with
g_slist_free_full(suggestions, g_free).
word
a misspelled word.
word_length
the byte length of word
, or -1 if word
is nul-terminated.
Returns
the list of suggestions.
sourcefn set_correction(&self, word: &str, replacement: &str)
fn set_correction(&self, word: &str, replacement: &str)
Informs the spell checker that word
is replaced/corrected by replacement
.
word
a word.
word_length
the byte length of word
, or -1 if word
is nul-terminated.
replacement
the replacement word.
replacement_length
the byte length of replacement
, or -1 if replacement
is nul-terminated.
sourcefn set_language(&self, language: Option<&Language>)
fn set_language(&self, language: Option<&Language>)
Sets the language to use for the spell checking. If language
is None
, the
default language is picked with Language::default()
.
language
sourcefn connect_session_cleared<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_session_cleared<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId
Emitted when the session dictionary is cleared.
sourcefn connect_word_added_to_personal<F: Fn(&Self, &str) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_word_added_to_personal<F: Fn(&Self, &str) + 'static>( &self, f: F ) -> SignalHandlerId
sourcefn connect_word_added_to_session<F: Fn(&Self, &str) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_word_added_to_session<F: Fn(&Self, &str) + 'static>( &self, f: F ) -> SignalHandlerId
Emitted when a word is added to the session dictionary. See
add_word_to_session()
.
word
the added word.