1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
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
;
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
}),
56 aLngSvcEvtListeners (GetLinguMutex()),
58 nEvtFlags (nAllowedEvents
)
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())
80 for (const OUString
& rPropName
: rPropNames
)
82 bool *pbVal
= 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
;
105 void PropertyChgHelper::SetTmpPropVals( const PropertyValues
&rPropVals
)
107 // return value is default value unless there is an explicitly supplied
109 bResIsIgnoreControlCharacters
= bIsIgnoreControlCharacters
;
110 bResIsUseDictionaryList
= bIsUseDictionaryList
;
112 for (const PropertyValue
& rVal
: rPropVals
)
114 bool *pbResVal
= nullptr;
117 case UPH_IS_IGNORE_CONTROL_CHARACTERS
:
118 pbResVal
= &bResIsIgnoreControlCharacters
; break;
119 case UPH_IS_USE_DICTIONARY_LIST
:
120 pbResVal
= &bResIsUseDictionaryList
; break;
125 rVal
.Value
>>= *pbResVal
;
130 bool PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent
& rEvt
)
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
;
150 case UPH_IS_USE_DICTIONARY_LIST
:
152 pbVal
= &bIsUseDictionaryList
;
153 bSCWA
= bSWWA
= true;
158 rEvt
.NewValue
>>= *pbVal
;
160 bRes
= nullptr != pbVal
; // sth changed?
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
;
170 LinguServiceEvent
aEvt( GetEvtObj(), nLngSvcFlags
);
181 PropertyChgHelper::propertyChange( const PropertyChangeEvent
& rEvt
)
183 MutexGuard
aGuard( GetLinguMutex() );
184 propertyChange_Impl( rEvt
);
188 void PropertyChgHelper::AddAsPropListener()
192 for (const OUString
& rPropName
: aPropNames
)
194 if (!rPropName
.isEmpty())
195 xPropSet
->addPropertyChangeListener( rPropName
, this );
200 void PropertyChgHelper::RemoveAsPropListener()
204 for (const OUString
& rPropName
: 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();
232 PropertyChgHelper::addLinguServiceEventListener(
233 const Reference
< XLinguServiceEventListener
>& rxListener
)
235 MutexGuard
aGuard( GetLinguMutex() );
240 sal_Int32 nCount
= aLngSvcEvtListeners
.getLength();
241 bRes
= aLngSvcEvtListeners
.addInterface( rxListener
) != nCount
;
248 PropertyChgHelper::removeLinguServiceEventListener(
249 const Reference
< XLinguServiceEventListener
>& rxListener
)
251 MutexGuard
aGuard( GetLinguMutex() );
256 sal_Int32 nCount
= aLngSvcEvtListeners
.getLength();
257 bRes
= aLngSvcEvtListeners
.removeInterface( rxListener
) != nCount
;
263 PropertyHelper_Thes::PropertyHelper_Thes(
264 const Reference
< XInterface
> &rxSource
,
265 Reference
< XLinguProperties
> const &rxPropSet
) :
266 PropertyChgHelper ( rxSource
, rxPropSet
, 0 )
273 PropertyHelper_Thes::~PropertyHelper_Thes()
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_CLOSED_COMPOUND
);
295 rPropNames
.push_back(UPN_IS_SPELL_HYPHENATED_COMPOUND
);
301 PropertyHelper_Spell::~PropertyHelper_Spell()
306 void PropertyHelper_Spell::SetDefaultValues()
308 PropertyChgHelper::SetDefaultValues();
310 bResIsSpellUpperCase
= bIsSpellUpperCase
= false;
311 bResIsSpellWithDigits
= bIsSpellWithDigits
= false;
312 bResIsSpellClosedCompound
= bIsSpellClosedCompound
= true;
313 bResIsSpellHyphenatedCompound
= bIsSpellHyphenatedCompound
= true;
317 void PropertyHelper_Spell::GetCurrentValues()
319 PropertyChgHelper::GetCurrentValues();
321 const auto& rPropNames
= GetPropNames();
322 if (!GetPropSet().is() || rPropNames
.empty())
325 for (const OUString
& rPropName
: rPropNames
)
327 bool *pbVal
= nullptr,
330 if ( rPropName
== UPN_IS_SPELL_UPPER_CASE
)
332 pbVal
= &bIsSpellUpperCase
;
333 pbResVal
= &bResIsSpellUpperCase
;
335 else if ( rPropName
== UPN_IS_SPELL_WITH_DIGITS
)
337 pbVal
= &bIsSpellWithDigits
;
338 pbResVal
= &bResIsSpellWithDigits
;
340 else if ( rPropName
== UPN_IS_SPELL_CLOSED_COMPOUND
)
342 pbVal
= &bIsSpellClosedCompound
;
343 pbResVal
= &bResIsSpellClosedCompound
;
345 else if ( rPropName
== UPN_IS_SPELL_HYPHENATED_COMPOUND
)
347 pbVal
= &bIsSpellHyphenatedCompound
;
348 pbResVal
= &bResIsSpellHyphenatedCompound
;
351 if (pbVal
&& pbResVal
)
353 GetPropSet()->getPropertyValue( rPropName
) >>= *pbVal
;
360 bool PropertyHelper_Spell::propertyChange_Impl( const PropertyChangeEvent
& rEvt
)
362 bool bRes
= PropertyChgHelper::propertyChange_Impl( rEvt
);
364 if (!bRes
&& GetPropSet().is() && rEvt
.Source
== GetPropSet())
366 bool bSCWA
= false, // SPELL_CORRECT_WORDS_AGAIN ?
367 bSWWA
= false; // SPELL_WRONG_WORDS_AGAIN ?
369 bool *pbVal
= nullptr;
370 switch (rEvt
.PropertyHandle
)
372 case UPH_IS_SPELL_UPPER_CASE
:
374 pbVal
= &bIsSpellUpperCase
;
375 bSCWA
= ! *pbVal
; // sal_False->sal_True change?
376 bSWWA
= !bSCWA
; // sal_True->sal_False change?
379 case UPH_IS_SPELL_WITH_DIGITS
:
381 pbVal
= &bIsSpellWithDigits
;
382 bSCWA
= ! *pbVal
; // sal_False->sal_True change?
383 bSWWA
= !bSCWA
; // sal_True->sal_False change?
386 case UPH_IS_SPELL_CLOSED_COMPOUND
:
388 pbVal
= &bIsSpellClosedCompound
;
389 bSCWA
= ! *pbVal
; // sal_False->sal_True change?
390 bSWWA
= !bSCWA
; // sal_True->sal_False change?
393 case UPH_IS_SPELL_HYPHENATED_COMPOUND
:
395 pbVal
= &bIsSpellHyphenatedCompound
;
396 bSCWA
= ! *pbVal
; // sal_False->sal_True change?
397 bSWWA
= !bSCWA
; // sal_True->sal_False change?
401 SAL_WARN( "linguistic", "unknown property handle " << rEvt
.PropertyHandle
<< " (check in include/unotools/linguprops.hxx)" );
404 rEvt
.NewValue
>>= *pbVal
;
406 bRes
= (pbVal
!= nullptr);
409 sal_Int16 nLngSvcFlags
= 0;
411 nLngSvcFlags
|= LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN
;
413 nLngSvcFlags
|= LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN
;
416 LinguServiceEvent
aEvt( GetEvtObj(), nLngSvcFlags
);
427 PropertyHelper_Spell::propertyChange( const PropertyChangeEvent
& rEvt
)
429 MutexGuard
aGuard( GetLinguMutex() );
430 propertyChange_Impl( rEvt
);
434 void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues
&rPropVals
)
436 PropertyChgHelper::SetTmpPropVals( rPropVals
);
438 // return value is default value unless there is an explicitly supplied
440 bResIsSpellWithDigits
= bIsSpellWithDigits
;
441 bResIsSpellClosedCompound
= bIsSpellClosedCompound
;
442 bResIsSpellHyphenatedCompound
= bIsSpellHyphenatedCompound
;
443 bResIsSpellUpperCase
= bIsSpellUpperCase
;
445 for (const PropertyValue
& rVal
: rPropVals
)
447 if ( rVal
.Name
== UPN_MAX_NUMBER_OF_SUGGESTIONS
)
449 // special value that is not part of the property set and thus needs to be handled differently
453 bool *pbResVal
= nullptr;
456 case UPH_IS_SPELL_UPPER_CASE
: pbResVal
= &bResIsSpellUpperCase
; break;
457 case UPH_IS_SPELL_WITH_DIGITS
: pbResVal
= &bResIsSpellWithDigits
; break;
458 case UPH_IS_SPELL_CLOSED_COMPOUND
: pbResVal
= &bResIsSpellClosedCompound
; break;
459 case UPH_IS_SPELL_HYPHENATED_COMPOUND
: pbResVal
= &bResIsSpellHyphenatedCompound
; break;
461 SAL_WARN( "linguistic", "unknown property handle " << rVal
.Handle
<< " (check in include/unotools/linguprops.hxx)" );
464 rVal
.Value
>>= *pbResVal
;
469 PropertyHelper_Hyphen::PropertyHelper_Hyphen(
470 const Reference
< XInterface
> & rxSource
,
471 Reference
< XLinguProperties
> const &rxPropSet
) :
472 PropertyChgHelper ( rxSource
, rxPropSet
, AE_HYPHENATOR
)
474 auto& rPropNames
= GetPropNames();
475 rPropNames
.push_back(UPN_HYPH_MIN_LEADING
);
476 rPropNames
.push_back(UPN_HYPH_MIN_TRAILING
);
477 rPropNames
.push_back(UPN_HYPH_MIN_WORD_LENGTH
);
483 PropertyHelper_Hyphen::~PropertyHelper_Hyphen()
488 void PropertyHelper_Hyphen::SetDefaultValues()
490 PropertyChgHelper::SetDefaultValues();
492 nResHyphMinLeading
= nHyphMinLeading
= 2;
493 nResHyphMinTrailing
= nHyphMinTrailing
= 2;
494 nResHyphCompoundMinLeading
= nHyphCompoundMinLeading
= 2;
495 nResHyphMinWordLength
= nHyphMinWordLength
= 0;
496 nResHyphTextHyphenZone
= nHyphTextHyphenZone
= 0;
497 bResNoHyphenateCaps
= bNoHyphenateCaps
= false;
501 void PropertyHelper_Hyphen::GetCurrentValues()
503 PropertyChgHelper::GetCurrentValues();
505 const auto& rPropNames
= GetPropNames();
506 if (!GetPropSet().is() || rPropNames
.empty())
509 for (const OUString
& rPropName
: rPropNames
)
511 sal_Int16
*pnVal
= nullptr,
513 bool *pbVal
= nullptr;
514 bool *pbResVal
= nullptr;
516 if ( rPropName
== UPN_HYPH_MIN_LEADING
)
518 pnVal
= &nHyphMinLeading
;
519 pnResVal
= &nResHyphMinLeading
;
521 else if ( rPropName
== UPN_HYPH_MIN_TRAILING
)
523 pnVal
= &nHyphMinTrailing
;
524 pnResVal
= &nResHyphMinTrailing
;
526 if ( rPropName
== UPN_HYPH_COMPOUND_MIN_LEADING
)
528 pnVal
= &nHyphCompoundMinLeading
;
529 pnResVal
= &nResHyphCompoundMinLeading
;
531 else if ( rPropName
== UPN_HYPH_MIN_WORD_LENGTH
)
533 pnVal
= &nHyphMinWordLength
;
534 pnResVal
= &nResHyphMinWordLength
;
536 else if ( rPropName
== UPN_HYPH_ZONE
)
538 pnVal
= &nHyphTextHyphenZone
;
539 pnResVal
= &nResHyphTextHyphenZone
;
541 else if ( rPropName
== UPN_HYPH_NO_CAPS
)
543 pbVal
= &bNoHyphenateCaps
;
544 pbResVal
= &bResNoHyphenateCaps
;
547 if (pnVal
&& pnResVal
)
549 GetPropSet()->getPropertyValue( rPropName
) >>= *pnVal
;
552 else if (pbVal
&& pbResVal
)
554 GetPropSet()->getPropertyValue( rPropName
) >>= *pbVal
;
561 bool PropertyHelper_Hyphen::propertyChange_Impl( const PropertyChangeEvent
& rEvt
)
563 bool bRes
= PropertyChgHelper::propertyChange_Impl( rEvt
);
565 if (!bRes
&& GetPropSet().is() && rEvt
.Source
== GetPropSet())
567 sal_Int16
*pnVal
= nullptr;
568 bool *pbVal
= nullptr;
569 switch (rEvt
.PropertyHandle
)
571 case UPH_HYPH_MIN_LEADING
: pnVal
= &nHyphMinLeading
; break;
572 case UPH_HYPH_MIN_TRAILING
: pnVal
= &nHyphMinTrailing
; break;
573 case UPH_HYPH_COMPOUND_MIN_LEADING
: pnVal
= &nHyphCompoundMinLeading
; break;
574 case UPH_HYPH_MIN_WORD_LENGTH
: pnVal
= &nHyphMinWordLength
; break;
575 case UPH_HYPH_ZONE
: pnVal
= &nHyphTextHyphenZone
; break;
576 case UPH_HYPH_NO_CAPS
: pbVal
= &bNoHyphenateCaps
; break;
578 SAL_WARN( "linguistic", "unknown property handle " << rEvt
.PropertyHandle
<< " (check in include/unotools/linguprops.hxx)");
581 rEvt
.NewValue
>>= *pnVal
;
583 rEvt
.NewValue
>>= *pbVal
;
585 bRes
= (pnVal
!= nullptr || pbVal
!= nullptr);
588 LinguServiceEvent
aEvt(GetEvtObj(), LinguServiceEventFlags::HYPHENATE_AGAIN
);
598 PropertyHelper_Hyphen::propertyChange( const PropertyChangeEvent
& rEvt
)
600 MutexGuard
aGuard( GetLinguMutex() );
601 propertyChange_Impl( rEvt
);
605 void PropertyHelper_Hyphen::SetTmpPropVals( const PropertyValues
&rPropVals
)
607 PropertyChgHelper::SetTmpPropVals( rPropVals
);
609 // return value is default value unless there is an explicitly supplied
611 nResHyphMinLeading
= nHyphMinLeading
;
612 nResHyphMinTrailing
= nHyphMinTrailing
;
613 nResHyphCompoundMinLeading
= nHyphCompoundMinLeading
;
614 nResHyphMinWordLength
= nHyphMinWordLength
;
615 nResHyphTextHyphenZone
= nHyphTextHyphenZone
;
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 if ( rVal
.Name
== UPN_HYPH_COMPOUND_MIN_LEADING
)
628 pnResVal
= &nResHyphCompoundMinLeading
;
629 else if ( rVal
.Name
== UPN_HYPH_MIN_WORD_LENGTH
)
630 pnResVal
= &nResHyphMinWordLength
;
631 else if ( rVal
.Name
== UPN_HYPH_ZONE
)
632 pnResVal
= &nResHyphTextHyphenZone
;
633 else if ( rVal
.Name
== UPN_HYPH_NO_CAPS
)
634 pbResVal
= &bResNoHyphenateCaps
;
635 else if (rVal
.Name
== UPN_HYPH_NO_LAST_WORD
||
636 rVal
.Name
== UPN_HYPH_KEEP
||
637 rVal
.Name
== UPN_HYPH_KEEP_TYPE
)
639 // skip these known ones without warnings
643 SAL_WARN_IF( !(pnResVal
|| pbResVal
), "linguistic", "unknown property '" << rVal
.Name
<< "'");
646 rVal
.Value
>>= *pnResVal
;
648 rVal
.Value
>>= *pbResVal
;
652 PropertyHelper_Thesaurus::PropertyHelper_Thesaurus(
653 const css::uno::Reference
< css::uno::XInterface
> &rxSource
,
654 css::uno::Reference
< css::linguistic2::XLinguProperties
> const &rxPropSet
)
656 mxPropHelper
= new PropertyHelper_Thes( rxSource
, rxPropSet
);
659 PropertyHelper_Thesaurus::~PropertyHelper_Thesaurus()
663 void PropertyHelper_Thesaurus::AddAsPropListener()
665 mxPropHelper
->AddAsPropListener();
668 void PropertyHelper_Thesaurus::RemoveAsPropListener()
670 mxPropHelper
->RemoveAsPropListener();
673 void PropertyHelper_Thesaurus::SetTmpPropVals( const css::beans::PropertyValues
&rPropVals
)
675 mxPropHelper
->SetTmpPropVals( rPropVals
);
678 PropertyHelper_Hyphenation::PropertyHelper_Hyphenation(
679 const css::uno::Reference
< css::uno::XInterface
> &rxSource
,
680 css::uno::Reference
< css::linguistic2::XLinguProperties
> const &rxPropSet
)
682 mxPropHelper
= new PropertyHelper_Hyphen( rxSource
, rxPropSet
);
685 PropertyHelper_Hyphenation::~PropertyHelper_Hyphenation()
689 void PropertyHelper_Hyphenation::AddAsPropListener()
691 mxPropHelper
->AddAsPropListener();
694 void PropertyHelper_Hyphenation::RemoveAsPropListener()
696 mxPropHelper
->RemoveAsPropListener();
699 void PropertyHelper_Hyphenation::SetTmpPropVals( const css::beans::PropertyValues
&rPropVals
)
701 mxPropHelper
->SetTmpPropVals( rPropVals
);
704 sal_Int16
PropertyHelper_Hyphenation::GetMinLeading() const
706 return mxPropHelper
->GetMinLeading();
709 sal_Int16
PropertyHelper_Hyphenation::GetMinTrailing() const
711 return mxPropHelper
->GetMinTrailing();
714 sal_Int16
PropertyHelper_Hyphenation::GetCompoundMinLeading() const
716 return mxPropHelper
->GetCompoundMinLeading();
719 sal_Int16
PropertyHelper_Hyphenation::GetMinWordLength() const
721 return mxPropHelper
->GetMinWordLength();
724 bool PropertyHelper_Hyphenation::IsNoHyphenateCaps() const
726 return mxPropHelper
->IsNoHyphenateCaps();
729 bool PropertyHelper_Hyphenation::addLinguServiceEventListener(
730 const css::uno::Reference
< css::linguistic2::XLinguServiceEventListener
>& rxListener
)
732 return mxPropHelper
->addLinguServiceEventListener( rxListener
);
735 bool PropertyHelper_Hyphenation::removeLinguServiceEventListener(
736 const css::uno::Reference
< css::linguistic2::XLinguServiceEventListener
>& rxListener
)
738 return mxPropHelper
->removeLinguServiceEventListener( rxListener
);
741 PropertyHelper_Spelling::PropertyHelper_Spelling(
742 const css::uno::Reference
< css::uno::XInterface
> &rxSource
,
743 css::uno::Reference
< css::linguistic2::XLinguProperties
> const &rxPropSet
)
745 mxPropHelper
= new PropertyHelper_Spell( rxSource
, rxPropSet
);
748 PropertyHelper_Spelling::~PropertyHelper_Spelling()
752 void PropertyHelper_Spelling::AddAsPropListener()
754 mxPropHelper
->AddAsPropListener();
757 void PropertyHelper_Spelling::RemoveAsPropListener()
759 mxPropHelper
->RemoveAsPropListener();
762 void PropertyHelper_Spelling::SetTmpPropVals( const css::beans::PropertyValues
&rPropVals
)
764 mxPropHelper
->SetTmpPropVals( rPropVals
);
767 bool PropertyHelper_Spelling::IsSpellUpperCase() const
769 return mxPropHelper
->IsSpellUpperCase();
772 bool PropertyHelper_Spelling::IsSpellWithDigits() const
774 return mxPropHelper
->IsSpellWithDigits();
777 bool PropertyHelper_Spelling::IsSpellClosedCompound() const
779 return mxPropHelper
->IsSpellClosedCompound();
782 bool PropertyHelper_Spelling::IsSpellHyphenatedCompound() const
784 return mxPropHelper
->IsSpellHyphenatedCompound();
787 bool PropertyHelper_Spelling::addLinguServiceEventListener(
788 const css::uno::Reference
<
789 css::linguistic2::XLinguServiceEventListener
>& rxListener
)
791 return mxPropHelper
->addLinguServiceEventListener( rxListener
);
794 bool PropertyHelper_Spelling::removeLinguServiceEventListener(
795 const css::uno::Reference
<
796 css::linguistic2::XLinguServiceEventListener
>& rxListener
)
798 return mxPropHelper
->removeLinguServiceEventListener( rxListener
);
801 } // namespace linguistic
803 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */