1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_FRAMEWORK_INC_HELPER_UICONFIGELEMENTWRAPPERBASE_HXX
21 #define INCLUDED_FRAMEWORK_INC_HELPER_UICONFIGELEMENTWRAPPERBASE_HXX
23 #include <macros/generic.hxx>
24 #include <macros/xinterface.hxx>
25 #include <macros/xtypeprovider.hxx>
27 #include <com/sun/star/ui/XUIElement.hpp>
28 #include <com/sun/star/ui/XUIElementSettings.hpp>
29 #include <com/sun/star/ui/XUIConfigurationManager.hpp>
30 #include <com/sun/star/ui/XUIConfigurationListener.hpp>
31 #include <com/sun/star/frame/XFrame.hpp>
32 #include <com/sun/star/awt/XMenuBar.hpp>
33 #include <com/sun/star/util/XUpdatable.hpp>
34 #include <com/sun/star/lang/XInitialization.hpp>
35 #include <com/sun/star/lang/XComponent.hpp>
37 #include <rtl/ustring.hxx>
38 #include <cppuhelper/basemutex.hxx>
39 #include <cppuhelper/propshlp.hxx>
40 #include <cppuhelper/implbase6.hxx>
45 typedef ::cppu::WeakImplHelper6
<
46 ::com::sun::star::ui::XUIElement
,
47 ::com::sun::star::ui::XUIElementSettings
,
48 ::com::sun::star::lang::XInitialization
,
49 ::com::sun::star::lang::XComponent
,
50 ::com::sun::star::util::XUpdatable
,
51 ::com::sun::star::ui::XUIConfigurationListener
> UIConfigElementWrapperBase_BASE
;
53 class UIConfigElementWrapperBase
: private cppu::BaseMutex
,
54 public ::cppu::OBroadcastHelper
,
55 public ::cppu::OPropertySetHelper
,
56 public UIConfigElementWrapperBase_BASE
62 UIConfigElementWrapperBase( sal_Int16 nType
);
63 virtual ~UIConfigElementWrapperBase();
66 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
67 { OWeakObject::acquire(); }
68 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
69 { OWeakObject::release(); }
70 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& type
) throw ( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
73 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
76 virtual void SAL_CALL
dispose() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
= 0;
77 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
78 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& aListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
81 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
) throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
84 virtual void SAL_CALL
updateSettings() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
= 0;
85 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexAccess
> SAL_CALL
getSettings( sal_Bool bWriteable
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
86 virtual void SAL_CALL
setSettings( const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexAccess
>& UISettings
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
89 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> SAL_CALL
getFrame() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
90 virtual OUString SAL_CALL
getResourceURL() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 virtual ::sal_Int16 SAL_CALL
getType() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
92 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
getRealInterface() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
= 0;
95 virtual void SAL_CALL
update() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
97 // XUIConfigurationListener
98 virtual void SAL_CALL
elementInserted( const ::com::sun::star::ui::ConfigurationEvent
& Event
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
99 virtual void SAL_CALL
elementRemoved( const ::com::sun::star::ui::ConfigurationEvent
& Event
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
100 virtual void SAL_CALL
elementReplaced( const ::com::sun::star::ui::ConfigurationEvent
& Event
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
103 using cppu::OPropertySetHelper::disposing
;
104 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& aEvent
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
110 // OPropertySetHelper
111 virtual sal_Bool SAL_CALL
convertFastPropertyValue ( com::sun::star::uno::Any
& aConvertedValue
,
112 com::sun::star::uno::Any
& aOldValue
,
114 const com::sun::star::uno::Any
& aValue
) throw( com::sun::star::lang::IllegalArgumentException
) SAL_OVERRIDE
;
115 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast( sal_Int32 nHandle
,
116 const com::sun::star::uno::Any
& aValue
) throw( com::sun::star::uno::Exception
, std::exception
) SAL_OVERRIDE
;
117 using cppu::OPropertySetHelper::getFastPropertyValue
;
118 virtual void SAL_CALL
getFastPropertyValue( com::sun::star::uno::Any
& aValue
,
119 sal_Int32 nHandle
) const SAL_OVERRIDE
;
120 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() SAL_OVERRIDE
;
121 virtual ::com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
123 virtual void impl_fillNewData();
125 static const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
> impl_getStaticPropertyDescriptor();
128 bool m_bPersistent
: 1,
130 m_bConfigListener
: 1,
131 m_bConfigListening
: 1,
134 OUString m_aResourceURL
;
135 com::sun::star::uno::Reference
< ::com::sun::star::ui::XUIConfigurationManager
> m_xConfigSource
;
136 com::sun::star::uno::Reference
< com::sun::star::container::XIndexAccess
> m_xConfigData
;
137 com::sun::star::uno::WeakReference
< com::sun::star::frame::XFrame
> m_xWeakFrame
;
138 com::sun::star::uno::Reference
< com::sun::star::awt::XMenuBar
> m_xMenuBar
;
139 ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer
; /// container for ALL Listener
142 } // namespace framework
144 #endif // INCLUDED_FRAMEWORK_INC_HELPER_UICONFIGELEMENTWRAPPERBASE_HXX
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */