gtkspellmm 3.0.5
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Symbols | List of all members
GtkSpell::Checker Class Reference

#include <gtkspellmm/gtkspell.h>

Inheritance diagram for GtkSpell::Checker:
Inheritance graph
[legend]

Public Member Functions

 Checker (Checker&& src) noexcept
 
Checkeroperator= (Checker&& src) noexcept
 
virtual ~Checker () noexcept
 
GtkSpellChecker* gobj ()
 Provides access to the underlying C GObject.
 
const GtkSpellChecker* gobj () const
 Provides access to the underlying C GObject.
 
GtkSpellChecker* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
 
 Checker ()
 Constructs a new GtkSpell::Checker object.
 
bool attach (Gtk::TextView& view)
 Attach the GtkSpell::Checker to the specified Gtk::TextView.
 
void detach ()
 Detaches the Gtk::SpellChecker.
 
std::vector< Glib::ustring > get_suggestions (const Glib::ustring& word)
 Retreives a list of spelling suggestions for the specified word.
 
Gtk::Menu* get_suggestions_menu (Gtk::TextIter& iter)
 Retreives a Gtk::Menu of replacement spellings.
 
void set_language (const Glib::ustring& lang)
 Sets the language to be used for spelling, throws an exception on failure.
 
Glib::ustring get_language ()
 Gets the language currently being used for spelling.
 
bool check_word (const Glib::ustring& word)
 Check the specified word.
 
void recheck_all ()
 Rechecks the entire text buffer.
 
void add_to_dictionary (const Glib::ustring& word)
 Add the specified word to the user dictionary.
 
void ignore_word (const Glib::ustring& word)
 Add the specified word to the user ignore list.
 
Glib::SignalProxy1< void, const Glib::ustring& > signal_language_changed ()
 This signal is emitted when a new language is selected from the context menu.
 
Glib::PropertyProxy< bool > property_decode_language_codes ()
 Whether to show decoded language codes in the context menu (requires the iso-codes package).
 
Glib::PropertyProxy_ReadOnly< bool > property_decode_language_codes () const
 Whether to show decoded language codes in the context menu (requires the iso-codes package).
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system.
 
static Glib::RefPtr< Checkerget_from_text_view (Gtk::TextView& view)
 Retreives the GtkSpell::Checker attached to a Gtk::TextView.
 
static std::vector< Glib::ustring > get_language_list ()
 Gets the list of available languages.
 
static Glib::ustring decode_language_code (const Glib::ustring& lang)
 Translates the language code to a human readable format (i.e.
 

Protected Member Functions

virtual void on_language_changed (const Glib::ustring& newlang)
 This is a default handler for the signal signal_language_changed().
 

Related Symbols

(Note that these are not member symbols.)

Glib::RefPtr< GtkSpell::Checkerwrap (GtkSpellChecker* object, bool take_copy=false)
 A Glib::wrap() method for this object.
 

Detailed Description

Examples
example/example.cc.

Constructor & Destructor Documentation

◆ Checker() [1/2]

GtkSpell::Checker::Checker ( Checker&&  src)
noexcept

◆ ~Checker()

virtual GtkSpell::Checker::~Checker ( )
virtualnoexcept

◆ Checker() [2/2]

GtkSpell::Checker::Checker ( )

Constructs a new GtkSpell::Checker object.

Member Function Documentation

◆ add_to_dictionary()

void GtkSpell::Checker::add_to_dictionary ( const Glib::ustring &  word)

Add the specified word to the user dictionary.

Parameters
wordThe word to add to the user dictionary.
Since gtkspellmm 3.0.5:

◆ attach()

bool GtkSpell::Checker::attach ( Gtk::TextView &  view)

Attach the GtkSpell::Checker to the specified Gtk::TextView.

Parameters
viewA Gtk::TextView
Returns
Whether the operation succeded
Examples
example/example.cc.

◆ check_word()

bool GtkSpell::Checker::check_word ( const Glib::ustring &  word)

Check the specified word.

Parameters
wordThe word to check.
Returns
TRUE if the word is correctly spelled, FALSE otherwise.
Since gtkspellmm 3.0.4:

◆ decode_language_code()

static Glib::ustring GtkSpell::Checker::decode_language_code ( const Glib::ustring &  lang)
static

Translates the language code to a human readable format (i.e.

"en_US" -> "English (United States)").

Parameters
langThe language locale specifier (i.e. "en", or "en_US").
Note
If the iso-codes package is not available, the unchanged code is returned.
Returns
The translated language specifier.
Since gtkspellmm 3.0.2:

◆ detach()

void GtkSpell::Checker::detach ( )

Detaches the Gtk::SpellChecker.

If the Gtk::SpellChecker is not attached to any Gtk::TextView, the function silently exits

◆ get_from_text_view()

static Glib::RefPtr< Checker > GtkSpell::Checker::get_from_text_view ( Gtk::TextView &  view)
static

Retreives the GtkSpell::Checker attached to a Gtk::TextView.

Parameters
viewA Gtk::TextView
Returns
A Glib::RefPtr to the attached Gtk::SpellChecker, if any, otherwise a null Glib::RefPtr

◆ get_language()

Glib::ustring GtkSpell::Checker::get_language ( )

Gets the language currently being used for spelling.

Returns
The language, as a locale specifier (i.e. "en", or "en_US")

◆ get_language_list()

static std::vector< Glib::ustring > GtkSpell::Checker::get_language_list ( )
static

Gets the list of available languages.

Returns
The list of languages
Since gtkspellmm 3.0.2:

◆ get_suggestions()

std::vector< Glib::ustring > GtkSpell::Checker::get_suggestions ( const Glib::ustring &  word)

Retreives a list of spelling suggestions for the specified word.

Parameters
wordThe word for which to fetch suggestions
Returns
The list of spelling suggestions for the specified word.
Since gtkspellmm 3.0.4:

◆ get_suggestions_menu()

Gtk::Menu * GtkSpell::Checker::get_suggestions_menu ( Gtk::TextIter &  iter)

Retreives a Gtk::Menu of replacement spellings.

Parameters
iterA Gtk::TextIter position in the buffer to be corrected
Returns
A pointer to a Gtk::Menu, or null if the word is not misspelt

◆ get_type()

static GType GtkSpell::Checker::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ gobj() [1/2]

GtkSpellChecker * GtkSpell::Checker::gobj ( )
inline

Provides access to the underlying C GObject.

◆ gobj() [2/2]

const GtkSpellChecker * GtkSpell::Checker::gobj ( ) const
inline

Provides access to the underlying C GObject.

◆ gobj_copy()

GtkSpellChecker * GtkSpell::Checker::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

◆ ignore_word()

void GtkSpell::Checker::ignore_word ( const Glib::ustring &  word)

Add the specified word to the user ignore list.

Parameters
wordThe word to add to the user ignore list.
Since gtkspellmm 3.0.5:

◆ on_language_changed()

virtual void GtkSpell::Checker::on_language_changed ( const Glib::ustring &  newlang)
protectedvirtual

This is a default handler for the signal signal_language_changed().

◆ operator=()

Checker& GtkSpell::Checker::operator= ( Checker&&  src)
noexcept

◆ property_decode_language_codes() [1/2]

Glib::PropertyProxy< bool > GtkSpell::Checker::property_decode_language_codes ( )

Whether to show decoded language codes in the context menu (requires the iso-codes package).

Since gtkspellmm 3.0.2:

Whether to show decoded language codes in the context menu (requires the iso-codes package).

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_decode_language_codes() [2/2]

Glib::PropertyProxy_ReadOnly< bool > GtkSpell::Checker::property_decode_language_codes ( ) const

Whether to show decoded language codes in the context menu (requires the iso-codes package).

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ recheck_all()

void GtkSpell::Checker::recheck_all ( )

Rechecks the entire text buffer.

◆ set_language()

void GtkSpell::Checker::set_language ( const Glib::ustring &  lang)

Sets the language to be used for spelling, throws an exception on failure.

Parameters
langThe language, as a locale specifier (i.e. "en", or "en_US")
Exceptions
Gtk::ErrorAn exception describing the error occured
Examples
example/example.cc.

◆ signal_language_changed()

Glib::SignalProxy1< void, const Glib::ustring & > GtkSpell::Checker::signal_language_changed ( )

This signal is emitted when a new language is selected from the context menu.

Parameters
newlangThe new spelling language
Slot Prototype:
void on_my_language_changed(const Glib::ustring& newlang)

The signal_language_changed() signal is emitted when the user selects a new spelling language from the context menu.

Parameters
newlangThe new language which was selected.

Friends And Related Symbol Documentation

◆ wrap()

Glib::RefPtr< GtkSpell::Checker > wrap ( GtkSpellChecker *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.