LibreOffice Module lingucomponent (master)  1
Classes | Public Member Functions | Static 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
 

Static Public Member Functions

static OUString getImplementationName_Static () throw ()
 
static Sequence< OUString > getSupportedServiceNames_Static () throw ()
 

Private Member Functions

 SpellChecker (const SpellChecker &)=delete
 
SpellCheckeroperator= (const SpellChecker &)=delete
 
linguistic::PropertyHelper_SpellingGetPropHelper_Impl ()
 
linguistic::PropertyHelper_SpellingGetPropHelper ()
 
sal_Int16 GetSpellFailure (const OUString &rWord, const Locale &rLocale)
 
Reference< XSpellAlternatives > GetProposals (const OUString &rWord, const Locale &rLocale)
 

Private Attributes

std::vector< DictItemm_DictItems
 
Sequence< Localem_aSuppLocales
 
::comphelper::OInterfaceContainerHelper2 m_aEvtListeners
 
std::unique_ptr< linguistic::PropertyHelper_Spellingm_pPropHelper
 
bool m_bDisposing
 

Detailed Description

Definition at line 46 of file sspellimp.hxx.

Constructor & Destructor Documentation

SpellChecker::SpellChecker ( const SpellChecker )
privatedelete
SpellChecker::SpellChecker ( )

Definition at line 78 of file sspellimp.cxx.

References GetLinguMutex().

Referenced by SpellChecker_CreateInstance().

SpellChecker::~SpellChecker ( )
overridevirtual

Definition at line 91 of file sspellimp.cxx.

References m_pPropHelper.

Member Function Documentation

void SAL_CALL SpellChecker::addEventListener ( const Reference< XEventListener > &  rxListener)
overridevirtual
sal_Bool SAL_CALL SpellChecker::addLinguServiceEventListener ( const Reference< XLinguServiceEventListener > &  rxLstnr)
overridevirtual
void SAL_CALL SpellChecker::dispose ( void  )
overridevirtual
OUString SAL_CALL SpellChecker::getImplementationName ( )
overridevirtual

Definition at line 628 of file sspellimp.cxx.

References getImplementationName_Static().

OUString SpellChecker::getImplementationName_Static ( )
throw (
)
inlinestatic

Definition at line 123 of file sspellimp.hxx.

Referenced by getImplementationName(), and spell_component_getFactory().

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 111 of file sspellimp.cxx.

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

Referenced by hasLocale().

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

after a reference is established

Definition at line 99 of file sspellimp.cxx.

References GetLinguProperties(), and m_pPropHelper.

Referenced by GetPropHelper().

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

Definition at line 423 of file sspellimp.cxx.

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

Referenced by spell().

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

Definition at line 562 of file sspellimp.cxx.

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

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

Definition at line 253 of file sspellimp.cxx.

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

Referenced by isValid().

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

Definition at line 638 of file sspellimp.cxx.

References getSupportedServiceNames_Static().

Sequence< OUString > SpellChecker::getSupportedServiceNames_Static ( )
throw (
)
static

Definition at line 643 of file sspellimp.cxx.

References SN_SPELLCHECKER.

Referenced by getSupportedServiceNames(), and spell_component_getFactory().

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

Definition at line 234 of file sspellimp.cxx.

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

Referenced by isValid(), and spell().

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 568 of file sspellimp.cxx.

References GetLinguMutex(), and m_pPropHelper.

sal_Bool SAL_CALL SpellChecker::isValid ( const OUString &  rWord,
const Locale rLocale,
const css::uno::Sequence< css::beans::PropertyValue > &  rProperties 
)
overridevirtual
SpellChecker& SpellChecker::operator= ( const SpellChecker )
privatedelete
void SAL_CALL SpellChecker::removeEventListener ( const Reference< XEventListener > &  rxListener)
overridevirtual
sal_Bool SAL_CALL SpellChecker::removeLinguServiceEventListener ( const Reference< XLinguServiceEventListener > &  rxLstnr)
overridevirtual
Reference< XSpellAlternatives > SAL_CALL SpellChecker::spell ( const OUString &  rWord,
const Locale rLocale,
const css::uno::Sequence< css::beans::PropertyValue > &  rProperties 
)
overridevirtual

Definition at line 507 of file sspellimp.cxx.

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

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

Definition at line 633 of file sspellimp.cxx.

References cppu::supportsService().

Member Data Documentation

::comphelper::OInterfaceContainerHelper2 SpellChecker::m_aEvtListeners
private

Definition at line 71 of file sspellimp.hxx.

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

Sequence< Locale > SpellChecker::m_aSuppLocales
private

Definition at line 69 of file sspellimp.hxx.

Referenced by getLocales(), and hasLocale().

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

Definition at line 67 of file sspellimp.hxx.

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

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

Definition at line 72 of file sspellimp.hxx.

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


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