LibreOffice Module lingucomponent (master) 1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
SpellChecker Class Reference

#include <sspellimp.hxx>

Inheritance diagram for SpellChecker:
[legend]
Collaboration diagram for SpellChecker:
[legend]

Classes

struct  DictItem
 

Public Member Functions

 SpellChecker ()
 
virtual ~SpellChecker () override
 
virtual Sequence< Locale > SAL_CALL getLocales () override
 
virtual sal_Bool SAL_CALL hasLocale (const Locale &rLocale) override
 
virtual sal_Bool SAL_CALL isValid (const OUString &rWord, const Locale &rLocale, const css::uno::Sequence< css::beans::PropertyValue > &rProperties) override
 
virtual Reference< XSpellAlternatives > SAL_CALL spell (const OUString &rWord, const Locale &rLocale, const css::uno::Sequence< css::beans::PropertyValue > &rProperties) override
 
virtual sal_Bool SAL_CALL addLinguServiceEventListener (const Reference< XLinguServiceEventListener > &rxLstnr) override
 
virtual sal_Bool SAL_CALL removeLinguServiceEventListener (const Reference< XLinguServiceEventListener > &rxLstnr) override
 
virtual OUString SAL_CALL getServiceDisplayName (const Locale &rLocale) override
 
virtual void SAL_CALL initialize (const Sequence< Any > &rArguments) override
 
virtual void SAL_CALL dispose () override
 
virtual void SAL_CALL addEventListener (const Reference< XEventListener > &rxListener) override
 
virtual void SAL_CALL removeEventListener (const Reference< XEventListener > &rxListener) override
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &rServiceName) override
 
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 

Private Member Functions

 SpellChecker (const SpellChecker &)=delete
 
SpellCheckeroperator= (const SpellChecker &)=delete
 
linguistic::PropertyHelper_Spelling & GetPropHelper_Impl ()
 
linguistic::PropertyHelper_Spelling & GetPropHelper ()
 
sal_Int16 GetSpellFailure (const OUString &rWord, const Locale &rLocale, int &rInfo)
 
Reference< XSpellAlternatives > GetProposals (const OUString &rWord, const Locale &rLocale)
 

Private Attributes

std::vector< DictItemm_DictItems
 
Sequence< Localem_aSuppLocales
 
::comphelper::OInterfaceContainerHelper3< XEventListener > m_aEvtListeners
 
std::unique_ptr< linguistic::PropertyHelper_Spelling > m_pPropHelper
 
bool m_bDisposing
 

Detailed Description

Definition at line 44 of file sspellimp.hxx.

Constructor & Destructor Documentation

◆ SpellChecker() [1/2]

SpellChecker::SpellChecker ( const SpellChecker )
privatedelete

◆ SpellChecker() [2/2]

SpellChecker::SpellChecker ( )

Definition at line 74 of file sspellimp.cxx.

References GetLinguMutex().

Referenced by lingucomponent_SpellChecker_get_implementation().

◆ ~SpellChecker()

SpellChecker::~SpellChecker ( )
overridevirtual

Definition at line 87 of file sspellimp.cxx.

References m_pPropHelper.

Member Function Documentation

◆ addEventListener()

void SAL_CALL SpellChecker::addEventListener ( const Reference< XEventListener > &  rxListener)
overridevirtual

◆ addLinguServiceEventListener()

sal_Bool SAL_CALL SpellChecker::addLinguServiceEventListener ( const Reference< XLinguServiceEventListener > &  rxLstnr)
overridevirtual

Definition at line 533 of file sspellimp.cxx.

References GetLinguMutex(), GetPropHelper(), and m_bDisposing.

◆ dispose()

void SAL_CALL SpellChecker::dispose ( void  )
overridevirtual

◆ getImplementationName()

OUString SAL_CALL SpellChecker::getImplementationName ( )
overridevirtual

Definition at line 625 of file sspellimp.cxx.

◆ getLocales()

Sequence< Locale > SAL_CALL SpellChecker::getLocales ( )
overridevirtual

! for compatibility with old dictionaries (the ones not using extensions ! or new configuration entries, but still using the dictionary.lst file) ! Get the list of old style spell checking dictionaries to use...

For each dictionary and each locale we need a separate entry. If this results in more than one dictionary per locale than (for now) it is undefined which dictionary gets used. In the future the implementation should support using several dictionaries for one locale.

Definition at line 107 of file sspellimp.cxx.

References SvtLinguConfigDictionaryEntry::aLocaleNames, SvtLinguConfigDictionaryEntry::aLocations, LanguageTag::convertToLocale(), DBG_ASSERT, SvtLinguConfig::GetActiveDictionariesByFormat(), GetLinguMutex(), GetOldStyleDics(), comphelper::getProcessServiceFactory(), SvtLinguConfig::GetSupportedDictionaryFormatsFor(), comphelper::LibreOfficeKit::isAllowlistedLanguage(), m_aSuppLocales, m_DictItems, MergeNewStyleDicsAndOldStyleDics(), nPos, SAL_WARN, and SAL_WARN_IF.

Referenced by hasLocale().

◆ GetPropHelper()

linguistic::PropertyHelper_Spelling & SpellChecker::GetPropHelper ( )
inlineprivate

◆ GetPropHelper_Impl()

PropertyHelper_Spelling & SpellChecker::GetPropHelper_Impl ( )
private

after a reference is established

Definition at line 95 of file sspellimp.cxx.

References GetLinguProperties(), and m_pPropHelper.

Referenced by GetPropHelper().

◆ GetProposals()

Reference< XSpellAlternatives > SpellChecker::GetProposals ( const OUString &  rWord,
const Locale rLocale 
)
private

Definition at line 429 of file sspellimp.cxx.

References aStr, count, LinguLocaleToLanguage(), m_DictItems, n, OU2ENC, size, and u.

Referenced by spell().

◆ getServiceDisplayName()

OUString SAL_CALL SpellChecker::getServiceDisplayName ( const Locale rLocale)
overridevirtual

Definition at line 559 of file sspellimp.cxx.

References Translate::Create(), and Translate::get().

◆ GetSpellFailure()

sal_Int16 SpellChecker::GetSpellFailure ( const OUString &  rWord,
const Locale rLocale,
int rInfo 
)
private

Definition at line 246 of file sspellimp.cxx.

References aBuf, DBG_ASSERT, getTextEncodingFromCharset(), m_DictItems, MAXWORDLEN, n, OU2ENC, OUStringToOString(), and u.

Referenced by isValid().

◆ getSupportedServiceNames()

Sequence< OUString > SAL_CALL SpellChecker::getSupportedServiceNames ( )
overridevirtual

Definition at line 635 of file sspellimp.cxx.

References SN_SPELLCHECKER.

◆ hasLocale()

sal_Bool SAL_CALL SpellChecker::hasLocale ( const Locale rLocale)
overridevirtual

Definition at line 227 of file sspellimp.cxx.

References GetLinguMutex(), getLocales(), and m_aSuppLocales.

Referenced by isValid(), and spell().

◆ initialize()

void SAL_CALL SpellChecker::initialize ( const Sequence< Any > &  rArguments)
overridevirtual

Pointer allows for access of the non-UNO functions. And the reference to the UNO-functions while increasing the ref-count and will implicitly free the memory when the object is no longer used.

after a reference is established

Definition at line 565 of file sspellimp.cxx.

References GetLinguMutex(), and m_pPropHelper.

◆ isValid()

sal_Bool SAL_CALL SpellChecker::isValid ( const OUString &  rWord,
const Locale rLocale,
const css::uno::Sequence< css::beans::PropertyValue > &  rProperties 
)
overridevirtual

◆ operator=()

SpellChecker & SpellChecker::operator= ( const SpellChecker )
privatedelete

◆ removeEventListener()

void SAL_CALL SpellChecker::removeEventListener ( const Reference< XEventListener > &  rxListener)
overridevirtual

◆ removeLinguServiceEventListener()

sal_Bool SAL_CALL SpellChecker::removeLinguServiceEventListener ( const Reference< XLinguServiceEventListener > &  rxLstnr)
overridevirtual

Definition at line 546 of file sspellimp.cxx.

References GetLinguMutex(), GetPropHelper(), and m_bDisposing.

◆ spell()

Reference< XSpellAlternatives > SAL_CALL SpellChecker::spell ( const OUString &  rWord,
const Locale rLocale,
const css::uno::Sequence< css::beans::PropertyValue > &  rProperties 
)
overridevirtual

Definition at line 513 of file sspellimp.cxx.

References GetLinguMutex(), GetProposals(), hasLocale(), isValid(), and Locale.

◆ supportsService()

sal_Bool SAL_CALL SpellChecker::supportsService ( const OUString &  rServiceName)
overridevirtual

Definition at line 630 of file sspellimp.cxx.

References ServiceName, and cppu::supportsService().

Member Data Documentation

◆ m_aEvtListeners

::comphelper::OInterfaceContainerHelper3<XEventListener> SpellChecker::m_aEvtListeners
private

Definition at line 69 of file sspellimp.hxx.

Referenced by addEventListener(), dispose(), and removeEventListener().

◆ m_aSuppLocales

Sequence< Locale > SpellChecker::m_aSuppLocales
private

Definition at line 67 of file sspellimp.hxx.

Referenced by getLocales(), and hasLocale().

◆ m_bDisposing

bool SpellChecker::m_bDisposing
private

◆ m_DictItems

std::vector<DictItem> SpellChecker::m_DictItems
private

Definition at line 65 of file sspellimp.hxx.

Referenced by getLocales(), GetProposals(), and GetSpellFailure().

◆ m_pPropHelper

std::unique_ptr<linguistic::PropertyHelper_Spelling> SpellChecker::m_pPropHelper
private

Definition at line 70 of file sspellimp.hxx.

Referenced by dispose(), GetPropHelper(), GetPropHelper_Impl(), initialize(), and ~SpellChecker().


The documentation for this class was generated from the following files: