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

Trait containing all Checker methods.

Implementors

Checker

Provided Methods§

source

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.

source

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.

source

fn check_word(&self, word: &str) -> Result<(), Error>

If the language is None, i.e. when no dictonaries are available, this function returns true to limit the damage.

word

the word to check.

word_length

the byte length of word, or -1 if word is nul-terminated.

Returns

true if word is correctly spelled, false otherwise.

source

fn clear_session(&self)

Clears the session dictionary.

source

fn language(&self) -> Option<Language>

Returns

the Language currently used, or None if no dictionaries are available.

source

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.

source

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.

source

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

the Language to use, or None.

source

fn connect_session_cleared<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted when the session dictionary is cleared.

source

fn connect_word_added_to_personal<F: Fn(&Self, &str) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted when a word is added to the personal dictionary.

word

the added word.

source

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.

source

fn connect_language_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId

Object Safety§

This trait is not object safe.

Implementors§