1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_framework.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
32*cdf0e10cSrcweir //	my own includes
33*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
34*cdf0e10cSrcweir #include "uiconfiguration/globalsettings.hxx"
35*cdf0e10cSrcweir #include <threadhelp/resetableguard.hxx>
36*cdf0e10cSrcweir #include "services.h"
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
39*cdf0e10cSrcweir //	interface includes
40*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
41*cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
42*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
43*cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp>
44*cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp>
45*cdf0e10cSrcweir #include <com/sun/star/container/XContainer.hpp>
46*cdf0e10cSrcweir #include <com/sun/star/lang/XComponent.hpp>
47*cdf0e10cSrcweir #include <com/sun/star/lang/XEventListener.hpp>
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
50*cdf0e10cSrcweir //	includes of other projects
51*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
52*cdf0e10cSrcweir #include <rtl/ustrbuf.hxx>
53*cdf0e10cSrcweir #include <rtl/instance.hxx>
54*cdf0e10cSrcweir #include <cppuhelper/weak.hxx>
55*cdf0e10cSrcweir #include <tools/debug.hxx>
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
58*cdf0e10cSrcweir //	Defines
59*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
60*cdf0e10cSrcweir //
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir using namespace rtl;
63*cdf0e10cSrcweir using namespace ::com::sun::star;
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
66*cdf0e10cSrcweir //	Namespace
67*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
68*cdf0e10cSrcweir //
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir static const char GLOBALSETTINGS_ROOT_ACCESS[]              = "/org.openoffice.Office.UI.GlobalSettings/Toolbars";
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir static const char GLOBALSETTINGS_NODEREF_STATES[]           = "States";
73*cdf0e10cSrcweir static const char GLOBALSETTINGS_PROPERTY_LOCKED[]          = "Locked";
74*cdf0e10cSrcweir static const char GLOBALSETTINGS_PROPERTY_DOCKED[]          = "Docked";
75*cdf0e10cSrcweir static const char GLOBALSETTINGS_PROPERTY_STATESENABLED[]   = "StatesEnabled";
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir namespace framework
78*cdf0e10cSrcweir {
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir //*****************************************************************************************************************
81*cdf0e10cSrcweir //	Configuration access class for WindowState supplier implementation
82*cdf0e10cSrcweir //*****************************************************************************************************************
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir class GlobalSettings_Access : public ::com::sun::star::lang::XComponent	     ,
85*cdf0e10cSrcweir                               public ::com::sun::star::lang::XEventListener  ,
86*cdf0e10cSrcweir 						      private ThreadHelpBase						 ,	// Struct for right initalization of mutex member! Must be first of baseclasses.
87*cdf0e10cSrcweir 						      public ::cppu::OWeakObject
88*cdf0e10cSrcweir {
89*cdf0e10cSrcweir 	public:
90*cdf0e10cSrcweir 		GlobalSettings_Access( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
91*cdf0e10cSrcweir 		virtual ~GlobalSettings_Access();
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir         // XInterface, XTypeProvider, XServiceInfo
94*cdf0e10cSrcweir 		FWK_DECLARE_XINTERFACE
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir         // XComponent
97*cdf0e10cSrcweir         virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
98*cdf0e10cSrcweir         virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
99*cdf0e10cSrcweir         virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir         // XEventListener
102*cdf0e10cSrcweir         virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir         // settings access
105*cdf0e10cSrcweir         sal_Bool HasStatesInfo( GlobalSettings::UIElementType eElementType );
106*cdf0e10cSrcweir         sal_Bool GetStateInfo( GlobalSettings::UIElementType eElementType, GlobalSettings::StateInfo eStateInfo, ::com::sun::star::uno::Any& aValue );
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir     private:
109*cdf0e10cSrcweir         sal_Bool impl_initConfigAccess();
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir         sal_Bool                                                                            m_bDisposed   : 1,
112*cdf0e10cSrcweir                                                                                             m_bConfigRead : 1;
113*cdf0e10cSrcweir         rtl::OUString                                                                       m_aConfigSettingsAccess;
114*cdf0e10cSrcweir         rtl::OUString                                                                       m_aNodeRefStates;
115*cdf0e10cSrcweir         rtl::OUString                                                                       m_aPropStatesEnabled;
116*cdf0e10cSrcweir         rtl::OUString                                                                       m_aPropLocked;
117*cdf0e10cSrcweir         rtl::OUString                                                                       m_aPropDocked;
118*cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >        m_xConfigAccess;
119*cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >    m_xServiceManager;
120*cdf0e10cSrcweir };
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir //*****************************************************************************************************************
124*cdf0e10cSrcweir //	XInterface
125*cdf0e10cSrcweir //*****************************************************************************************************************
126*cdf0e10cSrcweir DEFINE_XINTERFACE_2     (   GlobalSettings_Access                           ,
127*cdf0e10cSrcweir                             OWeakObject                                     ,
128*cdf0e10cSrcweir                             DIRECT_INTERFACE ( css::lang::XComponent        ),
129*cdf0e10cSrcweir                             DIRECT_INTERFACE ( css::lang::XEventListener    )
130*cdf0e10cSrcweir 						)
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir GlobalSettings_Access::GlobalSettings_Access( const css::uno::Reference< css::lang::XMultiServiceFactory >& rServiceManager ) :
133*cdf0e10cSrcweir     ThreadHelpBase(),
134*cdf0e10cSrcweir     m_bDisposed( sal_False ),
135*cdf0e10cSrcweir     m_bConfigRead( sal_False ),
136*cdf0e10cSrcweir     m_aConfigSettingsAccess( RTL_CONSTASCII_USTRINGPARAM( GLOBALSETTINGS_ROOT_ACCESS )),
137*cdf0e10cSrcweir     m_aNodeRefStates( RTL_CONSTASCII_USTRINGPARAM( GLOBALSETTINGS_NODEREF_STATES )),
138*cdf0e10cSrcweir     m_aPropStatesEnabled( RTL_CONSTASCII_USTRINGPARAM( GLOBALSETTINGS_PROPERTY_STATESENABLED )),
139*cdf0e10cSrcweir     m_aPropLocked( RTL_CONSTASCII_USTRINGPARAM( GLOBALSETTINGS_PROPERTY_LOCKED )),
140*cdf0e10cSrcweir     m_aPropDocked( RTL_CONSTASCII_USTRINGPARAM( GLOBALSETTINGS_PROPERTY_DOCKED )),
141*cdf0e10cSrcweir     m_xServiceManager( rServiceManager )
142*cdf0e10cSrcweir {
143*cdf0e10cSrcweir }
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir GlobalSettings_Access::~GlobalSettings_Access()
146*cdf0e10cSrcweir {
147*cdf0e10cSrcweir }
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir // XComponent
150*cdf0e10cSrcweir void SAL_CALL GlobalSettings_Access::dispose()
151*cdf0e10cSrcweir throw ( css::uno::RuntimeException )
152*cdf0e10cSrcweir {
153*cdf0e10cSrcweir     // SAFE
154*cdf0e10cSrcweir     ResetableGuard aLock( m_aLock );
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir     m_xConfigAccess.clear();
157*cdf0e10cSrcweir     m_bDisposed = sal_True;
158*cdf0e10cSrcweir }
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir void SAL_CALL GlobalSettings_Access::addEventListener( const css::uno::Reference< css::lang::XEventListener >& )
161*cdf0e10cSrcweir throw (css::uno::RuntimeException)
162*cdf0e10cSrcweir {
163*cdf0e10cSrcweir }
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir void SAL_CALL GlobalSettings_Access::removeEventListener( const css::uno::Reference< css::lang::XEventListener >& )
166*cdf0e10cSrcweir throw (css::uno::RuntimeException)
167*cdf0e10cSrcweir {
168*cdf0e10cSrcweir }
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir // XEventListener
171*cdf0e10cSrcweir void SAL_CALL GlobalSettings_Access::disposing( const css::lang::EventObject& )
172*cdf0e10cSrcweir throw (css::uno::RuntimeException)
173*cdf0e10cSrcweir {
174*cdf0e10cSrcweir     // SAFE
175*cdf0e10cSrcweir     ResetableGuard aLock( m_aLock );
176*cdf0e10cSrcweir     m_xConfigAccess.clear();
177*cdf0e10cSrcweir }
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir // settings access
180*cdf0e10cSrcweir sal_Bool GlobalSettings_Access::HasStatesInfo( GlobalSettings::UIElementType eElementType )
181*cdf0e10cSrcweir {
182*cdf0e10cSrcweir     ResetableGuard aLock( m_aLock );
183*cdf0e10cSrcweir     if ( eElementType == GlobalSettings::UIELEMENT_TYPE_DOCKWINDOW )
184*cdf0e10cSrcweir         return sal_False;
185*cdf0e10cSrcweir     else if ( eElementType == GlobalSettings::UIELEMENT_TYPE_STATUSBAR )
186*cdf0e10cSrcweir         return sal_False;
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir     if ( m_bDisposed )
189*cdf0e10cSrcweir         return sal_False;
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir     if ( !m_bConfigRead )
192*cdf0e10cSrcweir     {
193*cdf0e10cSrcweir         m_bConfigRead = sal_True;
194*cdf0e10cSrcweir         impl_initConfigAccess();
195*cdf0e10cSrcweir     }
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir     if ( m_xConfigAccess.is() )
198*cdf0e10cSrcweir     {
199*cdf0e10cSrcweir         try
200*cdf0e10cSrcweir         {
201*cdf0e10cSrcweir             css::uno::Any a;
202*cdf0e10cSrcweir             sal_Bool      bValue = sal_Bool();
203*cdf0e10cSrcweir             a = m_xConfigAccess->getByName( m_aPropStatesEnabled );
204*cdf0e10cSrcweir             if ( a >>= bValue )
205*cdf0e10cSrcweir                 return bValue;
206*cdf0e10cSrcweir         }
207*cdf0e10cSrcweir         catch ( css::container::NoSuchElementException& )
208*cdf0e10cSrcweir         {
209*cdf0e10cSrcweir         }
210*cdf0e10cSrcweir         catch ( css::uno::Exception& )
211*cdf0e10cSrcweir         {
212*cdf0e10cSrcweir         }
213*cdf0e10cSrcweir     }
214*cdf0e10cSrcweir 
215*cdf0e10cSrcweir     return sal_False;
216*cdf0e10cSrcweir }
217*cdf0e10cSrcweir 
218*cdf0e10cSrcweir sal_Bool GlobalSettings_Access::GetStateInfo( GlobalSettings::UIElementType eElementType, GlobalSettings::StateInfo eStateInfo, ::com::sun::star::uno::Any& aValue )
219*cdf0e10cSrcweir {
220*cdf0e10cSrcweir     ResetableGuard aLock( m_aLock );
221*cdf0e10cSrcweir     if ( eElementType == GlobalSettings::UIELEMENT_TYPE_DOCKWINDOW )
222*cdf0e10cSrcweir         return sal_False;
223*cdf0e10cSrcweir     else if ( eElementType == GlobalSettings::UIELEMENT_TYPE_STATUSBAR )
224*cdf0e10cSrcweir         return sal_False;
225*cdf0e10cSrcweir 
226*cdf0e10cSrcweir     if ( m_bDisposed )
227*cdf0e10cSrcweir         return sal_False;
228*cdf0e10cSrcweir 
229*cdf0e10cSrcweir     if ( !m_bConfigRead )
230*cdf0e10cSrcweir     {
231*cdf0e10cSrcweir         m_bConfigRead = sal_True;
232*cdf0e10cSrcweir         impl_initConfigAccess();
233*cdf0e10cSrcweir     }
234*cdf0e10cSrcweir 
235*cdf0e10cSrcweir     if ( m_xConfigAccess.is() )
236*cdf0e10cSrcweir     {
237*cdf0e10cSrcweir         try
238*cdf0e10cSrcweir         {
239*cdf0e10cSrcweir             css::uno::Any a;
240*cdf0e10cSrcweir             a = m_xConfigAccess->getByName( m_aNodeRefStates );
241*cdf0e10cSrcweir             css::uno::Reference< css::container::XNameAccess > xNameAccess;
242*cdf0e10cSrcweir             if ( a >>= xNameAccess )
243*cdf0e10cSrcweir             {
244*cdf0e10cSrcweir                 if ( eStateInfo == GlobalSettings::STATEINFO_LOCKED )
245*cdf0e10cSrcweir                     a = xNameAccess->getByName( m_aPropLocked );
246*cdf0e10cSrcweir                 else if ( eStateInfo == GlobalSettings::STATEINFO_DOCKED )
247*cdf0e10cSrcweir                     a = xNameAccess->getByName( m_aPropDocked );
248*cdf0e10cSrcweir 
249*cdf0e10cSrcweir                 aValue = a;
250*cdf0e10cSrcweir                 return sal_True;
251*cdf0e10cSrcweir             }
252*cdf0e10cSrcweir         }
253*cdf0e10cSrcweir         catch ( css::container::NoSuchElementException& )
254*cdf0e10cSrcweir         {
255*cdf0e10cSrcweir         }
256*cdf0e10cSrcweir         catch ( css::uno::Exception& )
257*cdf0e10cSrcweir         {
258*cdf0e10cSrcweir         }
259*cdf0e10cSrcweir     }
260*cdf0e10cSrcweir 
261*cdf0e10cSrcweir     return sal_False;
262*cdf0e10cSrcweir }
263*cdf0e10cSrcweir 
264*cdf0e10cSrcweir sal_Bool GlobalSettings_Access::impl_initConfigAccess()
265*cdf0e10cSrcweir {
266*cdf0e10cSrcweir     css::uno::Sequence< css::uno::Any > aArgs( 2 );
267*cdf0e10cSrcweir     css::beans::PropertyValue           aPropValue;
268*cdf0e10cSrcweir 
269*cdf0e10cSrcweir     try
270*cdf0e10cSrcweir     {
271*cdf0e10cSrcweir         css::uno::Reference< css::lang::XMultiServiceFactory > xConfigProvider;
272*cdf0e10cSrcweir         if ( m_xServiceManager.is() )
273*cdf0e10cSrcweir             xConfigProvider = css::uno::Reference< css::lang::XMultiServiceFactory >(
274*cdf0e10cSrcweir                                     m_xServiceManager->createInstance( SERVICENAME_CFGPROVIDER ),
275*cdf0e10cSrcweir                                     css::uno::UNO_QUERY );
276*cdf0e10cSrcweir 
277*cdf0e10cSrcweir         if ( xConfigProvider.is() )
278*cdf0e10cSrcweir         {
279*cdf0e10cSrcweir             aPropValue.Name  = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ));
280*cdf0e10cSrcweir             aPropValue.Value = css::uno::makeAny( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( GLOBALSETTINGS_ROOT_ACCESS )));
281*cdf0e10cSrcweir             aArgs[0] = css::uno::makeAny( aPropValue );
282*cdf0e10cSrcweir             aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "lazywrite" ));
283*cdf0e10cSrcweir             aPropValue.Value = css::uno::makeAny( sal_True );
284*cdf0e10cSrcweir             aArgs[1] = css::uno::makeAny( aPropValue );
285*cdf0e10cSrcweir 
286*cdf0e10cSrcweir             m_xConfigAccess = css::uno::Reference< css::container::XNameAccess >(
287*cdf0e10cSrcweir                                 xConfigProvider->createInstanceWithArguments(
288*cdf0e10cSrcweir                                     SERVICENAME_CFGREADACCESS, aArgs ),
289*cdf0e10cSrcweir                                 css::uno::UNO_QUERY );
290*cdf0e10cSrcweir 
291*cdf0e10cSrcweir             css::uno::Reference< css::lang::XComponent > xComponent( xConfigProvider, css::uno::UNO_QUERY );
292*cdf0e10cSrcweir             if ( xComponent.is() )
293*cdf0e10cSrcweir                 xComponent->addEventListener(
294*cdf0e10cSrcweir                     css::uno::Reference< css::lang::XEventListener >(
295*cdf0e10cSrcweir                         static_cast< cppu::OWeakObject* >( this ),
296*cdf0e10cSrcweir                         css::uno::UNO_QUERY ));
297*cdf0e10cSrcweir         }
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir         return m_xConfigAccess.is();
300*cdf0e10cSrcweir     }
301*cdf0e10cSrcweir     catch ( css::lang::WrappedTargetException& )
302*cdf0e10cSrcweir     {
303*cdf0e10cSrcweir     }
304*cdf0e10cSrcweir     catch ( css::uno::Exception& )
305*cdf0e10cSrcweir     {
306*cdf0e10cSrcweir     }
307*cdf0e10cSrcweir 
308*cdf0e10cSrcweir     return sal_False;
309*cdf0e10cSrcweir }
310*cdf0e10cSrcweir 
311*cdf0e10cSrcweir //*****************************************************************************************************************
312*cdf0e10cSrcweir //	global class
313*cdf0e10cSrcweir //*****************************************************************************************************************
314*cdf0e10cSrcweir 
315*cdf0e10cSrcweir struct mutexGlobalSettings : public rtl::Static< osl::Mutex, mutexGlobalSettings > {};
316*cdf0e10cSrcweir static GlobalSettings_Access* pStaticSettings = 0;
317*cdf0e10cSrcweir 
318*cdf0e10cSrcweir static GlobalSettings_Access* GetGlobalSettings( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSrvMgr )
319*cdf0e10cSrcweir {
320*cdf0e10cSrcweir     osl::MutexGuard aGuard(mutexGlobalSettings::get());
321*cdf0e10cSrcweir     if ( !pStaticSettings )
322*cdf0e10cSrcweir         pStaticSettings = new GlobalSettings_Access( rSrvMgr );
323*cdf0e10cSrcweir     return pStaticSettings;
324*cdf0e10cSrcweir }
325*cdf0e10cSrcweir 
326*cdf0e10cSrcweir GlobalSettings::GlobalSettings( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSrvMgr ) :
327*cdf0e10cSrcweir     m_xSrvMgr( rSrvMgr )
328*cdf0e10cSrcweir {
329*cdf0e10cSrcweir }
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir GlobalSettings::~GlobalSettings()
332*cdf0e10cSrcweir {
333*cdf0e10cSrcweir }
334*cdf0e10cSrcweir 
335*cdf0e10cSrcweir // settings access
336*cdf0e10cSrcweir sal_Bool GlobalSettings::HasStatesInfo( UIElementType eElementType )
337*cdf0e10cSrcweir {
338*cdf0e10cSrcweir     GlobalSettings_Access* pSettings( GetGlobalSettings( m_xSrvMgr ));
339*cdf0e10cSrcweir 
340*cdf0e10cSrcweir     if ( pSettings )
341*cdf0e10cSrcweir         return pSettings->HasStatesInfo( eElementType );
342*cdf0e10cSrcweir     else
343*cdf0e10cSrcweir         return sal_False;
344*cdf0e10cSrcweir }
345*cdf0e10cSrcweir 
346*cdf0e10cSrcweir sal_Bool GlobalSettings::GetStateInfo( UIElementType eElementType, StateInfo eStateInfo, ::com::sun::star::uno::Any& aValue )
347*cdf0e10cSrcweir {
348*cdf0e10cSrcweir     GlobalSettings_Access* pSettings( GetGlobalSettings( m_xSrvMgr ));
349*cdf0e10cSrcweir 
350*cdf0e10cSrcweir     if ( pSettings )
351*cdf0e10cSrcweir         return pSettings->GetStateInfo( eElementType, eStateInfo, aValue );
352*cdf0e10cSrcweir     else
353*cdf0e10cSrcweir         return sal_False;
354*cdf0e10cSrcweir }
355*cdf0e10cSrcweir 
356*cdf0e10cSrcweir } // namespace framework
357