| GtkSpell Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Signals | ||||
#include <gtkspell/gtkspell.h>
GtkSpellChecker;
GtkSpellCheckerClass;
GtkSpellChecker * gtk_spell_checker_new ();
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);
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);
#define GTK_SPELL_ERROR
enum GtkSpellError;
typedef struct _GtkSpellChecker GtkSpellChecker;
The GtkSpellChecker struct contains only private fields.
GtkSpellChecker * gtk_spell_checker_new ();
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", or "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. |
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]
|
#define GTK_SPELL_ERROR gtk_spell_error_quark()
Error domain used for gtkspell operations. Indicates that the error code will be in the GtkSpellError enumeration.
"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. |