20#ifndef INCLUDED_LINGUISTIC_LNGPROPHELP_HXX
21#define INCLUDED_LINGUISTIC_LNGPROPHELP_HXX
25#include <com/sun/star/beans/XPropertyChangeListener.hpp>
26#include <com/sun/star/beans/PropertyValues.hpp>
27#include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp>
30#include <config_options.h>
46#define AE_SPELLCHECKER 1
47#define AE_HYPHENATOR 2
49typedef cppu::WeakImplHelper
51 css::beans::XPropertyChangeListener,
52 css::linguistic2::XLinguServiceEventBroadcaster
55class UNLESS_MERGELIBS(LNG_DLLPUBLIC) PropertyChgHelper :
59 css::uno::Reference< css::uno::XInterface > xMyEvtObj;
61 css::uno::Reference< css::beans::XPropertySet > xPropSet;
66 bool bIsIgnoreControlCharacters;
67 bool bIsUseDictionaryList;
70 bool bResIsIgnoreControlCharacters;
71 bool bResIsUseDictionaryList;
73 PropertyChgHelper(
const PropertyChgHelper & ) =
delete;
74 PropertyChgHelper & operator = (
const PropertyChgHelper & ) =
delete;
77 virtual void SetDefaultValues();
78 virtual void GetCurrentValues();
80 std::vector< OUString > & GetPropNames() {
return aPropNames; }
82 css::beans::XPropertySet > &
83 GetPropSet() {
return xPropSet; }
85 virtual bool propertyChange_Impl(
const css::beans::PropertyChangeEvent& rEvt );
89 const css::uno::Reference< css::uno::XInterface > &rxSource,
90 css::uno::Reference< css::linguistic2::XLinguProperties >
const &rxPropSet,
92 virtual ~PropertyChgHelper()
override;
94 virtual void SetTmpPropVals(
const css::beans::PropertyValues &rPropVals );
98 disposing(
const css::lang::EventObject& rSource )
override;
101 virtual void SAL_CALL
102 propertyChange(
const css::beans::PropertyChangeEvent& rEvt )
override;
106 addLinguServiceEventListener(
107 const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >& rxListener )
override;
109 removeLinguServiceEventListener(
110 const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >& rxListener )
override;
113 void AddAsPropListener();
114 void RemoveAsPropListener();
115 void LaunchEvent(
const css::linguistic2::LinguServiceEvent& rEvt );
117 const std::vector< OUString > &
119 const css::uno::Reference< css::beans::XPropertySet > &
120 GetPropSet()
const {
return xPropSet; }
121 const css::uno::Reference< css::uno::XInterface > &
122 GetEvtObj()
const {
return xMyEvtObj; }
127 public PropertyChgHelper
134 const css::uno::Reference< css::uno::XInterface > &rxSource,
135 css::uno::Reference< css::linguistic2::XLinguProperties >
const &rxPropSet );
139 virtual void SAL_CALL
140 propertyChange(
const css::beans::PropertyChangeEvent& rEvt )
override;
143class UNLESS_MERGELIBS(LNG_DLLPUBLIC) PropertyHelper_Thesaurus
152 PropertyHelper_Thesaurus(
153 const css::uno::Reference< css::uno::XInterface > &rxSource,
154 css::uno::Reference< css::linguistic2::XLinguProperties >
const &rxPropSet );
155 ~PropertyHelper_Thesaurus();
156 void AddAsPropListener();
157 void RemoveAsPropListener();
158 void SetTmpPropVals(
const css::beans::PropertyValues &rPropVals );
162class UNLESS_MERGELIBS(LNG_DLLPUBLIC) PropertyHelper_Spell final :
163 public PropertyChgHelper
166 bool bIsSpellUpperCase;
167 bool bIsSpellWithDigits;
168 bool bIsSpellCapitalization;
169 bool bIsSpellClosedCompound;
170 bool bIsSpellHyphenatedCompound;
173 bool bResIsSpellUpperCase;
174 bool bResIsSpellWithDigits;
175 bool bResIsSpellCapitalization;
176 bool bResIsSpellClosedCompound;
177 bool bResIsSpellHyphenatedCompound;
179 PropertyHelper_Spell(
const PropertyHelper_Spell & ) =
delete;
180 PropertyHelper_Spell & operator = (
const PropertyHelper_Spell & ) =
delete;
183 virtual void SetDefaultValues()
override;
184 virtual void GetCurrentValues()
override;
185 virtual bool propertyChange_Impl(
186 const css::beans::PropertyChangeEvent& rEvt )
override;
189 PropertyHelper_Spell(
190 const css::uno::Reference< css::uno::XInterface > &rxSource,
191 css::uno::Reference< css::linguistic2::XLinguProperties >
const &rxPropSet );
192 virtual ~PropertyHelper_Spell()
override;
194 virtual void SetTmpPropVals(
const css::beans::PropertyValues &rPropVals )
override;
197 virtual void SAL_CALL
198 propertyChange(
const css::beans::PropertyChangeEvent& rEvt )
override;
200 bool IsSpellUpperCase()
const {
return bResIsSpellUpperCase; }
201 bool IsSpellWithDigits()
const {
return bResIsSpellWithDigits; }
202 bool IsSpellCapitalization()
const {
return bResIsSpellCapitalization; }
203 bool IsSpellClosedCompound()
const {
return bResIsSpellClosedCompound; }
204 bool IsSpellHyphenatedCompound()
const {
return bResIsSpellHyphenatedCompound; }
208class UNLESS_MERGELIBS(LNG_DLLPUBLIC) PropertyHelper_Spelling
213 PropertyHelper_Spelling(
const PropertyHelper_Spell & ) =
delete;
214 PropertyHelper_Spelling & operator = (
const PropertyHelper_Spell & ) =
delete;
217 PropertyHelper_Spelling(
218 const css::uno::Reference< css::uno::XInterface > &rxSource,
219 css::uno::Reference< css::linguistic2::XLinguProperties >
const &rxPropSet );
220 ~PropertyHelper_Spelling();
222 void AddAsPropListener();
223 void RemoveAsPropListener();
224 void SetTmpPropVals(
const css::beans::PropertyValues &rPropVals );
225 bool IsSpellUpperCase()
const;
226 bool IsSpellWithDigits()
const;
227 bool IsSpellCapitalization()
const;
228 bool IsSpellClosedCompound()
const;
229 bool IsSpellHyphenatedCompound()
const;
231 bool addLinguServiceEventListener(
232 const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >& rxListener );
234 bool removeLinguServiceEventListener(
235 const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >& rxListener );
240 public PropertyChgHelper
258 virtual void SetDefaultValues()
override;
259 virtual void GetCurrentValues()
override;
260 virtual bool propertyChange_Impl(
261 const css::beans::PropertyChangeEvent& rEvt )
override;
265 const css::uno::Reference< css::uno::XInterface > &rxSource,
266 css::uno::Reference< css::linguistic2::XLinguProperties >
const &rxPropSet);
269 virtual void SetTmpPropVals(
const css::beans::PropertyValues &rPropVals )
override;
272 virtual void SAL_CALL
273 propertyChange(
const css::beans::PropertyChangeEvent& rEvt )
override;
281class UNLESS_MERGELIBS(LNG_DLLPUBLIC) PropertyHelper_Hyphenation
286 PropertyHelper_Hyphenation(
const PropertyHelper_Hyphen & ) =
delete;
287 PropertyHelper_Hyphenation & operator = (
const PropertyHelper_Hyphen & ) =
delete;
290 PropertyHelper_Hyphenation(
291 const css::uno::Reference< css::uno::XInterface > &rxSource,
292 css::uno::Reference< css::linguistic2::XLinguProperties >
const &rxPropSet);
293 ~PropertyHelper_Hyphenation();
295 void AddAsPropListener();
296 void RemoveAsPropListener();
297 void SetTmpPropVals(
const css::beans::PropertyValues &rPropVals );
298 sal_Int16 GetMinLeading()
const;
299 sal_Int16 GetMinTrailing()
const;
300 sal_Int16 GetMinWordLength()
const;
301 bool IsNoHyphenateCaps()
const;
303 bool addLinguServiceEventListener(
304 const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >& rxListener );
306 bool removeLinguServiceEventListener(
307 const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >& rxListener );
sal_Int16 GetMinTrailing() const
sal_Int16 GetMinLeading() const
PropertyHelper_Hyphen(const css::uno::Reference< css::uno::XInterface > &rxSource, css::uno::Reference< css::linguistic2::XLinguProperties > const &rxPropSet)
sal_Int16 nResHyphMinWordLength
sal_Int16 GetMinWordLength() const
sal_Int16 nHyphMinWordLength
sal_Int16 nResHyphMinLeading
PropertyHelper_Hyphen(const PropertyHelper_Hyphen &)=delete
sal_Int16 nHyphMinLeading
bool IsNoHyphenateCaps() const
sal_Int16 nHyphMinTrailing
sal_Int16 nResHyphMinTrailing
PropertyHelper_Thes(const PropertyHelper_Thes &)=delete
PropertyHelper_Thes(const css::uno::Reference< css::uno::XInterface > &rxSource, css::uno::Reference< css::linguistic2::XLinguProperties > const &rxPropSet)
class SAL_NO_VTABLE XPropertySet
cppu::WeakImplHelper< css::beans::XPropertyChangeListener, css::linguistic2::XLinguServiceEventBroadcaster > PropertyChgHelperBase
const PropertyStruct aPropNames[]