SpellEntry

SpellEntry — GtkEntry with spell check

Functions

Properties

gboolean checked Read / Write

Signals

gboolean word-check Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkEntry
                ╰── SexySpellEntry

Includes

#include <libsexy3/sexy-spell-entry.h>

Description

Text entry widget with spell check. Enchant is used for the backend.

Functions

sexy_spell_entry_new ()

GtkWidget *
sexy_spell_entry_new (void);

Creates a new SexySpellEntry widget.

Returns

a new SexySpellEntry.

[transfer full]


sexy_spell_error_quark ()

GQuark
sexy_spell_error_quark (void);

sexy_spell_entry_get_languages ()

GSList *
sexy_spell_entry_get_languages (const SexySpellEntry *entry);

Retrieve a list of language codes for which dictionaries are available.

Parameters

entry

A SexySpellEntry.

 

Returns

a new GList object, or NULL on error. Should be freed with g_slist_free_full() and g_free().

[transfer full][element-type utf8]


sexy_spell_entry_get_language_name ()

gchar *
sexy_spell_entry_get_language_name (const SexySpellEntry *entry,
                                    const gchar *lang);

Get a friendly name for a given locale.

Parameters

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().

[transfer full]


sexy_spell_entry_language_is_active ()

gboolean
sexy_spell_entry_language_is_active (const SexySpellEntry *entry,
                                     const gchar *lang);

Determine if a given language is currently active.

Parameters

entry

A SexySpellEntry.

 

lang

The language to use, in a form enchant understands.

 

Returns

TRUE if the language is active.


sexy_spell_entry_activate_language ()

gboolean
sexy_spell_entry_activate_language (SexySpellEntry *entry,
                                    const gchar *lang,
                                    GError **error);

Activate spell checking for the language specifed.

Parameters

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.


sexy_spell_entry_deactivate_language ()

void
sexy_spell_entry_deactivate_language (SexySpellEntry *entry,
                                      const gchar *lang);

Deactivate spell checking for the language specifed.

Parameters

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.

 

sexy_spell_entry_set_active_languages ()

gboolean
sexy_spell_entry_set_active_languages (SexySpellEntry *entry,
                                       GSList *langs,
                                       GError **error);

Activate spell checking for only the languages specified.

Parameters

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.

[element-type utf8]

error

Return location for error.

 

Returns

FALSE if there was an error.


sexy_spell_entry_get_active_languages ()

GSList *
sexy_spell_entry_get_active_languages (SexySpellEntry *entry);

Retrieve a list of the currently active languages.

Parameters

entry

A SexySpellEntry

 

Returns

A list of language codes ("en", "de_DE", etc). The list should be freed with g_slist_free_full() and g_free().

[transfer full][element-type utf8]


sexy_spell_entry_is_checked ()

gboolean
sexy_spell_entry_is_checked (SexySpellEntry *entry);

sexy_spell_entry_is_checked has been deprecated since version 1.0 and should not be used in newly-written code.

Queries a SexySpellEntry and returns whether the entry has spell-checking enabled. Use sexy_spell_entry_get_checked() instead.

Parameters

entry

A SexySpellEntry.

 

Returns

TRUE if the entry has spell-checking enabled.


sexy_spell_entry_get_checked ()

gboolean
sexy_spell_entry_get_checked (SexySpellEntry *entry);

Queries a SexySpellEntry and returns whether the entry has spell-checking enabled.

Parameters

entry

A SexySpellEntry.

 

Returns

TRUE if the entry has spell-checking enabled.


sexy_spell_entry_set_checked ()

void
sexy_spell_entry_set_checked (SexySpellEntry *entry,
                              gboolean checked);

Sets whether the entry has spell-checking enabled.

Parameters

entry

A SexySpellEntry.

 

checked

Whether to enable spell-checking

 

sexy_spell_entry_activate_default_languages ()

void
sexy_spell_entry_activate_default_languages
                               (SexySpellEntry *entry);

Activate spell checking for languages specified in the $LANG or $LANGUAGE environment variables. If none is found it defaults to "en". These languages are activated by default, so this function need only be called if they were previously deactivated.

Parameters

entry

A SexySpellEntry.

 

Types and Values

SEXY_SPELL_ERROR

#define             SEXY_SPELL_ERROR

enum SexySpellError

Type of error.

Members

SEXY_SPELL_ERROR_BACKEND

Error occured in enchant when calling sexy_spell_entry_activate_language() or sexy_spell_entry_set_active_languages().

 

SexySpellEntryPriv

typedef struct _SexySpellEntryPriv SexySpellEntryPriv;

Property Details

The “checked” property

  “checked”                  gboolean

If checking of spelling is enabled.

Flags: Read / Write

Default value: TRUE

Since 1.0

Signal Details

The “word-check” signal

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.

Parameters

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.

Flags: Run Last

See Also

GtkEntry