LibreOffice Module linguistic (master) 1
lngprophelp.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20
21#include <tools/debug.hxx>
22#include <sal/log.hxx>
23
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>
31
32#include <linguistic/misc.hxx>
34
36
37using namespace osl;
38using namespace com::sun::star;
39using namespace com::sun::star::beans;
40using namespace com::sun::star::lang;
41using namespace com::sun::star::uno;
42using namespace com::sun::star::linguistic2;
43using namespace linguistic;
44
45
46namespace linguistic
47{
48
49
50PropertyChgHelper::PropertyChgHelper(
51 const Reference< XInterface > &rxSource,
52 Reference< XLinguProperties > const &rxPropSet,
53 int nAllowedEvents ) :
55 xMyEvtObj (rxSource),
56 aLngSvcEvtListeners (GetLinguMutex()),
57 xPropSet (rxPropSet),
58 nEvtFlags (nAllowedEvents)
59{
60 SetDefaultValues();
61}
62
63PropertyChgHelper::~PropertyChgHelper()
64{
65}
66
67void PropertyChgHelper::SetDefaultValues()
68{
69 bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = true;
70 bResIsUseDictionaryList = bIsUseDictionaryList = true;
71}
72
73
74void PropertyChgHelper::GetCurrentValues()
75{
76 const auto& rPropNames = GetPropNames();
77 if (!GetPropSet().is() || rPropNames.empty())
78 return;
79
80 for (const OUString& rPropName : rPropNames)
81 {
82 bool *pbVal = nullptr,
83 *pbResVal = nullptr;
84
85 if ( rPropName == UPN_IS_IGNORE_CONTROL_CHARACTERS )
86 {
87 pbVal = &bIsIgnoreControlCharacters;
88 pbResVal = &bResIsIgnoreControlCharacters;
89 }
90 else if ( rPropName == UPN_IS_USE_DICTIONARY_LIST )
91 {
92 pbVal = &bIsUseDictionaryList;
93 pbResVal = &bResIsUseDictionaryList;
94 }
95
96 if (pbVal && pbResVal)
97 {
98 GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal;
99 *pbResVal = *pbVal;
100 }
101 }
102}
103
104
105void PropertyChgHelper::SetTmpPropVals( const PropertyValues &rPropVals )
106{
107 // return value is default value unless there is an explicitly supplied
108 // temporary value
109 bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters;
110 bResIsUseDictionaryList = bIsUseDictionaryList;
111
112 for (const PropertyValue& rVal : rPropVals)
113 {
114 bool *pbResVal = nullptr;
115 switch (rVal.Handle)
116 {
118 pbResVal = &bResIsIgnoreControlCharacters; break;
120 pbResVal = &bResIsUseDictionaryList; break;
121 default:
122 ;
123 }
124 if (pbResVal)
125 rVal.Value >>= *pbResVal;
126 }
127}
128
129
130bool PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt )
131{
132 bool bRes = false;
133
134 if (GetPropSet().is() && rEvt.Source == GetPropSet())
135 {
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 ?
140
141 bool *pbVal = nullptr;
142 switch (rEvt.PropertyHandle)
143 {
145 {
146 pbVal = &bIsIgnoreControlCharacters;
147 nLngSvcFlags = 0;
148 break;
149 }
151 {
152 pbVal = &bIsUseDictionaryList;
153 bSCWA = bSWWA = true;
154 break;
155 }
156 }
157 if (pbVal)
158 rEvt.NewValue >>= *pbVal;
159
160 bRes = nullptr != pbVal; // sth changed?
161 if (bRes)
162 {
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)
169 {
170 LinguServiceEvent aEvt( GetEvtObj(), nLngSvcFlags );
171 LaunchEvent( aEvt );
172 }
173 }
174 }
175
176 return bRes;
177}
178
179
180void SAL_CALL
181 PropertyChgHelper::propertyChange( const PropertyChangeEvent& rEvt )
182{
183 MutexGuard aGuard( GetLinguMutex() );
184 propertyChange_Impl( rEvt );
185}
186
187
188void PropertyChgHelper::AddAsPropListener()
189{
190 if (xPropSet.is())
191 {
192 for (const OUString& rPropName : std::as_const(aPropNames))
193 {
194 if (!rPropName.isEmpty())
195 xPropSet->addPropertyChangeListener( rPropName, this );
196 }
197 }
198}
199
200void PropertyChgHelper::RemoveAsPropListener()
201{
202 if (xPropSet.is())
203 {
204 for (const OUString& rPropName : std::as_const(aPropNames))
205 {
206 if (!rPropName.isEmpty())
207 xPropSet->removePropertyChangeListener( rPropName, this );
208 }
209 }
210}
211
212
213void PropertyChgHelper::LaunchEvent( const LinguServiceEvent &rEvt )
214{
215 aLngSvcEvtListeners.notifyEach( &XLinguServiceEventListener::processLinguServiceEvent, rEvt );
216}
217
218
219void SAL_CALL PropertyChgHelper::disposing( const EventObject& rSource )
220{
221 MutexGuard aGuard( GetLinguMutex() );
222 if (rSource.Source == xPropSet)
223 {
224 RemoveAsPropListener();
225 xPropSet = nullptr;
226 aPropNames.clear();
227 }
228}
229
230
231sal_Bool SAL_CALL
232 PropertyChgHelper::addLinguServiceEventListener(
234{
235 MutexGuard aGuard( GetLinguMutex() );
236
237 bool bRes = false;
238 if (rxListener.is())
239 {
240 sal_Int32 nCount = aLngSvcEvtListeners.getLength();
241 bRes = aLngSvcEvtListeners.addInterface( rxListener ) != nCount;
242 }
243 return bRes;
244}
245
246
247sal_Bool SAL_CALL
248 PropertyChgHelper::removeLinguServiceEventListener(
250{
251 MutexGuard aGuard( GetLinguMutex() );
252
253 bool bRes = false;
254 if (rxListener.is())
255 {
256 sal_Int32 nCount = aLngSvcEvtListeners.getLength();
257 bRes = aLngSvcEvtListeners.removeInterface( rxListener ) != nCount;
258 }
259 return bRes;
260}
261
262
263PropertyHelper_Thes::PropertyHelper_Thes(
264 const Reference< XInterface > &rxSource,
265 Reference< XLinguProperties > const &rxPropSet ) :
266 PropertyChgHelper ( rxSource, rxPropSet, 0 )
267{
268 SetDefaultValues();
269 GetCurrentValues();
270}
271
272
273PropertyHelper_Thes::~PropertyHelper_Thes()
274{
275}
276
277
278void SAL_CALL
279 PropertyHelper_Thes::propertyChange( const PropertyChangeEvent& rEvt )
280{
281 MutexGuard aGuard( GetLinguMutex() );
282 PropertyChgHelper::propertyChange_Impl( rEvt );
283}
284
285
286PropertyHelper_Spell::PropertyHelper_Spell(
287 const Reference< XInterface > & rxSource,
288 Reference< XLinguProperties > const &rxPropSet ) :
289 PropertyChgHelper ( rxSource, rxPropSet, AE_SPELLCHECKER )
290{
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();
299}
300
301
302PropertyHelper_Spell::~PropertyHelper_Spell()
303{
304}
305
306
307void PropertyHelper_Spell::SetDefaultValues()
308{
309 PropertyChgHelper::SetDefaultValues();
310
311 bResIsSpellUpperCase = bIsSpellUpperCase = false;
312 bResIsSpellWithDigits = bIsSpellWithDigits = false;
313 bResIsSpellCapitalization = bIsSpellCapitalization = true;
314 bResIsSpellClosedCompound = bIsSpellClosedCompound = true;
315 bResIsSpellHyphenatedCompound = bIsSpellHyphenatedCompound = true;
316}
317
318
319void PropertyHelper_Spell::GetCurrentValues()
320{
321 PropertyChgHelper::GetCurrentValues();
322
323 const auto& rPropNames = GetPropNames();
324 if (!GetPropSet().is() || rPropNames.empty())
325 return;
326
327 for (const OUString& rPropName : rPropNames)
328 {
329 bool *pbVal = nullptr,
330 *pbResVal = nullptr;
331
332 if ( rPropName == UPN_IS_SPELL_UPPER_CASE )
333 {
334 pbVal = &bIsSpellUpperCase;
335 pbResVal = &bResIsSpellUpperCase;
336 }
337 else if ( rPropName == UPN_IS_SPELL_WITH_DIGITS )
338 {
339 pbVal = &bIsSpellWithDigits;
340 pbResVal = &bResIsSpellWithDigits;
341 }
342 else if ( rPropName == UPN_IS_SPELL_CAPITALIZATION )
343 {
344 pbVal = &bIsSpellCapitalization;
345 pbResVal = &bResIsSpellCapitalization;
346 }
347 else if ( rPropName == UPN_IS_SPELL_CLOSED_COMPOUND )
348 {
349 pbVal = &bIsSpellClosedCompound;
350 pbResVal = &bResIsSpellClosedCompound;
351 }
352 else if ( rPropName == UPN_IS_SPELL_HYPHENATED_COMPOUND )
353 {
354 pbVal = &bIsSpellHyphenatedCompound;
355 pbResVal = &bResIsSpellHyphenatedCompound;
356 }
357
358 if (pbVal && pbResVal)
359 {
360 GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal;
361 *pbResVal = *pbVal;
362 }
363 }
364}
365
366
367bool PropertyHelper_Spell::propertyChange_Impl( const PropertyChangeEvent& rEvt )
368{
369 bool bRes = PropertyChgHelper::propertyChange_Impl( rEvt );
370
371 if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet())
372 {
373 bool bSCWA = false, // SPELL_CORRECT_WORDS_AGAIN ?
374 bSWWA = false; // SPELL_WRONG_WORDS_AGAIN ?
375
376 bool *pbVal = nullptr;
377 switch (rEvt.PropertyHandle)
378 {
380 {
381 pbVal = &bIsSpellUpperCase;
382 bSCWA = ! *pbVal; // sal_False->sal_True change?
383 bSWWA = !bSCWA; // sal_True->sal_False change?
384 break;
385 }
387 {
388 pbVal = &bIsSpellWithDigits;
389 bSCWA = ! *pbVal; // sal_False->sal_True change?
390 bSWWA = !bSCWA; // sal_True->sal_False change?
391 break;
392 }
394 {
395 pbVal = &bIsSpellCapitalization;
396 bSCWA = ! *pbVal; // sal_False->sal_True change?
397 bSWWA = !bSCWA; // sal_True->sal_False change?
398 break;
399 }
401 {
402 pbVal = &bIsSpellClosedCompound;
403 bSCWA = ! *pbVal; // sal_False->sal_True change?
404 bSWWA = !bSCWA; // sal_True->sal_False change?
405 break;
406 }
408 {
409 pbVal = &bIsSpellHyphenatedCompound;
410 bSCWA = ! *pbVal; // sal_False->sal_True change?
411 bSWWA = !bSCWA; // sal_True->sal_False change?
412 break;
413 }
414 default:
415 SAL_WARN( "linguistic", "unknown property handle " << rEvt.PropertyHandle << " (check in include/unotools/linguprops.hxx)" );
416 }
417 if (pbVal)
418 rEvt.NewValue >>= *pbVal;
419
420 bRes = (pbVal != nullptr);
421 if (bRes)
422 {
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)
429 {
430 LinguServiceEvent aEvt( GetEvtObj(), nLngSvcFlags );
431 LaunchEvent( aEvt );
432 }
433 }
434 }
435
436 return bRes;
437}
438
439
440void SAL_CALL
441 PropertyHelper_Spell::propertyChange( const PropertyChangeEvent& rEvt )
442{
443 MutexGuard aGuard( GetLinguMutex() );
444 propertyChange_Impl( rEvt );
445}
446
447
448void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals )
449{
450 PropertyChgHelper::SetTmpPropVals( rPropVals );
451
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;
459
460 for (const PropertyValue& rVal : rPropVals)
461 {
462 if ( rVal.Name == UPN_MAX_NUMBER_OF_SUGGESTIONS )
463 {
464 // special value that is not part of the property set and thus needs to be handled differently
465 }
466 else
467 {
468 bool *pbResVal = nullptr;
469 switch (rVal.Handle)
470 {
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)" );
478 }
479 if (pbResVal)
480 rVal.Value >>= *pbResVal;
481 }
482 }
483}
484
486 const Reference< XInterface > & rxSource,
487 Reference< XLinguProperties > const &rxPropSet ) :
488 PropertyChgHelper ( rxSource, rxPropSet, AE_HYPHENATOR )
489{
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();
496}
497
498
500{
501}
502
503
505{
506 PropertyChgHelper::SetDefaultValues();
507
512}
513
514
516{
517 PropertyChgHelper::GetCurrentValues();
518
519 const auto& rPropNames = GetPropNames();
520 if (!GetPropSet().is() || rPropNames.empty())
521 return;
522
523 for (const OUString& rPropName : rPropNames)
524 {
525 sal_Int16 *pnVal = nullptr,
526 *pnResVal = nullptr;
527 bool *pbVal = nullptr;
528 bool *pbResVal = nullptr;
529
530 if ( rPropName == UPN_HYPH_MIN_LEADING )
531 {
532 pnVal = &nHyphMinLeading;
533 pnResVal = &nResHyphMinLeading;
534 }
535 else if ( rPropName == UPN_HYPH_MIN_TRAILING )
536 {
537 pnVal = &nHyphMinTrailing;
538 pnResVal = &nResHyphMinTrailing;
539 }
540 else if ( rPropName == UPN_HYPH_MIN_WORD_LENGTH )
541 {
542 pnVal = &nHyphMinWordLength;
543 pnResVal = &nResHyphMinWordLength;
544 }
545 else if ( rPropName == UPN_HYPH_NO_CAPS )
546 {
547 pbVal = &bNoHyphenateCaps;
548 pbResVal = &bResNoHyphenateCaps;
549 }
550
551 if (pnVal && pnResVal)
552 {
553 GetPropSet()->getPropertyValue( rPropName ) >>= *pnVal;
554 *pnResVal = *pnVal;
555 }
556 else if (pbVal && pbResVal)
557 {
558 GetPropSet()->getPropertyValue( rPropName ) >>= *pbVal;
559 *pbResVal = *pbVal;
560 }
561 }
562}
563
564
565bool PropertyHelper_Hyphen::propertyChange_Impl( const PropertyChangeEvent& rEvt )
566{
567 bool bRes = PropertyChgHelper::propertyChange_Impl( rEvt );
568
569 if (!bRes && GetPropSet().is() && rEvt.Source == GetPropSet())
570 {
571 sal_Int16 *pnVal = nullptr;
572 bool *pbVal = nullptr;
573 switch (rEvt.PropertyHandle)
574 {
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)");
581 }
582 if (pnVal)
583 rEvt.NewValue >>= *pnVal;
584 else if (pbVal)
585 rEvt.NewValue >>= *pbVal;
586
587 bRes = (pnVal != nullptr || pbVal != nullptr);
588 if (bRes)
589 {
590 LinguServiceEvent aEvt(GetEvtObj(), LinguServiceEventFlags::HYPHENATE_AGAIN);
591 LaunchEvent(aEvt);
592 }
593 }
594
595 return bRes;
596}
597
598
599void SAL_CALL
600 PropertyHelper_Hyphen::propertyChange( const PropertyChangeEvent& rEvt )
601{
602 MutexGuard aGuard( GetLinguMutex() );
603 propertyChange_Impl( rEvt );
604}
605
606
608{
609 PropertyChgHelper::SetTmpPropVals( rPropVals );
610
611 // return value is default value unless there is an explicitly supplied
612 // temporary value
617
618 for (const PropertyValue& rVal : rPropVals)
619 {
620 sal_Int16 *pnResVal = nullptr;
621 bool *pbResVal = nullptr;
622
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;
631
632 SAL_WARN_IF( !(pnResVal || pbResVal), "linguistic", "unknown property '" << rVal.Name << "'");
633
634 if (pnResVal)
635 rVal.Value >>= *pnResVal;
636 else if (pbResVal)
637 rVal.Value >>= *pbResVal;
638 }
639}
640
641PropertyHelper_Thesaurus::PropertyHelper_Thesaurus(
642 const css::uno::Reference< css::uno::XInterface > &rxSource,
643 css::uno::Reference< css::linguistic2::XLinguProperties > const &rxPropSet )
644{
645 mxPropHelper = new PropertyHelper_Thes( rxSource, rxPropSet );
646}
647
648PropertyHelper_Thesaurus::~PropertyHelper_Thesaurus()
649{
650}
651
652void PropertyHelper_Thesaurus::AddAsPropListener()
653{
654 mxPropHelper->AddAsPropListener();
655}
656
657void PropertyHelper_Thesaurus::RemoveAsPropListener()
658{
659 mxPropHelper->RemoveAsPropListener();
660}
661
662void PropertyHelper_Thesaurus::SetTmpPropVals( const css::beans::PropertyValues &rPropVals )
663{
664 mxPropHelper->SetTmpPropVals( rPropVals );
665}
666
667PropertyHelper_Hyphenation::PropertyHelper_Hyphenation(
668 const css::uno::Reference< css::uno::XInterface > &rxSource,
669 css::uno::Reference< css::linguistic2::XLinguProperties > const &rxPropSet)
670{
671 mxPropHelper = new PropertyHelper_Hyphen( rxSource, rxPropSet );
672}
673
674PropertyHelper_Hyphenation::~PropertyHelper_Hyphenation()
675{
676}
677
678void PropertyHelper_Hyphenation::AddAsPropListener()
679{
680 mxPropHelper->AddAsPropListener();
681}
682
683void PropertyHelper_Hyphenation::RemoveAsPropListener()
684{
685 mxPropHelper->RemoveAsPropListener();
686}
687
688void PropertyHelper_Hyphenation::SetTmpPropVals( const css::beans::PropertyValues &rPropVals )
689{
690 mxPropHelper->SetTmpPropVals( rPropVals );
691}
692
693sal_Int16 PropertyHelper_Hyphenation::GetMinLeading() const
694{
695 return mxPropHelper->GetMinLeading();
696}
697
698sal_Int16 PropertyHelper_Hyphenation::GetMinTrailing() const
699{
700 return mxPropHelper->GetMinTrailing();
701}
702
703sal_Int16 PropertyHelper_Hyphenation::GetMinWordLength() const
704{
705 return mxPropHelper->GetMinWordLength();
706}
707
708bool PropertyHelper_Hyphenation::IsNoHyphenateCaps() const
709{
710 return mxPropHelper->IsNoHyphenateCaps();
711}
712
713bool PropertyHelper_Hyphenation::addLinguServiceEventListener(
714 const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >& rxListener )
715{
716 return mxPropHelper->addLinguServiceEventListener( rxListener );
717}
718
719bool PropertyHelper_Hyphenation::removeLinguServiceEventListener(
720 const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >& rxListener )
721{
722 return mxPropHelper->removeLinguServiceEventListener( rxListener );
723}
724
725PropertyHelper_Spelling::PropertyHelper_Spelling(
726 const css::uno::Reference< css::uno::XInterface > &rxSource,
727 css::uno::Reference< css::linguistic2::XLinguProperties > const &rxPropSet )
728{
729 mxPropHelper = new PropertyHelper_Spell( rxSource, rxPropSet );
730}
731
732PropertyHelper_Spelling::~PropertyHelper_Spelling()
733{
734}
735
736void PropertyHelper_Spelling::AddAsPropListener()
737{
738 mxPropHelper->AddAsPropListener();
739}
740
741void PropertyHelper_Spelling::RemoveAsPropListener()
742{
743 mxPropHelper->RemoveAsPropListener();
744}
745
746void PropertyHelper_Spelling::SetTmpPropVals( const css::beans::PropertyValues &rPropVals )
747{
748 mxPropHelper->SetTmpPropVals( rPropVals );
749}
750
751bool PropertyHelper_Spelling::IsSpellUpperCase() const
752{
753 return mxPropHelper->IsSpellUpperCase();
754}
755
756bool PropertyHelper_Spelling::IsSpellWithDigits() const
757{
758 return mxPropHelper->IsSpellWithDigits();
759}
760
761bool PropertyHelper_Spelling::IsSpellCapitalization() const
762{
763 return mxPropHelper->IsSpellCapitalization();
764}
765
766bool PropertyHelper_Spelling::IsSpellClosedCompound() const
767{
768 return mxPropHelper->IsSpellClosedCompound();
769}
770
771bool PropertyHelper_Spelling::IsSpellHyphenatedCompound() const
772{
773 return mxPropHelper->IsSpellHyphenatedCompound();
774}
775
776bool PropertyHelper_Spelling::addLinguServiceEventListener(
777 const css::uno::Reference<
778 css::linguistic2::XLinguServiceEventListener >& rxListener )
779{
780 return mxPropHelper->addLinguServiceEventListener( rxListener );
781}
782
783bool PropertyHelper_Spelling::removeLinguServiceEventListener(
784 const css::uno::Reference<
785 css::linguistic2::XLinguServiceEventListener >& rxListener )
786{
787 return mxPropHelper->removeLinguServiceEventListener( rxListener );
788}
789
790} // namespace linguistic
791
792/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void GetCurrentValues() override
virtual bool propertyChange_Impl(const css::beans::PropertyChangeEvent &rEvt) override
virtual ~PropertyHelper_Hyphen() override
virtual void SetTmpPropVals(const css::beans::PropertyValues &rPropVals) override
PropertyHelper_Hyphen(const PropertyHelper_Hyphen &)=delete
virtual void SetDefaultValues() override
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &rEvt) override
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &rEvt) override
int nCount
#define UPH_HYPH_MIN_WORD_LENGTH
#define UPH_IS_SPELL_WITH_DIGITS
#define UPH_IS_SPELL_CLOSED_COMPOUND
#define UPH_HYPH_MIN_LEADING
#define UPH_IS_SPELL_HYPHENATED_COMPOUND
constexpr OUStringLiteral UPN_HYPH_NO_CAPS
constexpr OUStringLiteral UPN_IS_USE_DICTIONARY_LIST
constexpr OUStringLiteral UPN_HYPH_MIN_WORD_LENGTH
constexpr OUStringLiteral UPN_HYPH_MIN_LEADING
#define UPH_IS_SPELL_UPPER_CASE
constexpr OUStringLiteral UPN_IS_IGNORE_CONTROL_CHARACTERS
#define UPH_HYPH_MIN_TRAILING
constexpr OUStringLiteral UPN_HYPH_MIN_TRAILING
#define UPH_HYPH_NO_CAPS
#define UPH_IS_USE_DICTIONARY_LIST
#define UPH_IS_SPELL_CAPITALIZATION
#define UPH_IS_IGNORE_CONTROL_CHARACTERS
#define AE_HYPHENATOR
Definition: lngprophelp.hxx:47
#define AE_SPELLCHECKER
Definition: lngprophelp.hxx:46
constexpr OUStringLiteral UPN_MAX_NUMBER_OF_SUGGESTIONS
Definition: lngprops.hxx:27
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
std::map< sal_Int32, std::shared_ptr< SetItemPropertyStorage > > PropertyValues
osl::Mutex & GetLinguMutex()
! multi-thread safe mutex for all platforms !!
Definition: misc.cxx:60
const PropertyStruct aPropNames[]
unsigned char sal_Bool