Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / linguistic / source / lngprophelp.cxx
blob57483d062e5585fe7bc653a80687b9b08285b8e7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <tools/debug.hxx>
22 #include <sal/log.hxx>
24 #include <com/sun/star/linguistic2/LinguServiceEvent.hpp>
25 #include <com/sun/star/linguistic2/LinguServiceEventFlags.hpp>
26 #include <com/sun/star/linguistic2/XLinguServiceEventListener.hpp>
27 #include <com/sun/star/linguistic2/XLinguProperties.hpp>
28 #include <com/sun/star/beans/XPropertySet.hpp>
29 #include <osl/mutex.hxx>
30 #include <unotools/linguprops.hxx>
32 #include <linguistic/misc.hxx>
33 #include <linguistic/lngprops.hxx>
35 #include <linguistic/lngprophelp.hxx>
37 using namespace osl;
38 using namespace com::sun::star;
39 using namespace com::sun::star::beans;
40 using namespace com::sun::star::lang;
41 using namespace com::sun::star::uno;
42 using namespace com::sun::star::linguistic2;
43 using namespace linguistic;
46 namespace linguistic
50 PropertyChgHelper::PropertyChgHelper(
51 const Reference< XInterface > &rxSource,
52 Reference< XLinguProperties > const &rxPropSet,
53 int nAllowedEvents ) :
54 aPropNames ({UPN_IS_IGNORE_CONTROL_CHARACTERS, UPN_IS_USE_DICTIONARY_LIST}),
55 xMyEvtObj (rxSource),
56 aLngSvcEvtListeners (GetLinguMutex()),
57 xPropSet (rxPropSet),
58 nEvtFlags (nAllowedEvents)
60 SetDefaultValues();
63 PropertyChgHelper::~PropertyChgHelper()
67 void PropertyChgHelper::SetDefaultValues()
69 bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = true;
70 bResIsUseDictionaryList = bIsUseDictionaryList = true;
74 void PropertyChgHelper::GetCurrentValues()
76 const auto& rPropNames = GetPropNames();
77 if (!GetPropSet().is() || rPropNames.empty())
78 return;
80 for (const OUString& rPropName : rPropNames)
82 bool *pbVal = nullptr,
83 *pbResVal = nullptr;
85 if ( rPropName == UPN_IS_IGNORE_CONTROL_CHARACTERS )
87 pbVal = &bIsIgnoreControlCharacters;
88 pbResVal = &bResIsIgnoreControlCharacters;
90 else if ( rPropName == UPN_IS_USE_DICTIONARY_LIST )
92 pbVal = &bIsUseDictionaryList;
93 pbResVal = &bResIsUseDictionaryList;
96 if (pbVal && pbResVal)
98 GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal;
99 *pbResVal = *pbVal;
105 void PropertyChgHelper::SetTmpPropVals( const PropertyValues &rPropVals )
107 // return value is default value unless there is an explicitly supplied
108 // temporary value
109 bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters;
110 bResIsUseDictionaryList = bIsUseDictionaryList;
112 for (const PropertyValue& rVal : rPropVals)
114 bool *pbResVal = nullptr;
115 switch (rVal.Handle)
117 case UPH_IS_IGNORE_CONTROL_CHARACTERS :
118 pbResVal = &bResIsIgnoreControlCharacters; break;
119 case UPH_IS_USE_DICTIONARY_LIST :
120 pbResVal = &bResIsUseDictionaryList; break;
121 default:
124 if (pbResVal)
125 rVal.Value >>= *pbResVal;
130 bool PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt )
132 bool bRes = false;
134 if (GetPropSet().is() && rEvt.Source == GetPropSet())
136 sal_Int16 nLngSvcFlags = (nEvtFlags & AE_HYPHENATOR) ?
137 LinguServiceEventFlags::HYPHENATE_AGAIN : 0;
138 bool bSCWA = false, // SPELL_CORRECT_WORDS_AGAIN ?
139 bSWWA = false; // SPELL_WRONG_WORDS_AGAIN ?
141 bool *pbVal = nullptr;
142 switch (rEvt.PropertyHandle)
144 case UPH_IS_IGNORE_CONTROL_CHARACTERS :
146 pbVal = &bIsIgnoreControlCharacters;
147 nLngSvcFlags = 0;
148 break;
150 case UPH_IS_USE_DICTIONARY_LIST :
152 pbVal = &bIsUseDictionaryList;
153 bSCWA = bSWWA = true;
154 break;
157 if (pbVal)
158 rEvt.NewValue >>= *pbVal;
160 bRes = nullptr != pbVal; // sth changed?
161 if (bRes)
163 bool bSpellEvts = (nEvtFlags & AE_SPELLCHECKER);
164 if (bSCWA && bSpellEvts)
165 nLngSvcFlags |= LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN;
166 if (bSWWA && bSpellEvts)
167 nLngSvcFlags |= LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN;
168 if (nLngSvcFlags)
170 LinguServiceEvent aEvt( GetEvtObj(), nLngSvcFlags );
171 LaunchEvent( aEvt );
176 return bRes;
180 void SAL_CALL
181 PropertyChgHelper::propertyChange( const PropertyChangeEvent& rEvt )
183 MutexGuard aGuard( GetLinguMutex() );
184 propertyChange_Impl( rEvt );
188 void PropertyChgHelper::AddAsPropListener()
190 if (xPropSet.is())
192 for (const OUString& rPropName : std::as_const(aPropNames))
194 if (!rPropName.isEmpty())
195 xPropSet->addPropertyChangeListener( rPropName, this );
200 void PropertyChgHelper::RemoveAsPropListener()
202 if (xPropSet.is())
204 for (const OUString& rPropName : std::as_const(aPropNames))
206 if (!rPropName.isEmpty())
207 xPropSet->removePropertyChangeListener( rPropName, this );
213 void PropertyChgHelper::LaunchEvent( const LinguServiceEvent &rEvt )
215 aLngSvcEvtListeners.notifyEach( &XLinguServiceEventListener::processLinguServiceEvent, rEvt );
219 void SAL_CALL PropertyChgHelper::disposing( const EventObject& rSource )
221 MutexGuard aGuard( GetLinguMutex() );
222 if (rSource.Source == xPropSet)
224 RemoveAsPropListener();
225 xPropSet = nullptr;
226 aPropNames.clear();
231 sal_Bool SAL_CALL
232 PropertyChgHelper::addLinguServiceEventListener(
233 const Reference< XLinguServiceEventListener >& rxListener )
235 MutexGuard aGuard( GetLinguMutex() );
237 bool bRes = false;
238 if (rxListener.is())
240 sal_Int32 nCount = aLngSvcEvtListeners.getLength();
241 bRes = aLngSvcEvtListeners.addInterface( rxListener ) != nCount;
243 return bRes;
247 sal_Bool SAL_CALL
248 PropertyChgHelper::removeLinguServiceEventListener(
249 const Reference< XLinguServiceEventListener >& rxListener )
251 MutexGuard aGuard( GetLinguMutex() );
253 bool bRes = false;
254 if (rxListener.is())
256 sal_Int32 nCount = aLngSvcEvtListeners.getLength();
257 bRes = aLngSvcEvtListeners.removeInterface( rxListener ) != nCount;
259 return bRes;
263 PropertyHelper_Thes::PropertyHelper_Thes(
264 const Reference< XInterface > &rxSource,
265 Reference< XLinguProperties > const &rxPropSet ) :
266 PropertyChgHelper ( rxSource, rxPropSet, 0 )
268 SetDefaultValues();
269 GetCurrentValues();
273 PropertyHelper_Thes::~PropertyHelper_Thes()
278 void SAL_CALL
279 PropertyHelper_Thes::propertyChange( const PropertyChangeEvent& rEvt )
281 MutexGuard aGuard( GetLinguMutex() );
282 PropertyChgHelper::propertyChange_Impl( rEvt );
286 PropertyHelper_Spell::PropertyHelper_Spell(
287 const Reference< XInterface > & rxSource,
288 Reference< XLinguProperties > const &rxPropSet ) :
289 PropertyChgHelper ( rxSource, rxPropSet, AE_SPELLCHECKER )
291 auto& rPropNames = GetPropNames();
292 rPropNames.push_back(UPN_IS_SPELL_UPPER_CASE);
293 rPropNames.push_back(UPN_IS_SPELL_WITH_DIGITS);
294 rPropNames.push_back(UPN_IS_SPELL_CAPITALIZATION);
295 rPropNames.push_back(UPN_IS_SPELL_CLOSED_COMPOUND);
296 rPropNames.push_back(UPN_IS_SPELL_HYPHENATED_COMPOUND);
297 SetDefaultValues();
298 GetCurrentValues();
302 PropertyHelper_Spell::~PropertyHelper_Spell()
307 void PropertyHelper_Spell::SetDefaultValues()
309 PropertyChgHelper::SetDefaultValues();
311 bResIsSpellUpperCase = bIsSpellUpperCase = false;
312 bResIsSpellWithDigits = bIsSpellWithDigits = false;
313 bResIsSpellCapitalization = bIsSpellCapitalization = true;
314 bResIsSpellClosedCompound = bIsSpellClosedCompound = true;
315 bResIsSpellHyphenatedCompound = bIsSpellHyphenatedCompound = true;
319 void PropertyHelper_Spell::GetCurrentValues()
321 PropertyChgHelper::GetCurrentValues();
323 const auto& rPropNames = GetPropNames();
324 if (!GetPropSet().is() || rPropNames.empty())
325 return;
327 for (const OUString& rPropName : rPropNames)
329 bool *pbVal = nullptr,
330 *pbResVal = nullptr;
332 if ( rPropName == UPN_IS_SPELL_UPPER_CASE )
334 pbVal = &bIsSpellUpperCase;
335 pbResVal = &bResIsSpellUpperCase;
337 else if ( rPropName == UPN_IS_SPELL_WITH_DIGITS )
339 pbVal = &bIsSpellWithDigits;
340 pbResVal = &bResIsSpellWithDigits;
342 else if ( rPropName == UPN_IS_SPELL_CAPITALIZATION )
344 pbVal = &bIsSpellCapitalization;
345 pbResVal = &bResIsSpellCapitalization;
347 else if ( rPropName == UPN_IS_SPELL_CLOSED_COMPOUND )
349 pbVal = &bIsSpellClosedCompound;
350 pbResVal = &bResIsSpellClosedCompound;
352 else if ( rPropName == UPN_IS_SPELL_HYPHENATED_COMPOUND )
354 pbVal = &bIsSpellHyphenatedCompound;
355 pbResVal = &bResIsSpellHyphenatedCompound;
358 if (pbVal && pbResVal)
360 GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal;
361 *pbResVal = *pbVal;
367 bool PropertyHelper_Spell::propertyChange_Impl( const PropertyChangeEvent& rEvt )
369 bool bRes = PropertyChgHelper::propertyChange_Impl( rEvt );
371 if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet())
373 bool bSCWA = false, // SPELL_CORRECT_WORDS_AGAIN ?
374 bSWWA = false; // SPELL_WRONG_WORDS_AGAIN ?
376 bool *pbVal = nullptr;
377 switch (rEvt.PropertyHandle)
379 case UPH_IS_SPELL_UPPER_CASE :
381 pbVal = &bIsSpellUpperCase;
382 bSCWA = ! *pbVal; // sal_False->sal_True change?
383 bSWWA = !bSCWA; // sal_True->sal_False change?
384 break;
386 case UPH_IS_SPELL_WITH_DIGITS :
388 pbVal = &bIsSpellWithDigits;
389 bSCWA = ! *pbVal; // sal_False->sal_True change?
390 bSWWA = !bSCWA; // sal_True->sal_False change?
391 break;
393 case UPH_IS_SPELL_CAPITALIZATION :
395 pbVal = &bIsSpellCapitalization;
396 bSCWA = ! *pbVal; // sal_False->sal_True change?
397 bSWWA = !bSCWA; // sal_True->sal_False change?
398 break;
400 case UPH_IS_SPELL_CLOSED_COMPOUND :
402 pbVal = &bIsSpellClosedCompound;
403 bSCWA = ! *pbVal; // sal_False->sal_True change?
404 bSWWA = !bSCWA; // sal_True->sal_False change?
405 break;
407 case UPH_IS_SPELL_HYPHENATED_COMPOUND :
409 pbVal = &bIsSpellHyphenatedCompound;
410 bSCWA = ! *pbVal; // sal_False->sal_True change?
411 bSWWA = !bSCWA; // sal_True->sal_False change?
412 break;
414 default:
415 SAL_WARN( "linguistic", "unknown property handle " << rEvt.PropertyHandle << " (check in include/unotools/linguprops.hxx)" );
417 if (pbVal)
418 rEvt.NewValue >>= *pbVal;
420 bRes = (pbVal != nullptr);
421 if (bRes)
423 sal_Int16 nLngSvcFlags = 0;
424 if (bSCWA)
425 nLngSvcFlags |= LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN;
426 if (bSWWA)
427 nLngSvcFlags |= LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN;
428 if (nLngSvcFlags)
430 LinguServiceEvent aEvt( GetEvtObj(), nLngSvcFlags );
431 LaunchEvent( aEvt );
436 return bRes;
440 void SAL_CALL
441 PropertyHelper_Spell::propertyChange( const PropertyChangeEvent& rEvt )
443 MutexGuard aGuard( GetLinguMutex() );
444 propertyChange_Impl( rEvt );
448 void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals )
450 PropertyChgHelper::SetTmpPropVals( rPropVals );
452 // return value is default value unless there is an explicitly supplied
453 // temporary value
454 bResIsSpellWithDigits = bIsSpellWithDigits;
455 bResIsSpellCapitalization = bIsSpellCapitalization;
456 bResIsSpellClosedCompound = bIsSpellClosedCompound;
457 bResIsSpellHyphenatedCompound = bIsSpellHyphenatedCompound;
458 bResIsSpellUpperCase = bIsSpellUpperCase;
460 for (const PropertyValue& rVal : rPropVals)
462 if ( rVal.Name == UPN_MAX_NUMBER_OF_SUGGESTIONS )
464 // special value that is not part of the property set and thus needs to be handled differently
466 else
468 bool *pbResVal = nullptr;
469 switch (rVal.Handle)
471 case UPH_IS_SPELL_UPPER_CASE : pbResVal = &bResIsSpellUpperCase; break;
472 case UPH_IS_SPELL_WITH_DIGITS : pbResVal = &bResIsSpellWithDigits; break;
473 case UPH_IS_SPELL_CAPITALIZATION : pbResVal = &bResIsSpellCapitalization; break;
474 case UPH_IS_SPELL_CLOSED_COMPOUND : pbResVal = &bResIsSpellClosedCompound; break;
475 case UPH_IS_SPELL_HYPHENATED_COMPOUND : pbResVal = &bResIsSpellHyphenatedCompound; break;
476 default:
477 SAL_WARN( "linguistic", "unknown property handle " << rVal.Handle << " (check in include/unotools/linguprops.hxx)" );
479 if (pbResVal)
480 rVal.Value >>= *pbResVal;
485 PropertyHelper_Hyphen::PropertyHelper_Hyphen(
486 const Reference< XInterface > & rxSource,
487 Reference< XLinguProperties > const &rxPropSet ) :
488 PropertyChgHelper ( rxSource, rxPropSet, AE_HYPHENATOR )
490 auto& rPropNames = GetPropNames();
491 rPropNames.push_back(UPN_HYPH_MIN_LEADING);
492 rPropNames.push_back(UPN_HYPH_MIN_TRAILING);
493 rPropNames.push_back(UPN_HYPH_MIN_WORD_LENGTH);
494 SetDefaultValues();
495 GetCurrentValues();
499 PropertyHelper_Hyphen::~PropertyHelper_Hyphen()
504 void PropertyHelper_Hyphen::SetDefaultValues()
506 PropertyChgHelper::SetDefaultValues();
508 nResHyphMinLeading = nHyphMinLeading = 2;
509 nResHyphMinTrailing = nHyphMinTrailing = 2;
510 nResHyphMinWordLength = nHyphMinWordLength = 0;
511 bResNoHyphenateCaps = bNoHyphenateCaps = false;
515 void PropertyHelper_Hyphen::GetCurrentValues()
517 PropertyChgHelper::GetCurrentValues();
519 const auto& rPropNames = GetPropNames();
520 if (!GetPropSet().is() || rPropNames.empty())
521 return;
523 for (const OUString& rPropName : rPropNames)
525 sal_Int16 *pnVal = nullptr,
526 *pnResVal = nullptr;
527 bool *pbVal = nullptr;
528 bool *pbResVal = nullptr;
530 if ( rPropName == UPN_HYPH_MIN_LEADING )
532 pnVal = &nHyphMinLeading;
533 pnResVal = &nResHyphMinLeading;
535 else if ( rPropName == UPN_HYPH_MIN_TRAILING )
537 pnVal = &nHyphMinTrailing;
538 pnResVal = &nResHyphMinTrailing;
540 else if ( rPropName == UPN_HYPH_MIN_WORD_LENGTH )
542 pnVal = &nHyphMinWordLength;
543 pnResVal = &nResHyphMinWordLength;
545 else if ( rPropName == UPN_HYPH_NO_CAPS )
547 pbVal = &bNoHyphenateCaps;
548 pbResVal = &bResNoHyphenateCaps;
551 if (pnVal && pnResVal)
553 GetPropSet()->getPropertyValue( rPropName ) >>= *pnVal;
554 *pnResVal = *pnVal;
556 else if (pbVal && pbResVal)
558 GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal;
559 *pbResVal = *pbVal;
565 bool PropertyHelper_Hyphen::propertyChange_Impl( const PropertyChangeEvent& rEvt )
567 bool bRes = PropertyChgHelper::propertyChange_Impl( rEvt );
569 if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet())
571 sal_Int16 *pnVal = nullptr;
572 bool *pbVal = nullptr;
573 switch (rEvt.PropertyHandle)
575 case UPH_HYPH_MIN_LEADING : pnVal = &nHyphMinLeading; break;
576 case UPH_HYPH_MIN_TRAILING : pnVal = &nHyphMinTrailing; break;
577 case UPH_HYPH_MIN_WORD_LENGTH : pnVal = &nHyphMinWordLength; break;
578 case UPH_HYPH_NO_CAPS : pbVal = &bNoHyphenateCaps; break;
579 default:
580 SAL_WARN( "linguistic", "unknown property handle " << rEvt.PropertyHandle << " (check in include/unotools/linguprops.hxx)");
582 if (pnVal)
583 rEvt.NewValue >>= *pnVal;
584 else if (pbVal)
585 rEvt.NewValue >>= *pbVal;
587 bRes = (pnVal != nullptr || pbVal != nullptr);
588 if (bRes)
590 LinguServiceEvent aEvt(GetEvtObj(), LinguServiceEventFlags::HYPHENATE_AGAIN);
591 LaunchEvent(aEvt);
595 return bRes;
599 void SAL_CALL
600 PropertyHelper_Hyphen::propertyChange( const PropertyChangeEvent& rEvt )
602 MutexGuard aGuard( GetLinguMutex() );
603 propertyChange_Impl( rEvt );
607 void PropertyHelper_Hyphen::SetTmpPropVals( const PropertyValues &rPropVals )
609 PropertyChgHelper::SetTmpPropVals( rPropVals );
611 // return value is default value unless there is an explicitly supplied
612 // temporary value
613 nResHyphMinLeading = nHyphMinLeading;
614 nResHyphMinTrailing = nHyphMinTrailing;
615 nResHyphMinWordLength = nHyphMinWordLength;
616 bResNoHyphenateCaps = bNoHyphenateCaps;
618 for (const PropertyValue& rVal : rPropVals)
620 sal_Int16 *pnResVal = nullptr;
621 bool *pbResVal = nullptr;
623 if ( rVal.Name == UPN_HYPH_MIN_LEADING )
624 pnResVal = &nResHyphMinLeading;
625 else if ( rVal.Name == UPN_HYPH_MIN_TRAILING )
626 pnResVal = &nResHyphMinTrailing;
627 else if ( rVal.Name == UPN_HYPH_MIN_WORD_LENGTH )
628 pnResVal = &nResHyphMinWordLength;
629 else if ( rVal.Name == UPN_HYPH_NO_CAPS )
630 pbResVal = &bResNoHyphenateCaps;
632 SAL_WARN_IF( !(pnResVal || pbResVal), "linguistic", "unknown property '" << rVal.Name << "'");
634 if (pnResVal)
635 rVal.Value >>= *pnResVal;
636 else if (pbResVal)
637 rVal.Value >>= *pbResVal;
641 PropertyHelper_Thesaurus::PropertyHelper_Thesaurus(
642 const css::uno::Reference< css::uno::XInterface > &rxSource,
643 css::uno::Reference< css::linguistic2::XLinguProperties > const &rxPropSet )
645 mxPropHelper = new PropertyHelper_Thes( rxSource, rxPropSet );
648 PropertyHelper_Thesaurus::~PropertyHelper_Thesaurus()
652 void PropertyHelper_Thesaurus::AddAsPropListener()
654 mxPropHelper->AddAsPropListener();
657 void PropertyHelper_Thesaurus::RemoveAsPropListener()
659 mxPropHelper->RemoveAsPropListener();
662 void PropertyHelper_Thesaurus::SetTmpPropVals( const css::beans::PropertyValues &rPropVals )
664 mxPropHelper->SetTmpPropVals( rPropVals );
667 PropertyHelper_Hyphenation::PropertyHelper_Hyphenation(
668 const css::uno::Reference< css::uno::XInterface > &rxSource,
669 css::uno::Reference< css::linguistic2::XLinguProperties > const &rxPropSet)
671 mxPropHelper = new PropertyHelper_Hyphen( rxSource, rxPropSet );
674 PropertyHelper_Hyphenation::~PropertyHelper_Hyphenation()
678 void PropertyHelper_Hyphenation::AddAsPropListener()
680 mxPropHelper->AddAsPropListener();
683 void PropertyHelper_Hyphenation::RemoveAsPropListener()
685 mxPropHelper->RemoveAsPropListener();
688 void PropertyHelper_Hyphenation::SetTmpPropVals( const css::beans::PropertyValues &rPropVals )
690 mxPropHelper->SetTmpPropVals( rPropVals );
693 sal_Int16 PropertyHelper_Hyphenation::GetMinLeading() const
695 return mxPropHelper->GetMinLeading();
698 sal_Int16 PropertyHelper_Hyphenation::GetMinTrailing() const
700 return mxPropHelper->GetMinTrailing();
703 sal_Int16 PropertyHelper_Hyphenation::GetMinWordLength() const
705 return mxPropHelper->GetMinWordLength();
708 bool PropertyHelper_Hyphenation::IsNoHyphenateCaps() const
710 return mxPropHelper->IsNoHyphenateCaps();
713 bool PropertyHelper_Hyphenation::addLinguServiceEventListener(
714 const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >& rxListener )
716 return mxPropHelper->addLinguServiceEventListener( rxListener );
719 bool PropertyHelper_Hyphenation::removeLinguServiceEventListener(
720 const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >& rxListener )
722 return mxPropHelper->removeLinguServiceEventListener( rxListener );
725 PropertyHelper_Spelling::PropertyHelper_Spelling(
726 const css::uno::Reference< css::uno::XInterface > &rxSource,
727 css::uno::Reference< css::linguistic2::XLinguProperties > const &rxPropSet )
729 mxPropHelper = new PropertyHelper_Spell( rxSource, rxPropSet );
732 PropertyHelper_Spelling::~PropertyHelper_Spelling()
736 void PropertyHelper_Spelling::AddAsPropListener()
738 mxPropHelper->AddAsPropListener();
741 void PropertyHelper_Spelling::RemoveAsPropListener()
743 mxPropHelper->RemoveAsPropListener();
746 void PropertyHelper_Spelling::SetTmpPropVals( const css::beans::PropertyValues &rPropVals )
748 mxPropHelper->SetTmpPropVals( rPropVals );
751 bool PropertyHelper_Spelling::IsSpellUpperCase() const
753 return mxPropHelper->IsSpellUpperCase();
756 bool PropertyHelper_Spelling::IsSpellWithDigits() const
758 return mxPropHelper->IsSpellWithDigits();
761 bool PropertyHelper_Spelling::IsSpellCapitalization() const
763 return mxPropHelper->IsSpellCapitalization();
766 bool PropertyHelper_Spelling::IsSpellClosedCompound() const
768 return mxPropHelper->IsSpellClosedCompound();
771 bool PropertyHelper_Spelling::IsSpellHyphenatedCompound() const
773 return mxPropHelper->IsSpellHyphenatedCompound();
776 bool PropertyHelper_Spelling::addLinguServiceEventListener(
777 const css::uno::Reference<
778 css::linguistic2::XLinguServiceEventListener >& rxListener )
780 return mxPropHelper->addLinguServiceEventListener( rxListener );
783 bool PropertyHelper_Spelling::removeLinguServiceEventListener(
784 const css::uno::Reference<
785 css::linguistic2::XLinguServiceEventListener >& rxListener )
787 return mxPropHelper->removeLinguServiceEventListener( rxListener );
790 } // namespace linguistic
792 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */