![]() |
![]() |
![]() |
libsexy Reference Manual | ![]() |
---|
SexySpellEntrySexySpellEntry — A GtkEntry with inline spell checking. |
SexySpellEntry; GtkWidget* sexy_spell_entry_new (void); GSList* sexy_spell_entry_get_languages (const SexySpellEntry *entry); gchar* sexy_spell_entry_get_language_name (const SexySpellEntry *entry, const gchar *lang); gboolean sexy_spell_entry_language_is_active (const SexySpellEntry *entry, const gchar *lang); gboolean sexy_spell_entry_activate_language (SexySpellEntry *entry, const gchar *lang, GError **error); void sexy_spell_entry_deactivate_language (SexySpellEntry *entry, const gchar *lang); gboolean sexy_spell_entry_set_active_languages (SexySpellEntry *entry, GSList *langs, GError **error); GSList* sexy_spell_entry_get_active_languages (SexySpellEntry *entry); gboolean sexy_spell_entry_is_checked (SexySpellEntry *entry); void sexy_spell_entry_set_checked (SexySpellEntry *entry, gboolean checked); void sexy_spell_entry_activate_default_languages (SexySpellEntry *entry);
SexySpellEntry implements AtkImplementorIface, GtkEditable and GtkCellEditable.
"word-check" gboolean user_function (SexySpellEntry *entry, gchar *word, gpointer user_data);
SexySpellEntry is a GtkEntry with inline spell checking. This makes use of Enchant and allows the user to see what they've typed wrong as they type it. A right-click menu is provided for misspelled words offering suggestions.
typedef struct _SexySpellEntry SexySpellEntry;
The SexySpellEntry struct contains private data only, and should be manipulated using the functions below.
GtkWidget* sexy_spell_entry_new (void);
Creates a new SexySpellEntry widget.
Returns : | a new SexySpellEntry. |
GSList* sexy_spell_entry_get_languages (const SexySpellEntry *entry);
Retrieve a list of language codes for which dictionaries are available.
entry : |
A SexySpellEntry. |
Returns : | a new GList object, or NULL on error.
|
gchar* sexy_spell_entry_get_language_name (const SexySpellEntry *entry, const gchar *lang);
Get a friendly name for a given locale.
entry : |
A SexySpellEntry. |
lang : |
The language code to lookup a friendly name for. |
Returns : | The name of the locale. Should be freed with g_free()
|
gboolean sexy_spell_entry_language_is_active (const SexySpellEntry *entry, const gchar *lang);
Determine if a given language is currently active.
entry : |
A SexySpellEntry. |
lang : |
The language to use, in a form enchant understands. |
Returns : | TRUE if the language is active. |
gboolean sexy_spell_entry_activate_language (SexySpellEntry *entry, const gchar *lang, GError **error);
Activate spell checking for the language specifed.
entry : |
A SexySpellEntry |
lang : |
The language to use in a form Enchant understands. Typically either a two letter language code or a locale code in the form xx_XX. |
error : |
Return location for error. |
Returns : | FALSE if there was an error. |
void sexy_spell_entry_deactivate_language (SexySpellEntry *entry, const gchar *lang);
Deactivate spell checking for the language specifed.
entry : |
A SexySpellEntry. |
lang : |
The language in a form Enchant understands. Typically either a two letter language code or a locale code in the form xx_XX. |
gboolean sexy_spell_entry_set_active_languages (SexySpellEntry *entry, GSList *langs, GError **error);
Activate spell checking for only the languages specified.
entry : |
A SexySpellEntry |
langs : |
A list of language codes to activate, in a form Enchant understands. Typically either a two letter language code or a locale code in the form xx_XX. |
error : |
Return location for error. |
Returns : | FALSE if there was an error. |
GSList* sexy_spell_entry_get_active_languages (SexySpellEntry *entry);
Retrieve a list of the currently active languages.
entry : |
A SexySpellEntry |
Returns : | A GSList of char* values with language codes (en, fr, etc). Both the data and the list must be freed by the user. |
gboolean sexy_spell_entry_is_checked (SexySpellEntry *entry);
Queries a SexySpellEntry and returns whether the entry has spell-checking enabled.
entry : |
A SexySpellEntry. |
Returns : | TRUE if the entry has spell-checking enabled. |
void sexy_spell_entry_set_checked (SexySpellEntry *entry, gboolean checked);
Sets whether the entry has spell-checking enabled.
entry : |
A SexySpellEntry. |
checked : |
Whether to enable spell-checking |
void sexy_spell_entry_activate_default_languages (SexySpellEntry *entry);
Activate spell checking for languages specified in the $LANG or $LANGUAGE environment variables. These languages are activated by default, so this function need only be called if they were previously deactivated.
entry : |
A SexySpellEntry. |
gboolean user_function (SexySpellEntry *entry, gchar *word, gpointer user_data);
The ::word-check signal is emitted whenever the entry has to check a word. This allows the application to mark words as correct even if none of the active dictionaries contain it, such as nicknames in a chat client.
entry : |
The entry on which the signal is emitted. |
word : |
The word to check. |
user_data : |
user data set when the signal handler was connected. |
Returns : | FALSE to indicate that the word should be marked as
correct.
|
<< libsexy | SexyUrlLabel >> |