15900e8ecSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
35900e8ecSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
45900e8ecSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
55900e8ecSAndrew Rist  * distributed with this work for additional information
65900e8ecSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
75900e8ecSAndrew Rist  * to you under the Apache License, Version 2.0 (the
85900e8ecSAndrew Rist  * "License"); you may not use this file except in compliance
95900e8ecSAndrew Rist  * with the License.  You may obtain a copy of the License at
105900e8ecSAndrew Rist  *
115900e8ecSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
125900e8ecSAndrew Rist  *
135900e8ecSAndrew Rist  * Unless required by applicable law or agreed to in writing,
145900e8ecSAndrew Rist  * software distributed under the License is distributed on an
155900e8ecSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
165900e8ecSAndrew Rist  * KIND, either express or implied.  See the License for the
175900e8ecSAndrew Rist  * specific language governing permissions and limitations
185900e8ecSAndrew Rist  * under the License.
195900e8ecSAndrew Rist  *
205900e8ecSAndrew Rist  *************************************************************/
215900e8ecSAndrew Rist 
225900e8ecSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svtools.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svtools/accessibilityoptions.hxx>
28cdf0e10cSrcweir #include "configitems/accessibilityoptions_const.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <unotools/configmgr.hxx>
31cdf0e10cSrcweir #include <tools/debug.hxx>
32cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
33cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
36cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
39cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp>
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir #ifndef _COMPHELPER_CONFIGURATIONHELPER_HXX_
42cdf0e10cSrcweir #include <comphelper/configurationhelper.hxx>
43cdf0e10cSrcweir #endif
44cdf0e10cSrcweir #ifndef _UNOTOOLS_PROCESSFACTORY_HXX_
45cdf0e10cSrcweir #include <unotools/processfactory.hxx>
46cdf0e10cSrcweir #endif
47cdf0e10cSrcweir #ifndef _SVT_LOGHELPER_HXX_
48cdf0e10cSrcweir #include <unotools/loghelper.hxx>
49cdf0e10cSrcweir #endif
50cdf0e10cSrcweir 
51cdf0e10cSrcweir #include <svl/smplhint.hxx>
52cdf0e10cSrcweir 
53cdf0e10cSrcweir #include <vcl/settings.hxx>
54cdf0e10cSrcweir #include <vcl/svapp.hxx>
55cdf0e10cSrcweir #include <rtl/instance.hxx>
56cdf0e10cSrcweir 
57cdf0e10cSrcweir #include <itemholder2.hxx>
58cdf0e10cSrcweir 
59cdf0e10cSrcweir using namespace utl;
60cdf0e10cSrcweir using namespace rtl;
61cdf0e10cSrcweir using namespace com::sun::star::uno;
62cdf0e10cSrcweir namespace css = com::sun::star;
63cdf0e10cSrcweir 
64cdf0e10cSrcweir #define HELP_TIP_TIMEOUT 0xffff     // max. timeout setting to pretend a non-timeout
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 
67cdf0e10cSrcweir // class SvtAccessibilityOptions_Impl ---------------------------------------------
68cdf0e10cSrcweir 
69cdf0e10cSrcweir class SvtAccessibilityOptions_Impl
70cdf0e10cSrcweir {
71cdf0e10cSrcweir private:
72cdf0e10cSrcweir 	css::uno::Reference< css::container::XNameAccess > m_xCfg;
73cdf0e10cSrcweir 	sal_Bool										   bIsModified;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir public:
76cdf0e10cSrcweir 	SvtAccessibilityOptions_Impl();
77cdf0e10cSrcweir 	~SvtAccessibilityOptions_Impl();
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 	void		SetVCLSettings();
80cdf0e10cSrcweir 	sal_Bool	GetAutoDetectSystemHC();
81cdf0e10cSrcweir 	sal_Bool	GetIsForPagePreviews() const;
82cdf0e10cSrcweir 	sal_Bool	GetIsHelpTipsDisappear() const;
83cdf0e10cSrcweir 	sal_Bool	GetIsAllowAnimatedGraphics() const;
84cdf0e10cSrcweir 	sal_Bool	GetIsAllowAnimatedText() const;
85cdf0e10cSrcweir 	sal_Bool	GetIsAutomaticFontColor() const;
86cdf0e10cSrcweir 	sal_Bool	GetIsSystemFont() const;
87cdf0e10cSrcweir 	sal_Int16	GetHelpTipSeconds() const;
88cdf0e10cSrcweir 	sal_Bool	IsSelectionInReadonly() const;
89ca6f8f21SArmin Le Grand     sal_Int16   GetEdgeBlending() const;
90a68b38dfSArmin Le Grand     sal_Int16   GetListBoxMaximumLineCount() const;
91e2020f46SArmin Le Grand     sal_Int16   GetColorValueSetColumnCount() const;
92*33b19716SArmin Le Grand     sal_Bool    GetPreviewUsesCheckeredBackground() const;
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	void		SetAutoDetectSystemHC(sal_Bool bSet);
95cdf0e10cSrcweir 	void		SetIsForPagePreviews(sal_Bool bSet);
96cdf0e10cSrcweir 	void		SetIsHelpTipsDisappear(sal_Bool bSet);
97cdf0e10cSrcweir 	void		SetIsAllowAnimatedGraphics(sal_Bool bSet);
98cdf0e10cSrcweir 	void		SetIsAllowAnimatedText(sal_Bool bSet);
99cdf0e10cSrcweir 	void		SetIsAutomaticFontColor(sal_Bool bSet);
100cdf0e10cSrcweir 	void		SetIsSystemFont(sal_Bool bSet);
101cdf0e10cSrcweir 	void		SetHelpTipSeconds(sal_Int16 nSet);
102cdf0e10cSrcweir 	void		SetSelectionInReadonly(sal_Bool bSet);
103ca6f8f21SArmin Le Grand     void        SetEdgeBlending(sal_Int16 nSet);
104a68b38dfSArmin Le Grand     void        SetListBoxMaximumLineCount(sal_Int16 nSet);
105e2020f46SArmin Le Grand     void        SetColorValueSetColumnCount(sal_Int16 nSet);
106*33b19716SArmin Le Grand     void        SetPreviewUsesCheckeredBackground(sal_Bool bSet);
107cdf0e10cSrcweir 
IsModified() const108cdf0e10cSrcweir 	sal_Bool	IsModified() const { return bIsModified; };
109cdf0e10cSrcweir };
110cdf0e10cSrcweir 
111cdf0e10cSrcweir // initialization of static members --------------------------------------
112cdf0e10cSrcweir 
113cdf0e10cSrcweir SvtAccessibilityOptions_Impl* volatile 	SvtAccessibilityOptions::sm_pSingleImplConfig =NULL;
114cdf0e10cSrcweir sal_Int32					  volatile 	SvtAccessibilityOptions::sm_nAccessibilityRefCount(0);
115cdf0e10cSrcweir 
116cdf0e10cSrcweir namespace
117cdf0e10cSrcweir {
118cdf0e10cSrcweir 	struct SingletonMutex
119cdf0e10cSrcweir 		: public rtl::Static< ::osl::Mutex, SingletonMutex > {};
120cdf0e10cSrcweir }
121cdf0e10cSrcweir 
122cdf0e10cSrcweir // -----------------------------------------------------------------------
123cdf0e10cSrcweir // class SvtAccessibilityOptions_Impl ---------------------------------------------
124cdf0e10cSrcweir 
SvtAccessibilityOptions_Impl()125cdf0e10cSrcweir SvtAccessibilityOptions_Impl::SvtAccessibilityOptions_Impl()
126cdf0e10cSrcweir {
127cdf0e10cSrcweir 	try
128cdf0e10cSrcweir 	{
129cdf0e10cSrcweir 		m_xCfg = css::uno::Reference< css::container::XNameAccess >(
130cdf0e10cSrcweir 			::comphelper::ConfigurationHelper::openConfig(
131cdf0e10cSrcweir 			utl::getProcessServiceFactory(),
132cdf0e10cSrcweir 			s_sAccessibility,
133cdf0e10cSrcweir 			::comphelper::ConfigurationHelper::E_STANDARD),
134cdf0e10cSrcweir 			css::uno::UNO_QUERY);
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 		bIsModified = sal_False;
137cdf0e10cSrcweir 	}
138cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
139cdf0e10cSrcweir 	{
140cdf0e10cSrcweir 		m_xCfg.clear();
141cdf0e10cSrcweir 		LogHelper::logIt(ex);
142cdf0e10cSrcweir 	}
143cdf0e10cSrcweir }
144cdf0e10cSrcweir 
~SvtAccessibilityOptions_Impl()145cdf0e10cSrcweir SvtAccessibilityOptions_Impl::~SvtAccessibilityOptions_Impl()
146cdf0e10cSrcweir {
147cdf0e10cSrcweir }
148cdf0e10cSrcweir 
149cdf0e10cSrcweir // -----------------------------------------------------------------------
GetAutoDetectSystemHC()150cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions_Impl::GetAutoDetectSystemHC()
151cdf0e10cSrcweir {
152cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
153cdf0e10cSrcweir 	sal_Bool										bRet = sal_True;
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 	try
156cdf0e10cSrcweir 	{
157cdf0e10cSrcweir 		if(xNode.is())
158cdf0e10cSrcweir 			xNode->getPropertyValue(s_sAutoDetectSystemHC) >>= bRet;
159cdf0e10cSrcweir 	}
160cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
161cdf0e10cSrcweir 	{
162cdf0e10cSrcweir 		LogHelper::logIt(ex);
163cdf0e10cSrcweir 	}
164cdf0e10cSrcweir 
165cdf0e10cSrcweir 	return bRet;
166cdf0e10cSrcweir }
167cdf0e10cSrcweir 
GetIsForPagePreviews() const168cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions_Impl::GetIsForPagePreviews() const
169cdf0e10cSrcweir {
170cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
171cdf0e10cSrcweir 	sal_Bool										bRet = sal_True;
172cdf0e10cSrcweir 
173cdf0e10cSrcweir 	try
174cdf0e10cSrcweir 	{
175cdf0e10cSrcweir 		if(xNode.is())
176cdf0e10cSrcweir 			xNode->getPropertyValue(s_sIsForPagePreviews) >>= bRet;
177cdf0e10cSrcweir 	}
178cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
179cdf0e10cSrcweir 	{
180cdf0e10cSrcweir 		LogHelper::logIt(ex);
181cdf0e10cSrcweir 	}
182cdf0e10cSrcweir 	return bRet;
183cdf0e10cSrcweir }
184cdf0e10cSrcweir 
GetIsHelpTipsDisappear() const185cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions_Impl::GetIsHelpTipsDisappear() const
186cdf0e10cSrcweir {
187cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
188cdf0e10cSrcweir 	sal_Bool										bRet = sal_True;
189cdf0e10cSrcweir 
190cdf0e10cSrcweir 	try
191cdf0e10cSrcweir 	{
192cdf0e10cSrcweir 		if(xNode.is())
193cdf0e10cSrcweir 			xNode->getPropertyValue(s_sIsHelpTipsDisappear) >>= bRet;
194cdf0e10cSrcweir 	}
195cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
196cdf0e10cSrcweir 	{
197cdf0e10cSrcweir 		LogHelper::logIt(ex);
198cdf0e10cSrcweir 	}
199cdf0e10cSrcweir 
200cdf0e10cSrcweir 	return bRet;
201cdf0e10cSrcweir }
202cdf0e10cSrcweir 
GetIsAllowAnimatedGraphics() const203cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions_Impl::GetIsAllowAnimatedGraphics() const
204cdf0e10cSrcweir {
205cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
206cdf0e10cSrcweir 	sal_Bool										bRet = sal_True;
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 	try
209cdf0e10cSrcweir 	{
210cdf0e10cSrcweir 		if(xNode.is())
211cdf0e10cSrcweir 			xNode->getPropertyValue(s_sIsAllowAnimatedGraphics) >>= bRet;
212cdf0e10cSrcweir 	}
213cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
214cdf0e10cSrcweir 	{
215cdf0e10cSrcweir 		LogHelper::logIt(ex);
216cdf0e10cSrcweir 	}
217cdf0e10cSrcweir 
218cdf0e10cSrcweir 	return bRet;
219cdf0e10cSrcweir }
220cdf0e10cSrcweir 
GetIsAllowAnimatedText() const221cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions_Impl::GetIsAllowAnimatedText() const
222cdf0e10cSrcweir {
223cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
224cdf0e10cSrcweir 	sal_Bool										bRet = sal_True;
225cdf0e10cSrcweir 
226cdf0e10cSrcweir 	try
227cdf0e10cSrcweir 	{
228cdf0e10cSrcweir 		if(xNode.is())
229cdf0e10cSrcweir 			xNode->getPropertyValue(s_sIsAllowAnimatedText) >>= bRet;
230cdf0e10cSrcweir 	}
231cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
232cdf0e10cSrcweir 	{
233cdf0e10cSrcweir 		LogHelper::logIt(ex);
234cdf0e10cSrcweir 	}
235cdf0e10cSrcweir 
236cdf0e10cSrcweir 	return bRet;
237cdf0e10cSrcweir }
238cdf0e10cSrcweir 
GetIsAutomaticFontColor() const239cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions_Impl::GetIsAutomaticFontColor() const
240cdf0e10cSrcweir {
241cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
242cdf0e10cSrcweir 	sal_Bool										bRet = sal_False;
243cdf0e10cSrcweir 
244cdf0e10cSrcweir 	try
245cdf0e10cSrcweir 	{
246cdf0e10cSrcweir 		if(xNode.is())
247cdf0e10cSrcweir 			xNode->getPropertyValue(s_sIsAutomaticFontColor) >>= bRet;
248cdf0e10cSrcweir 	}
249cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
250cdf0e10cSrcweir 	{
251cdf0e10cSrcweir 		LogHelper::logIt(ex);
252cdf0e10cSrcweir 	}
253cdf0e10cSrcweir 
254cdf0e10cSrcweir 	return bRet;
255cdf0e10cSrcweir }
256cdf0e10cSrcweir 
GetIsSystemFont() const257cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions_Impl::GetIsSystemFont() const
258cdf0e10cSrcweir {
259cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
260cdf0e10cSrcweir 	sal_Bool										bRet = sal_True;
261cdf0e10cSrcweir 
262cdf0e10cSrcweir 	try
263cdf0e10cSrcweir 	{
264cdf0e10cSrcweir 		if(xNode.is())
265cdf0e10cSrcweir 			xNode->getPropertyValue(s_sIsSystemFont) >>= bRet;
266cdf0e10cSrcweir 	}
267cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
268cdf0e10cSrcweir 	{
269cdf0e10cSrcweir 		LogHelper::logIt(ex);
270cdf0e10cSrcweir 	}
271cdf0e10cSrcweir 
272cdf0e10cSrcweir 	return bRet;
273cdf0e10cSrcweir }
274cdf0e10cSrcweir 
GetHelpTipSeconds() const275cdf0e10cSrcweir sal_Int16 SvtAccessibilityOptions_Impl::GetHelpTipSeconds() const
276cdf0e10cSrcweir {
277cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
278cdf0e10cSrcweir 	sal_Int16										nRet = 4;
279cdf0e10cSrcweir 
280cdf0e10cSrcweir 	try
281cdf0e10cSrcweir 	{
282cdf0e10cSrcweir 		if(xNode.is())
283cdf0e10cSrcweir 			xNode->getPropertyValue(s_sHelpTipSeconds) >>= nRet;
284cdf0e10cSrcweir 	}
285cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
286cdf0e10cSrcweir 	{
287cdf0e10cSrcweir 		LogHelper::logIt(ex);
288cdf0e10cSrcweir 	}
289cdf0e10cSrcweir 
290cdf0e10cSrcweir 	return nRet;
291cdf0e10cSrcweir }
292cdf0e10cSrcweir 
IsSelectionInReadonly() const293cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions_Impl::IsSelectionInReadonly() const
294cdf0e10cSrcweir {
295cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
296cdf0e10cSrcweir 	sal_Bool										bRet = sal_False;
297cdf0e10cSrcweir 
298cdf0e10cSrcweir 	try
299cdf0e10cSrcweir 	{
300cdf0e10cSrcweir 		if(xNode.is())
301cdf0e10cSrcweir 			xNode->getPropertyValue(s_sIsSelectionInReadonly) >>= bRet;
302cdf0e10cSrcweir 	}
303cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
304cdf0e10cSrcweir 	{
305cdf0e10cSrcweir 		LogHelper::logIt(ex);
306cdf0e10cSrcweir 	}
307cdf0e10cSrcweir 
308cdf0e10cSrcweir 	return bRet;
309cdf0e10cSrcweir }
310cdf0e10cSrcweir 
GetEdgeBlending() const311a68b38dfSArmin Le Grand sal_Int16 SvtAccessibilityOptions_Impl::GetEdgeBlending() const
312ca6f8f21SArmin Le Grand {
313ca6f8f21SArmin Le Grand     css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
314a68b38dfSArmin Le Grand     sal_Int16 nRet = 35;
315ca6f8f21SArmin Le Grand 
316ca6f8f21SArmin Le Grand     try
317ca6f8f21SArmin Le Grand     {
318ca6f8f21SArmin Le Grand         if(xNode.is())
319a68b38dfSArmin Le Grand             xNode->getPropertyValue(s_sEdgeBlending) >>= nRet;
320ca6f8f21SArmin Le Grand     }
321ca6f8f21SArmin Le Grand     catch(const css::uno::Exception& ex)
322ca6f8f21SArmin Le Grand     {
323ca6f8f21SArmin Le Grand         LogHelper::logIt(ex);
324ca6f8f21SArmin Le Grand     }
325ca6f8f21SArmin Le Grand 
326ca6f8f21SArmin Le Grand     return nRet;
327ca6f8f21SArmin Le Grand }
328ca6f8f21SArmin Le Grand 
GetListBoxMaximumLineCount() const329a68b38dfSArmin Le Grand sal_Int16 SvtAccessibilityOptions_Impl::GetListBoxMaximumLineCount() const
330ca6f8f21SArmin Le Grand {
331ca6f8f21SArmin Le Grand     css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
332a68b38dfSArmin Le Grand     sal_Int16 nRet = 25;
333ca6f8f21SArmin Le Grand 
334ca6f8f21SArmin Le Grand     try
335ca6f8f21SArmin Le Grand     {
336ca6f8f21SArmin Le Grand         if(xNode.is())
337a68b38dfSArmin Le Grand             xNode->getPropertyValue(s_sListBoxMaximumLineCount) >>= nRet;
338ca6f8f21SArmin Le Grand     }
339ca6f8f21SArmin Le Grand     catch(const css::uno::Exception& ex)
340ca6f8f21SArmin Le Grand     {
341ca6f8f21SArmin Le Grand         LogHelper::logIt(ex);
342ca6f8f21SArmin Le Grand     }
343ca6f8f21SArmin Le Grand 
344ca6f8f21SArmin Le Grand     return nRet;
345ca6f8f21SArmin Le Grand }
346ca6f8f21SArmin Le Grand 
GetColorValueSetColumnCount() const347e2020f46SArmin Le Grand sal_Int16 SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() const
348e2020f46SArmin Le Grand {
349e2020f46SArmin Le Grand     css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
350e2020f46SArmin Le Grand     sal_Int16 nRet = 12;
351e2020f46SArmin Le Grand 
352e2020f46SArmin Le Grand     try
353e2020f46SArmin Le Grand     {
354e2020f46SArmin Le Grand         if(xNode.is())
355e2020f46SArmin Le Grand             xNode->getPropertyValue(s_sColorValueSetColumnCount) >>= nRet;
356e2020f46SArmin Le Grand     }
357e2020f46SArmin Le Grand     catch(const css::uno::Exception& ex)
358e2020f46SArmin Le Grand     {
359e2020f46SArmin Le Grand         LogHelper::logIt(ex);
360e2020f46SArmin Le Grand     }
361e2020f46SArmin Le Grand 
362e2020f46SArmin Le Grand     return nRet;
363e2020f46SArmin Le Grand }
364e2020f46SArmin Le Grand 
GetPreviewUsesCheckeredBackground() const365*33b19716SArmin Le Grand sal_Bool SvtAccessibilityOptions_Impl::GetPreviewUsesCheckeredBackground() const
366*33b19716SArmin Le Grand {
367*33b19716SArmin Le Grand     css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
368*33b19716SArmin Le Grand     sal_Bool bRet = sal_False;
369*33b19716SArmin Le Grand 
370*33b19716SArmin Le Grand     try
371*33b19716SArmin Le Grand     {
372*33b19716SArmin Le Grand         if(xNode.is())
373*33b19716SArmin Le Grand             xNode->getPropertyValue(s_sPreviewUsesCheckeredBackground) >>= bRet;
374*33b19716SArmin Le Grand     }
375*33b19716SArmin Le Grand     catch(const css::uno::Exception& ex)
376*33b19716SArmin Le Grand     {
377*33b19716SArmin Le Grand         LogHelper::logIt(ex);
378*33b19716SArmin Le Grand     }
379*33b19716SArmin Le Grand 
380*33b19716SArmin Le Grand     return bRet;
381*33b19716SArmin Le Grand }
382*33b19716SArmin Le Grand 
SetAutoDetectSystemHC(sal_Bool bSet)383cdf0e10cSrcweir void SvtAccessibilityOptions_Impl::SetAutoDetectSystemHC(sal_Bool bSet)
384cdf0e10cSrcweir {
385cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
386cdf0e10cSrcweir 
387cdf0e10cSrcweir 	try
388cdf0e10cSrcweir 	{
389cdf0e10cSrcweir 		if(xNode.is() && xNode->getPropertyValue(s_sAutoDetectSystemHC)!=bSet)
390cdf0e10cSrcweir 		{
391cdf0e10cSrcweir 			xNode->setPropertyValue(s_sAutoDetectSystemHC, css::uno::makeAny(bSet));
392cdf0e10cSrcweir 			::comphelper::ConfigurationHelper::flush(m_xCfg);
393cdf0e10cSrcweir 
394cdf0e10cSrcweir 			bIsModified = sal_True;
395cdf0e10cSrcweir 		}
396cdf0e10cSrcweir 	}
397cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
398cdf0e10cSrcweir 	{
399cdf0e10cSrcweir 		LogHelper::logIt(ex);
400cdf0e10cSrcweir 	}
401cdf0e10cSrcweir }
402cdf0e10cSrcweir 
SetIsForPagePreviews(sal_Bool bSet)403cdf0e10cSrcweir void SvtAccessibilityOptions_Impl::SetIsForPagePreviews(sal_Bool bSet)
404cdf0e10cSrcweir {
405cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
406cdf0e10cSrcweir 
407cdf0e10cSrcweir 	try
408cdf0e10cSrcweir 	{
409cdf0e10cSrcweir 		if(xNode.is() && xNode->getPropertyValue(s_sIsForPagePreviews)!=bSet)
410cdf0e10cSrcweir 		{
411cdf0e10cSrcweir 			xNode->setPropertyValue(s_sIsForPagePreviews, css::uno::makeAny(bSet));
412cdf0e10cSrcweir 			::comphelper::ConfigurationHelper::flush(m_xCfg);
413cdf0e10cSrcweir 
414cdf0e10cSrcweir 			bIsModified = sal_True;
415cdf0e10cSrcweir 		}
416cdf0e10cSrcweir 	}
417cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
418cdf0e10cSrcweir 	{
419cdf0e10cSrcweir 		LogHelper::logIt(ex);
420cdf0e10cSrcweir 	}
421cdf0e10cSrcweir }
422cdf0e10cSrcweir 
SetIsHelpTipsDisappear(sal_Bool bSet)423cdf0e10cSrcweir void SvtAccessibilityOptions_Impl::SetIsHelpTipsDisappear(sal_Bool bSet)
424cdf0e10cSrcweir {
425cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
426cdf0e10cSrcweir 
427cdf0e10cSrcweir 	try
428cdf0e10cSrcweir 	{
429cdf0e10cSrcweir 		if(xNode.is() && xNode->getPropertyValue(s_sIsHelpTipsDisappear)!=bSet)
430cdf0e10cSrcweir 		{
431cdf0e10cSrcweir 			xNode->setPropertyValue(s_sIsHelpTipsDisappear, css::uno::makeAny(bSet));
432cdf0e10cSrcweir 			::comphelper::ConfigurationHelper::flush(m_xCfg);
433cdf0e10cSrcweir 
434cdf0e10cSrcweir 			bIsModified = sal_True;
435cdf0e10cSrcweir 		}
436cdf0e10cSrcweir 	}
437cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
438cdf0e10cSrcweir 	{
439cdf0e10cSrcweir 		LogHelper::logIt(ex);
440cdf0e10cSrcweir 	}
441cdf0e10cSrcweir }
442cdf0e10cSrcweir 
SetIsAllowAnimatedGraphics(sal_Bool bSet)443cdf0e10cSrcweir void SvtAccessibilityOptions_Impl::SetIsAllowAnimatedGraphics(sal_Bool bSet)
444cdf0e10cSrcweir {
445cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
446cdf0e10cSrcweir 
447cdf0e10cSrcweir 	try
448cdf0e10cSrcweir 	{
449cdf0e10cSrcweir 		if(xNode.is() && xNode->getPropertyValue(s_sIsAllowAnimatedGraphics)!=bSet)
450cdf0e10cSrcweir 		{
451cdf0e10cSrcweir 			xNode->setPropertyValue(s_sIsAllowAnimatedGraphics, css::uno::makeAny(bSet));
452cdf0e10cSrcweir 			::comphelper::ConfigurationHelper::flush(m_xCfg);
453cdf0e10cSrcweir 
454cdf0e10cSrcweir 			bIsModified = sal_True;
455cdf0e10cSrcweir 		}
456cdf0e10cSrcweir 	}
457cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
458cdf0e10cSrcweir 	{
459cdf0e10cSrcweir 		LogHelper::logIt(ex);
460cdf0e10cSrcweir 	}
461cdf0e10cSrcweir }
462cdf0e10cSrcweir 
SetIsAllowAnimatedText(sal_Bool bSet)463cdf0e10cSrcweir void SvtAccessibilityOptions_Impl::SetIsAllowAnimatedText(sal_Bool bSet)
464cdf0e10cSrcweir {
465cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
466cdf0e10cSrcweir 
467cdf0e10cSrcweir 	try
468cdf0e10cSrcweir 	{
469cdf0e10cSrcweir 		if(xNode.is() && xNode->getPropertyValue(s_sIsAllowAnimatedText)!=bSet)
470cdf0e10cSrcweir 		{
471cdf0e10cSrcweir 			xNode->setPropertyValue(s_sIsAllowAnimatedText, css::uno::makeAny(bSet));
472cdf0e10cSrcweir 			::comphelper::ConfigurationHelper::flush(m_xCfg);
473cdf0e10cSrcweir 
474cdf0e10cSrcweir 			bIsModified = sal_True;
475cdf0e10cSrcweir 		}
476cdf0e10cSrcweir 	}
477cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
478cdf0e10cSrcweir 	{
479cdf0e10cSrcweir 		LogHelper::logIt(ex);
480cdf0e10cSrcweir 	}
481cdf0e10cSrcweir }
482cdf0e10cSrcweir 
SetIsAutomaticFontColor(sal_Bool bSet)483cdf0e10cSrcweir void SvtAccessibilityOptions_Impl::SetIsAutomaticFontColor(sal_Bool bSet)
484cdf0e10cSrcweir {
485cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
486cdf0e10cSrcweir 
487cdf0e10cSrcweir 	try
488cdf0e10cSrcweir 	{
489cdf0e10cSrcweir 		if(xNode.is() && xNode->getPropertyValue(s_sIsAutomaticFontColor)!=bSet)
490cdf0e10cSrcweir 		{
491cdf0e10cSrcweir 			xNode->setPropertyValue(s_sIsAutomaticFontColor, css::uno::makeAny(bSet));
492cdf0e10cSrcweir 			::comphelper::ConfigurationHelper::flush(m_xCfg);
493cdf0e10cSrcweir 
494cdf0e10cSrcweir 			bIsModified = sal_True;
495cdf0e10cSrcweir 		}
496cdf0e10cSrcweir 	}
497cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
498cdf0e10cSrcweir 	{
499cdf0e10cSrcweir 		LogHelper::logIt(ex);
500cdf0e10cSrcweir 	}
501cdf0e10cSrcweir }
502cdf0e10cSrcweir 
SetIsSystemFont(sal_Bool bSet)503cdf0e10cSrcweir void SvtAccessibilityOptions_Impl::SetIsSystemFont(sal_Bool bSet)
504cdf0e10cSrcweir {
505cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
506cdf0e10cSrcweir 
507cdf0e10cSrcweir 	try
508cdf0e10cSrcweir 	{
509cdf0e10cSrcweir 		if(xNode.is() && xNode->getPropertyValue(s_sIsSystemFont)!=bSet)
510cdf0e10cSrcweir 		{
511cdf0e10cSrcweir 			xNode->setPropertyValue(s_sIsSystemFont, css::uno::makeAny(bSet));
512cdf0e10cSrcweir 			::comphelper::ConfigurationHelper::flush(m_xCfg);
513cdf0e10cSrcweir 
514cdf0e10cSrcweir 			bIsModified = sal_True;
515cdf0e10cSrcweir 		}
516cdf0e10cSrcweir 	}
517cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
518cdf0e10cSrcweir 	{
519cdf0e10cSrcweir 		LogHelper::logIt(ex);
520cdf0e10cSrcweir 	}
521cdf0e10cSrcweir }
522cdf0e10cSrcweir 
SetHelpTipSeconds(sal_Int16 nSet)523cdf0e10cSrcweir void SvtAccessibilityOptions_Impl::SetHelpTipSeconds(sal_Int16 nSet)
524cdf0e10cSrcweir {
525cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
526cdf0e10cSrcweir 
527cdf0e10cSrcweir 	try
528cdf0e10cSrcweir 	{
529cdf0e10cSrcweir 		if(xNode.is() && xNode->getPropertyValue(s_sHelpTipSeconds)!=nSet)
530cdf0e10cSrcweir 		{
531cdf0e10cSrcweir 			xNode->setPropertyValue(s_sHelpTipSeconds, css::uno::makeAny(nSet));
532cdf0e10cSrcweir 			::comphelper::ConfigurationHelper::flush(m_xCfg);
533cdf0e10cSrcweir 
534cdf0e10cSrcweir 			bIsModified = sal_True;
535cdf0e10cSrcweir 		}
536cdf0e10cSrcweir 	}
537cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
538cdf0e10cSrcweir 	{
539cdf0e10cSrcweir 		LogHelper::logIt(ex);
540cdf0e10cSrcweir 	}
541cdf0e10cSrcweir }
542cdf0e10cSrcweir 
SetSelectionInReadonly(sal_Bool bSet)543cdf0e10cSrcweir void SvtAccessibilityOptions_Impl::SetSelectionInReadonly(sal_Bool bSet)
544cdf0e10cSrcweir {
545cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
546cdf0e10cSrcweir 
547cdf0e10cSrcweir 	try
548cdf0e10cSrcweir 	{
549cdf0e10cSrcweir 		if(xNode.is() && xNode->getPropertyValue(s_sIsSelectionInReadonly)!=bSet)
550cdf0e10cSrcweir 		{
551cdf0e10cSrcweir 			xNode->setPropertyValue(s_sIsSelectionInReadonly, css::uno::makeAny(bSet));
552cdf0e10cSrcweir 			::comphelper::ConfigurationHelper::flush(m_xCfg);
553cdf0e10cSrcweir 
554cdf0e10cSrcweir 			bIsModified = sal_True;
555cdf0e10cSrcweir 		}
556cdf0e10cSrcweir 	}
557cdf0e10cSrcweir 	catch(const css::uno::Exception& ex)
558cdf0e10cSrcweir 	{
559cdf0e10cSrcweir 		LogHelper::logIt(ex);
560cdf0e10cSrcweir 	}
561cdf0e10cSrcweir }
562cdf0e10cSrcweir 
SetVCLSettings()563cdf0e10cSrcweir void SvtAccessibilityOptions_Impl::SetVCLSettings()
564cdf0e10cSrcweir {
565a68b38dfSArmin Le Grand     AllSettings aAllSettings(Application::GetSettings());
566a68b38dfSArmin Le Grand     StyleSettings aStyleSettings(aAllSettings.GetStyleSettings());
567a68b38dfSArmin Le Grand     HelpSettings aHelpSettings(aAllSettings.GetHelpSettings());
568a68b38dfSArmin Le Grand     bool StyleSettingsChanged(false);
569cdf0e10cSrcweir 
570a68b38dfSArmin Le Grand     aHelpSettings.SetTipTimeout( GetIsHelpTipsDisappear() ? GetHelpTipSeconds() * 1000 : HELP_TIP_TIMEOUT);
571a68b38dfSArmin Le Grand     aAllSettings.SetHelpSettings(aHelpSettings);
572cdf0e10cSrcweir 
573a68b38dfSArmin Le Grand     if(aStyleSettings.GetUseSystemUIFonts() != GetIsSystemFont())
574ca6f8f21SArmin Le Grand     {
575a68b38dfSArmin Le Grand         aStyleSettings.SetUseSystemUIFonts(GetIsSystemFont());
576a68b38dfSArmin Le Grand         StyleSettingsChanged = true;
577ca6f8f21SArmin Le Grand     }
578a68b38dfSArmin Le Grand 
579a68b38dfSArmin Le Grand     const sal_Int16 nEdgeBlendingCountA(GetEdgeBlending());
580a68b38dfSArmin Le Grand     OSL_ENSURE(nEdgeBlendingCountA >= 0, "OOps, negative values for EdgeBlending are not allowed (!)");
581a68b38dfSArmin Le Grand     const sal_uInt16 nEdgeBlendingCountB(static_cast< sal_uInt16 >(nEdgeBlendingCountA >= 0 ? nEdgeBlendingCountA : 0));
582a68b38dfSArmin Le Grand 
583a68b38dfSArmin Le Grand     if(aStyleSettings.GetEdgeBlending() != nEdgeBlendingCountB)
584ca6f8f21SArmin Le Grand     {
585a68b38dfSArmin Le Grand         aStyleSettings.SetEdgeBlending(nEdgeBlendingCountB);
586a68b38dfSArmin Le Grand         StyleSettingsChanged = true;
587ca6f8f21SArmin Le Grand     }
588ca6f8f21SArmin Le Grand 
589a68b38dfSArmin Le Grand     const sal_Int16 nMaxLineCountA(GetListBoxMaximumLineCount());
590a68b38dfSArmin Le Grand     OSL_ENSURE(nMaxLineCountA >= 0, "OOps, negative values for ListBoxMaximumLineCount are not allowed (!)");
591a68b38dfSArmin Le Grand     const sal_uInt16 nMaxLineCountB(static_cast< sal_uInt16 >(nMaxLineCountA >= 0 ? nMaxLineCountA : 0));
592ca6f8f21SArmin Le Grand 
593a68b38dfSArmin Le Grand     if(aStyleSettings.GetListBoxMaximumLineCount() != nMaxLineCountB)
594ca6f8f21SArmin Le Grand     {
595a68b38dfSArmin Le Grand         aStyleSettings.SetListBoxMaximumLineCount(nMaxLineCountB);
596a68b38dfSArmin Le Grand         StyleSettingsChanged = true;
597ca6f8f21SArmin Le Grand     }
598a68b38dfSArmin Le Grand 
599e2020f46SArmin Le Grand     const sal_Int16 nMaxColumnCountA(GetColorValueSetColumnCount());
600e2020f46SArmin Le Grand     OSL_ENSURE(nMaxColumnCountA >= 0, "OOps, negative values for ColorValueSetColumnCount are not allowed (!)");
601e2020f46SArmin Le Grand     const sal_uInt16 nMaxColumnCountB(static_cast< sal_uInt16 >(nMaxColumnCountA >= 0 ? nMaxColumnCountA : 0));
602e2020f46SArmin Le Grand 
603e2020f46SArmin Le Grand     if(aStyleSettings.GetColorValueSetColumnCount() != nMaxColumnCountB)
604e2020f46SArmin Le Grand     {
605e2020f46SArmin Le Grand         aStyleSettings.SetColorValueSetColumnCount(nMaxColumnCountB);
606e2020f46SArmin Le Grand         StyleSettingsChanged = true;
607e2020f46SArmin Le Grand     }
608e2020f46SArmin Le Grand 
609*33b19716SArmin Le Grand     const bool bPreviewUsesCheckeredBackground(GetPreviewUsesCheckeredBackground());
610*33b19716SArmin Le Grand 
611*33b19716SArmin Le Grand     if(aStyleSettings.GetPreviewUsesCheckeredBackground() != bPreviewUsesCheckeredBackground)
612*33b19716SArmin Le Grand     {
613*33b19716SArmin Le Grand         aStyleSettings.SetPreviewUsesCheckeredBackground(bPreviewUsesCheckeredBackground);
614*33b19716SArmin Le Grand         StyleSettingsChanged = true;
615*33b19716SArmin Le Grand     }
616*33b19716SArmin Le Grand 
617a68b38dfSArmin Le Grand     if(StyleSettingsChanged)
618ca6f8f21SArmin Le Grand     {
619a68b38dfSArmin Le Grand         aAllSettings.SetStyleSettings(aStyleSettings);
620a68b38dfSArmin Le Grand         Application::MergeSystemSettings(aAllSettings);
621ca6f8f21SArmin Le Grand     }
622a68b38dfSArmin Le Grand 
623a68b38dfSArmin Le Grand     Application::SetSettings(aAllSettings);
624ca6f8f21SArmin Le Grand }
625ca6f8f21SArmin Le Grand 
SetEdgeBlending(sal_Int16 nSet)626a68b38dfSArmin Le Grand void SvtAccessibilityOptions_Impl::SetEdgeBlending(sal_Int16 nSet)
627ca6f8f21SArmin Le Grand {
628ca6f8f21SArmin Le Grand     css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
629ca6f8f21SArmin Le Grand 
630ca6f8f21SArmin Le Grand     try
631ca6f8f21SArmin Le Grand     {
632a68b38dfSArmin Le Grand         if(xNode.is() && xNode->getPropertyValue(s_sEdgeBlending)!=nSet)
633ca6f8f21SArmin Le Grand         {
634a68b38dfSArmin Le Grand             xNode->setPropertyValue(s_sEdgeBlending, css::uno::makeAny(nSet));
635ca6f8f21SArmin Le Grand             ::comphelper::ConfigurationHelper::flush(m_xCfg);
636ca6f8f21SArmin Le Grand 
637ca6f8f21SArmin Le Grand             bIsModified = sal_True;
638ca6f8f21SArmin Le Grand         }
639ca6f8f21SArmin Le Grand     }
640ca6f8f21SArmin Le Grand     catch(const css::uno::Exception& ex)
641ca6f8f21SArmin Le Grand     {
642ca6f8f21SArmin Le Grand         LogHelper::logIt(ex);
643ca6f8f21SArmin Le Grand     }
644ca6f8f21SArmin Le Grand }
645ca6f8f21SArmin Le Grand 
SetListBoxMaximumLineCount(sal_Int16 nSet)646a68b38dfSArmin Le Grand void SvtAccessibilityOptions_Impl::SetListBoxMaximumLineCount(sal_Int16 nSet)
647ca6f8f21SArmin Le Grand {
648ca6f8f21SArmin Le Grand     css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
649ca6f8f21SArmin Le Grand 
650ca6f8f21SArmin Le Grand     try
651ca6f8f21SArmin Le Grand     {
652a68b38dfSArmin Le Grand         if(xNode.is() && xNode->getPropertyValue(s_sListBoxMaximumLineCount)!=nSet)
653ca6f8f21SArmin Le Grand         {
654a68b38dfSArmin Le Grand             xNode->setPropertyValue(s_sListBoxMaximumLineCount, css::uno::makeAny(nSet));
655ca6f8f21SArmin Le Grand             ::comphelper::ConfigurationHelper::flush(m_xCfg);
656ca6f8f21SArmin Le Grand 
657ca6f8f21SArmin Le Grand             bIsModified = sal_True;
658ca6f8f21SArmin Le Grand         }
659ca6f8f21SArmin Le Grand     }
660ca6f8f21SArmin Le Grand     catch(const css::uno::Exception& ex)
661ca6f8f21SArmin Le Grand     {
662ca6f8f21SArmin Le Grand         LogHelper::logIt(ex);
663ca6f8f21SArmin Le Grand     }
664ca6f8f21SArmin Le Grand }
665ca6f8f21SArmin Le Grand 
SetColorValueSetColumnCount(sal_Int16 nSet)666e2020f46SArmin Le Grand void SvtAccessibilityOptions_Impl::SetColorValueSetColumnCount(sal_Int16 nSet)
667e2020f46SArmin Le Grand {
668e2020f46SArmin Le Grand     css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
669e2020f46SArmin Le Grand 
670e2020f46SArmin Le Grand     try
671e2020f46SArmin Le Grand     {
672e2020f46SArmin Le Grand         if(xNode.is() && xNode->getPropertyValue(s_sColorValueSetColumnCount)!=nSet)
673e2020f46SArmin Le Grand         {
674e2020f46SArmin Le Grand             xNode->setPropertyValue(s_sColorValueSetColumnCount, css::uno::makeAny(nSet));
675e2020f46SArmin Le Grand             ::comphelper::ConfigurationHelper::flush(m_xCfg);
676e2020f46SArmin Le Grand 
677e2020f46SArmin Le Grand             bIsModified = sal_True;
678e2020f46SArmin Le Grand         }
679e2020f46SArmin Le Grand     }
680e2020f46SArmin Le Grand     catch(const css::uno::Exception& ex)
681e2020f46SArmin Le Grand     {
682e2020f46SArmin Le Grand         LogHelper::logIt(ex);
683e2020f46SArmin Le Grand     }
684e2020f46SArmin Le Grand }
685e2020f46SArmin Le Grand 
SetPreviewUsesCheckeredBackground(sal_Bool bSet)686*33b19716SArmin Le Grand void SvtAccessibilityOptions_Impl::SetPreviewUsesCheckeredBackground(sal_Bool bSet)
687*33b19716SArmin Le Grand {
688*33b19716SArmin Le Grand     css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY);
689*33b19716SArmin Le Grand 
690*33b19716SArmin Le Grand     try
691*33b19716SArmin Le Grand     {
692*33b19716SArmin Le Grand         if(xNode.is() && xNode->getPropertyValue(s_sPreviewUsesCheckeredBackground)!=bSet)
693*33b19716SArmin Le Grand         {
694*33b19716SArmin Le Grand             xNode->setPropertyValue(s_sPreviewUsesCheckeredBackground, css::uno::makeAny(bSet));
695*33b19716SArmin Le Grand             ::comphelper::ConfigurationHelper::flush(m_xCfg);
696*33b19716SArmin Le Grand 
697*33b19716SArmin Le Grand             bIsModified = sal_True;
698*33b19716SArmin Le Grand         }
699*33b19716SArmin Le Grand     }
700*33b19716SArmin Le Grand     catch(const css::uno::Exception& ex)
701*33b19716SArmin Le Grand     {
702*33b19716SArmin Le Grand         LogHelper::logIt(ex);
703*33b19716SArmin Le Grand     }
704*33b19716SArmin Le Grand }
705*33b19716SArmin Le Grand 
706cdf0e10cSrcweir // -----------------------------------------------------------------------
707cdf0e10cSrcweir // class SvtAccessibilityOptions --------------------------------------------------
708cdf0e10cSrcweir 
SvtAccessibilityOptions()709cdf0e10cSrcweir SvtAccessibilityOptions::SvtAccessibilityOptions()
710cdf0e10cSrcweir {
711cdf0e10cSrcweir 	{
712cdf0e10cSrcweir 		::osl::MutexGuard aGuard( SingletonMutex::get() );
713cdf0e10cSrcweir 		if(!sm_pSingleImplConfig)
714cdf0e10cSrcweir 		{
715cdf0e10cSrcweir 			sm_pSingleImplConfig = new SvtAccessibilityOptions_Impl;
716cdf0e10cSrcweir 			ItemHolder2::holdConfigItem(E_ACCESSIBILITYOPTIONS);
717cdf0e10cSrcweir 		}
718cdf0e10cSrcweir 		++sm_nAccessibilityRefCount;
719cdf0e10cSrcweir 	}
720cdf0e10cSrcweir 	//StartListening( *sm_pSingleImplConfig, sal_True );
721cdf0e10cSrcweir }
722cdf0e10cSrcweir 
723cdf0e10cSrcweir // -----------------------------------------------------------------------
724cdf0e10cSrcweir 
~SvtAccessibilityOptions()725cdf0e10cSrcweir SvtAccessibilityOptions::~SvtAccessibilityOptions()
726cdf0e10cSrcweir {
727cdf0e10cSrcweir 	//EndListening( *sm_pSingleImplConfig, sal_True );
728cdf0e10cSrcweir 	::osl::MutexGuard aGuard( SingletonMutex::get() );
729cdf0e10cSrcweir 	if( !--sm_nAccessibilityRefCount )
730cdf0e10cSrcweir 	{
731cdf0e10cSrcweir 		//if( sm_pSingleImplConfig->IsModified() )
732cdf0e10cSrcweir 		//	sm_pSingleImplConfig->Commit();
733cdf0e10cSrcweir 		DELETEZ( sm_pSingleImplConfig );
734cdf0e10cSrcweir 	}
735cdf0e10cSrcweir }
736cdf0e10cSrcweir 
737cdf0e10cSrcweir // -----------------------------------------------------------------------
738cdf0e10cSrcweir 
Notify(SfxBroadcaster &,const SfxHint & rHint)739cdf0e10cSrcweir void SvtAccessibilityOptions::Notify( SfxBroadcaster&, const SfxHint& rHint )
740cdf0e10cSrcweir {
741cdf0e10cSrcweir 	NotifyListeners(0);
742cdf0e10cSrcweir 	if ( rHint.IsA(TYPE(SfxSimpleHint)) )
743cdf0e10cSrcweir 	{
744cdf0e10cSrcweir 		if ( ((SfxSimpleHint&)rHint).GetId()  == SFX_HINT_ACCESSIBILITY_CHANGED )
745cdf0e10cSrcweir 			SetVCLSettings();
746cdf0e10cSrcweir 	}
747cdf0e10cSrcweir }
748cdf0e10cSrcweir 
749cdf0e10cSrcweir // -----------------------------------------------------------------------
750cdf0e10cSrcweir 
IsModified() const751cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions::IsModified() const
752cdf0e10cSrcweir {
753cdf0e10cSrcweir 	return sm_pSingleImplConfig->IsModified();
754cdf0e10cSrcweir }
Commit()755cdf0e10cSrcweir void SvtAccessibilityOptions::Commit()
756cdf0e10cSrcweir {
757cdf0e10cSrcweir 	//sm_pSingleImplConfig->Commit();
758cdf0e10cSrcweir }
759cdf0e10cSrcweir 
760cdf0e10cSrcweir // -----------------------------------------------------------------------
761cdf0e10cSrcweir 
GetIsForDrawings() const762cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions::GetIsForDrawings() const
763cdf0e10cSrcweir {
764cdf0e10cSrcweir 	DBG_ERROR( "SvtAccessibilityOptions::GetIsForDrawings: is obsolete!" );
765cdf0e10cSrcweir     return sal_False;
766cdf0e10cSrcweir }
GetIsForBorders() const767cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions::GetIsForBorders() const
768cdf0e10cSrcweir {
769cdf0e10cSrcweir 	DBG_ERROR( "SvtAccessibilityOptions::GetIsForBorders: is obsolete!" );
770cdf0e10cSrcweir     return sal_False;
771cdf0e10cSrcweir }
GetAutoDetectSystemHC() const772cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions::GetAutoDetectSystemHC() const
773cdf0e10cSrcweir {
774cdf0e10cSrcweir 	return sm_pSingleImplConfig->GetAutoDetectSystemHC();
775cdf0e10cSrcweir }
GetIsForPagePreviews() const776cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions::GetIsForPagePreviews() const
777cdf0e10cSrcweir {
778cdf0e10cSrcweir 	return sm_pSingleImplConfig->GetIsForPagePreviews();
779cdf0e10cSrcweir }
GetIsHelpTipsDisappear() const780cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions::GetIsHelpTipsDisappear() const
781cdf0e10cSrcweir {
782cdf0e10cSrcweir 	return sm_pSingleImplConfig->GetIsHelpTipsDisappear();
783cdf0e10cSrcweir }
GetIsAllowAnimatedGraphics() const784cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions::GetIsAllowAnimatedGraphics() const
785cdf0e10cSrcweir {
786cdf0e10cSrcweir 	return sm_pSingleImplConfig->GetIsAllowAnimatedGraphics();
787cdf0e10cSrcweir }
GetIsAllowAnimatedText() const788cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions::GetIsAllowAnimatedText() const
789cdf0e10cSrcweir {
790cdf0e10cSrcweir 	return sm_pSingleImplConfig->GetIsAllowAnimatedText();
791cdf0e10cSrcweir }
GetIsAutomaticFontColor() const792cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions::GetIsAutomaticFontColor() const
793cdf0e10cSrcweir {
794cdf0e10cSrcweir 	return sm_pSingleImplConfig->GetIsAutomaticFontColor();
795cdf0e10cSrcweir }
GetIsSystemFont() const796cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions::GetIsSystemFont() const
797cdf0e10cSrcweir {
798cdf0e10cSrcweir 	return sm_pSingleImplConfig->GetIsSystemFont();
799cdf0e10cSrcweir }
GetHelpTipSeconds() const800cdf0e10cSrcweir sal_Int16 SvtAccessibilityOptions::GetHelpTipSeconds() const
801cdf0e10cSrcweir {
802cdf0e10cSrcweir 	return sm_pSingleImplConfig->GetHelpTipSeconds();
803cdf0e10cSrcweir }
IsSelectionInReadonly() const804cdf0e10cSrcweir sal_Bool SvtAccessibilityOptions::IsSelectionInReadonly() const
805cdf0e10cSrcweir {
806cdf0e10cSrcweir 	return sm_pSingleImplConfig->IsSelectionInReadonly();
807cdf0e10cSrcweir }
GetEdgeBlending() const808ca6f8f21SArmin Le Grand sal_Int16 SvtAccessibilityOptions::GetEdgeBlending() const
809ca6f8f21SArmin Le Grand {
810ca6f8f21SArmin Le Grand     return sm_pSingleImplConfig->GetEdgeBlending();
811ca6f8f21SArmin Le Grand }
GetListBoxMaximumLineCount() const812a68b38dfSArmin Le Grand sal_Int16 SvtAccessibilityOptions::GetListBoxMaximumLineCount() const
813a68b38dfSArmin Le Grand {
814a68b38dfSArmin Le Grand     return sm_pSingleImplConfig->GetListBoxMaximumLineCount();
815a68b38dfSArmin Le Grand }
GetColorValueSetColumnCount() const816e2020f46SArmin Le Grand sal_Int16 SvtAccessibilityOptions::GetColorValueSetColumnCount() const
817e2020f46SArmin Le Grand {
818e2020f46SArmin Le Grand     return sm_pSingleImplConfig->GetColorValueSetColumnCount();
819e2020f46SArmin Le Grand }
GetPreviewUsesCheckeredBackground() const820*33b19716SArmin Le Grand sal_Bool SvtAccessibilityOptions::GetPreviewUsesCheckeredBackground() const
821*33b19716SArmin Le Grand {
822*33b19716SArmin Le Grand     return sm_pSingleImplConfig->GetPreviewUsesCheckeredBackground();
823*33b19716SArmin Le Grand }
824ca6f8f21SArmin Le Grand 
825cdf0e10cSrcweir // -----------------------------------------------------------------------
SetAutoDetectSystemHC(sal_Bool bSet)826cdf0e10cSrcweir void SvtAccessibilityOptions::SetAutoDetectSystemHC(sal_Bool bSet)
827cdf0e10cSrcweir {
828cdf0e10cSrcweir 	sm_pSingleImplConfig->SetAutoDetectSystemHC(bSet);
829cdf0e10cSrcweir }
SetIsForPagePreviews(sal_Bool bSet)830cdf0e10cSrcweir void SvtAccessibilityOptions::SetIsForPagePreviews(sal_Bool bSet)
831cdf0e10cSrcweir {
832cdf0e10cSrcweir 	sm_pSingleImplConfig->SetIsForPagePreviews(bSet);
833cdf0e10cSrcweir }
SetIsHelpTipsDisappear(sal_Bool bSet)834cdf0e10cSrcweir void SvtAccessibilityOptions::SetIsHelpTipsDisappear(sal_Bool bSet)
835cdf0e10cSrcweir {
836cdf0e10cSrcweir 	sm_pSingleImplConfig->SetIsHelpTipsDisappear(bSet);
837cdf0e10cSrcweir }
SetIsAllowAnimatedGraphics(sal_Bool bSet)838cdf0e10cSrcweir void SvtAccessibilityOptions::SetIsAllowAnimatedGraphics(sal_Bool bSet)
839cdf0e10cSrcweir {
840cdf0e10cSrcweir 	sm_pSingleImplConfig->SetIsAllowAnimatedGraphics(bSet);
841cdf0e10cSrcweir }
SetIsAllowAnimatedText(sal_Bool bSet)842cdf0e10cSrcweir void SvtAccessibilityOptions::SetIsAllowAnimatedText(sal_Bool bSet)
843cdf0e10cSrcweir {
844cdf0e10cSrcweir 	sm_pSingleImplConfig->SetIsAllowAnimatedText(bSet);
845cdf0e10cSrcweir }
SetIsAutomaticFontColor(sal_Bool bSet)846cdf0e10cSrcweir void SvtAccessibilityOptions::SetIsAutomaticFontColor(sal_Bool bSet)
847cdf0e10cSrcweir {
848cdf0e10cSrcweir 	sm_pSingleImplConfig->SetIsAutomaticFontColor(bSet);
849cdf0e10cSrcweir }
SetIsSystemFont(sal_Bool bSet)850cdf0e10cSrcweir void SvtAccessibilityOptions::SetIsSystemFont(sal_Bool bSet)
851cdf0e10cSrcweir {
852cdf0e10cSrcweir 	sm_pSingleImplConfig->SetIsSystemFont(bSet);
853cdf0e10cSrcweir }
SetHelpTipSeconds(sal_Int16 nSet)854cdf0e10cSrcweir void SvtAccessibilityOptions::SetHelpTipSeconds(sal_Int16 nSet)
855cdf0e10cSrcweir {
856cdf0e10cSrcweir 	sm_pSingleImplConfig->SetHelpTipSeconds(nSet);
857cdf0e10cSrcweir }
SetSelectionInReadonly(sal_Bool bSet)858cdf0e10cSrcweir void SvtAccessibilityOptions::SetSelectionInReadonly(sal_Bool bSet)
859cdf0e10cSrcweir {
860cdf0e10cSrcweir 	sm_pSingleImplConfig->SetSelectionInReadonly(bSet);
861cdf0e10cSrcweir }
SetVCLSettings()862cdf0e10cSrcweir void SvtAccessibilityOptions::SetVCLSettings()
863cdf0e10cSrcweir {
864cdf0e10cSrcweir 	sm_pSingleImplConfig->SetVCLSettings();
865cdf0e10cSrcweir }
SetEdgeBlending(sal_Int16 nSet)866ca6f8f21SArmin Le Grand void SvtAccessibilityOptions::SetEdgeBlending(sal_Int16 nSet)
867ca6f8f21SArmin Le Grand {
868ca6f8f21SArmin Le Grand     sm_pSingleImplConfig->SetEdgeBlending(nSet);
869ca6f8f21SArmin Le Grand }
SetListBoxMaximumLineCount(sal_Int16 nSet)870a68b38dfSArmin Le Grand void SvtAccessibilityOptions::SetListBoxMaximumLineCount(sal_Int16 nSet)
871a68b38dfSArmin Le Grand {
872a68b38dfSArmin Le Grand     sm_pSingleImplConfig->SetListBoxMaximumLineCount(nSet);
873a68b38dfSArmin Le Grand }
SetColorValueSetColumnCount(sal_Int16 nSet)874e2020f46SArmin Le Grand void SvtAccessibilityOptions::SetColorValueSetColumnCount(sal_Int16 nSet)
875e2020f46SArmin Le Grand {
876e2020f46SArmin Le Grand     sm_pSingleImplConfig->SetColorValueSetColumnCount(nSet);
877e2020f46SArmin Le Grand }
SetPreviewUsesCheckeredBackground(sal_Bool bSet)878*33b19716SArmin Le Grand void SvtAccessibilityOptions::SetPreviewUsesCheckeredBackground(sal_Bool bSet)
879*33b19716SArmin Le Grand {
880*33b19716SArmin Le Grand     sm_pSingleImplConfig->SetPreviewUsesCheckeredBackground(bSet);
881*33b19716SArmin Le Grand }
882e2020f46SArmin Le Grand 
883cdf0e10cSrcweir // -----------------------------------------------------------------------
884