Documentation ¶
Index ¶
- Variables
- func Init()
- type Checker
- func (self *Checker) AddWord(word string)
- func (self *Checker) CheckWord(word string) bool
- func (self *Checker) ExtraWordChars() string
- func (self *Checker) IgnoreWord(word string)
- func (self *Checker) Language() string
- func (self *Checker) ListCorrections(word string) []string
- func (self *Checker) Provider() Providerer
- func (self *Checker) SetLanguage(language string)
- type CheckerClass
- type CheckerOverrides
- type Dictionarier
- type Dictionary
- type Language
- type LanguageClass
- type LanguageOverrides
- type Provider
- type Providerer
- type TextBufferAdapter
- func (self *TextBufferAdapter) Buffer() *gtksource.Buffer
- func (self *TextBufferAdapter) Checker() *Checker
- func (self *TextBufferAdapter) Enabled() bool
- func (self *TextBufferAdapter) InvalidateAll()
- func (self *TextBufferAdapter) Language() string
- func (self *TextBufferAdapter) MenuModel() gio.MenuModeller
- func (self *TextBufferAdapter) SetChecker(checker *Checker)
- func (self *TextBufferAdapter) SetEnabled(enabled bool)
- func (self *TextBufferAdapter) SetLanguage(language string)
- func (self *TextBufferAdapter) Tag() *gtk.TextTag
- func (self *TextBufferAdapter) UpdateCorrections()
- type TextBufferAdapterClass
- type TextBufferAdapterOverrides
Constants ¶
This section is empty.
Variables ¶
var (
GTypeChecker = coreglib.Type(C.spelling_checker_get_type())
)
GType values.
var (
GTypeDictionary = coreglib.Type(C.spelling_dictionary_get_type())
)
GType values.
var (
GTypeLanguage = coreglib.Type(C.spelling_language_get_type())
)
GType values.
var (
GTypeProvider = coreglib.Type(C.spelling_provider_get_type())
)
GType values.
var (
GTypeTextBufferAdapter = coreglib.Type(C.spelling_text_buffer_adapter_get_type())
)
GType values.
Functions ¶
Types ¶
type Checker ¶
Checker: SpellingChecker is the core class of libspelling. It provides high-level APIs for spellchecking.
func CheckerGetDefault ¶
func CheckerGetDefault() *Checker
CheckerGetDefault gets a default SpellingChecker using the default provider and language.
The function returns the following values:
- checker: SpellingChecker.
func NewChecker ¶
func NewChecker(provider Providerer, language string) *Checker
NewChecker: create a new SpellingChecker.
The function takes the following parameters:
- provider
- language
The function returns the following values:
- checker: newly created SpellingChecker.
func (*Checker) AddWord ¶
AddWord adds word to the active dictionary.
The function takes the following parameters:
- word to be added.
func (*Checker) CheckWord ¶
CheckWord checks if the active dictionary contains word.
The function takes the following parameters:
- word to be checked.
The function returns the following values:
- ok: TRUE if the dictionary contains the word.
func (*Checker) ExtraWordChars ¶
ExtraWordChars gets the extra word characters of the active dictionary.
The function returns the following values:
- utf8: extra word characters.
func (*Checker) IgnoreWord ¶
IgnoreWord requests the active dictionary to ignore word.
The function takes the following parameters:
- word to be ignored.
func (*Checker) Language ¶
Language gets the language being used by the spell checker.
The function returns the following values:
- utf8 (optional): string describing the current language.
func (*Checker) ListCorrections ¶
ListCorrections retrieves a list of possible corrections for word.
The function takes the following parameters:
- word to be checked.
The function returns the following values:
- utf8s (optional): A list of possible corrections, or NULL.
func (*Checker) Provider ¶
func (self *Checker) Provider() Providerer
Provider gets the spell provider used by the spell checker.
Currently, only Enchant-2 is supported.
The function returns the following values:
- provider: SpellingProvider.
func (*Checker) SetLanguage ¶
SetLanguage sets the language code to use when communicating with the provider, such as en_US.
The function takes the following parameters:
- language to use.
type CheckerClass ¶
type CheckerClass struct {
// contains filtered or unexported fields
}
CheckerClass: instance of this type is always passed by reference.
type CheckerOverrides ¶
type CheckerOverrides struct { }
CheckerOverrides contains methods that are overridable.
type Dictionarier ¶
Dictionarier describes types inherited from class Dictionary.
To get the original type, the caller must assert this to an interface or another type.
type Dictionary ¶
Dictionary: abstract base class for spellchecking dictionaries.
func BaseDictionary ¶
func BaseDictionary(obj Dictionarier) *Dictionary
BaseDictionary returns the underlying base object.
func (*Dictionary) AddWord ¶
func (self *Dictionary) AddWord(word string)
AddWord adds word to the dictionary.
The function takes the following parameters:
- word to be added.
func (*Dictionary) Code ¶
func (self *Dictionary) Code() string
Code gets the language code of the dictionary, or NULL if undefined.
The function returns the following values:
- utf8 (optional): language code of the dictionary.
func (*Dictionary) ContainsWord ¶
func (self *Dictionary) ContainsWord(word string) bool
ContainsWord checks if the dictionary contains word.
The function takes the following parameters:
- word to be checked.
The function returns the following values:
- ok: TRUE if the dictionary contains the word.
func (*Dictionary) ExtraWordChars ¶
func (self *Dictionary) ExtraWordChars() string
ExtraWordChars gets the extra word characters of the dictionary.
The function returns the following values:
- utf8: extra word characters.
func (*Dictionary) IgnoreWord ¶
func (self *Dictionary) IgnoreWord(word string)
IgnoreWord requests the dictionary to ignore word.
The function takes the following parameters:
- word to be ignored.
func (*Dictionary) ListCorrections ¶
func (self *Dictionary) ListCorrections(word string) []string
ListCorrections retrieves a list of possible corrections for word.
The function takes the following parameters:
- word to be checked.
The function returns the following values:
- utf8s (optional): A list of possible corrections, or NULL.
type Language ¶
Language represents a spellchecking language.
func (*Language) Code ¶
Code gets the code of the language, or NULL if undefined.
The function returns the following values:
- utf8 (optional): code of the language.
type LanguageClass ¶
type LanguageClass struct {
// contains filtered or unexported fields
}
LanguageClass: instance of this type is always passed by reference.
type LanguageOverrides ¶
type LanguageOverrides struct { }
LanguageOverrides contains methods that are overridable.
type Provider ¶
Provider: abstract base class for spellchecking providers.
func BaseProvider ¶
func BaseProvider(obj Providerer) *Provider
BaseProvider returns the underlying base object.
func (*Provider) DefaultCode ¶
DefaultCode gets the default language code for the detected system locales, or NULL if the provider doesn't support any of them.
The function returns the following values:
- utf8 (optional): default language code.
func (*Provider) DisplayName ¶
DisplayName gets the display name of the provider, or NULL if undefined.
The function returns the following values:
- utf8 (optional): display name of the provider.
func (*Provider) ListLanguages ¶
func (self *Provider) ListLanguages() *gio.ListModel
ListLanguages gets a GListModel of languages supported by the provider.
The function returns the following values:
- listModel: GListModel of SpellingLanguage.
func (*Provider) LoadDictionary ¶
func (self *Provider) LoadDictionary(language string) Dictionarier
LoadDictionary gets a SpellingDictionary for the requested language, or NULL if the language is not supported.
The function takes the following parameters:
- language to load such as en_US.
The function returns the following values:
- dictionary (optional): SpellingDictionary or NULL.
func (*Provider) SupportsLanguage ¶
SupportsLanguage checks of language is supported by the provider.
The function takes the following parameters:
- language such as en_US.
The function returns the following values:
- ok: TRUE if language is supported, otherwise FALSE.
type Providerer ¶
Providerer describes types inherited from class Provider.
To get the original type, the caller must assert this to an interface or another type.
func ProviderGetDefault ¶
func ProviderGetDefault() Providerer
ProviderGetDefault gets the default spell provider.
The function returns the following values:
- provider: SpellingProvider.
type TextBufferAdapter ¶
type TextBufferAdapter struct { *coreglib.Object gio.ActionGroup // contains filtered or unexported fields }
TextBufferAdapter: SpellingTextBufferAdapter implements helpers to easily add spellchecking capabilities to a GtkSourceBuffer.
func NewTextBufferAdapter ¶
func NewTextBufferAdapter(buffer *gtksource.Buffer, checker *Checker) *TextBufferAdapter
NewTextBufferAdapter: create a new SpellingTextBufferAdapter.
The function takes the following parameters:
- buffer: GtkSourceBuffer.
- checker: SpellingChecker.
The function returns the following values:
- textBufferAdapter: newly created SpellingTextBufferAdapter.
func (*TextBufferAdapter) Buffer ¶
func (self *TextBufferAdapter) Buffer() *gtksource.Buffer
Buffer gets the underlying buffer for the adapter.
The function returns the following values:
- buffer (optional): GtkSourceBuffer.
func (*TextBufferAdapter) Checker ¶
func (self *TextBufferAdapter) Checker() *Checker
Checker gets the checker used by the adapter.
The function returns the following values:
- checker (optional): SpellingChecker or NULL.
func (*TextBufferAdapter) Enabled ¶
func (self *TextBufferAdapter) Enabled() bool
Enabled gets if the spellcheck is enabled.
The function returns the following values:
- ok: TRUE if enabled.
func (*TextBufferAdapter) InvalidateAll ¶
func (self *TextBufferAdapter) InvalidateAll()
InvalidateAll: invalidate the spelling engine, to force parsing again.
Invalidation is automatically done on gtksource.Buffer:loading change.
func (*TextBufferAdapter) Language ¶
func (self *TextBufferAdapter) Language() string
Language gets the checker language.
The function returns the following values:
- utf8 (optional): language code.
func (*TextBufferAdapter) MenuModel ¶
func (self *TextBufferAdapter) MenuModel() gio.MenuModeller
MenuModel gets the menu model containing corrections.
The function returns the following values:
- menuModel: GMenuModel.
func (*TextBufferAdapter) SetChecker ¶
func (self *TextBufferAdapter) SetChecker(checker *Checker)
SetChecker: set the spelling.Checker used for spellchecking.
The function takes the following parameters:
- checker: SpellingChecker.
func (*TextBufferAdapter) SetEnabled ¶
func (self *TextBufferAdapter) SetEnabled(enabled bool)
SetEnabled: if TRUE spellcheck is enabled.
The function takes the following parameters:
- enabled: whether the spellcheck is enabled.
func (*TextBufferAdapter) SetLanguage ¶
func (self *TextBufferAdapter) SetLanguage(language string)
SetLanguage sets the language code to use by the checker, such as en_US.
The function takes the following parameters:
- language to use.
func (*TextBufferAdapter) Tag ¶
func (self *TextBufferAdapter) Tag() *gtk.TextTag
Tag gets the tag used for potentially misspelled words.
The function returns the following values:
- textTag (optional): GtkTextTag or NULL.
func (*TextBufferAdapter) UpdateCorrections ¶
func (self *TextBufferAdapter) UpdateCorrections()
UpdateCorrections looks at the current cursor position and updates the list of corrections based on the current word.
Use this to force an update immediately rather than after the automatic timeout caused by cursor movements.
type TextBufferAdapterClass ¶
type TextBufferAdapterClass struct {
// contains filtered or unexported fields
}
TextBufferAdapterClass: instance of this type is always passed by reference.
type TextBufferAdapterOverrides ¶
type TextBufferAdapterOverrides struct { }
TextBufferAdapterOverrides contains methods that are overridable.