Top |
Known Implementations
GspellLanguageChooser is implemented by GspellLanguageChooserButton and GspellLanguageChooserDialog.
Description
GspellLanguageChooser is an interface that is implemented by widgets for choosing a GspellLanguage.
There are two properties: “language” and
“language-code”. They are kept in sync. The former is
useful, for example, to bind it to the GspellChecker's language property
with g_object_bind_property()
. The latter is useful to bind it to a
GSettings key with g_settings_bind()
.
When setting the language, NULL
or the empty string can be passed to pick
the default language. In that case, the “language-code”
property will contain the empty string, whereas the
“language” property will contain the actual
GspellLanguage as returned by gspell_language_get_default()
. If the user
launches the GspellLanguageChooser and chooses explicitly a language, then
the “language-code” property will no longer be empty,
even if it is the same language as the default language.
Note that if an explicit language (non-NULL
or not the empty string) is set
to the GspellLanguageChooser, then the “language-code”
property will not be empty, it will contain the language code of the passed
language, even if the language is the same as the default language.
Thus, a good default value for a GSettings key is the empty string. That way, the default language is picked, and can change depending on the locale. But once the user has chosen a language, that language is kept in the GSettings key.
Functions
gspell_language_chooser_get_language ()
const GspellLanguage *
gspell_language_chooser_get_language (GspellLanguageChooser *chooser
);
gspell_language_chooser_set_language ()
void gspell_language_chooser_set_language (GspellLanguageChooser *chooser
,const GspellLanguage *language
);
Sets the selected language.
gspell_language_chooser_get_language_code ()
const gchar *
gspell_language_chooser_get_language_code
(GspellLanguageChooser *chooser
);
gspell_language_chooser_set_language_code ()
void gspell_language_chooser_set_language_code (GspellLanguageChooser *chooser
,const gchar *language_code
);
Parameters
chooser |
||
language_code |
a language code, or the empty string or |
[nullable] |
Property Details
The “language”
property
“language” GspellLanguage *
The selected GspellLanguage.
Owner: GspellLanguageChooser
Flags: Read / Write
The “language-code”
property
“language-code” gchar *
The empty string if the default language was set and the selection hasn't changed. Or the language code if an explicit language was set or if the selection has changed.
Owner: GspellLanguageChooser
Flags: Read / Write
Default value: ""