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 .
22 #include <com/sun/star/ui/XUIElement.hpp>
23 #include <com/sun/star/ui/XUIElementSettings.hpp>
24 #include <com/sun/star/ui/XUIConfigurationManager.hpp>
25 #include <com/sun/star/ui/XUIConfigurationListener.hpp>
26 #include <com/sun/star/frame/XFrame.hpp>
27 #include <com/sun/star/awt/XMenuBar.hpp>
28 #include <com/sun/star/util/XUpdatable.hpp>
29 #include <com/sun/star/lang/XInitialization.hpp>
30 #include <com/sun/star/lang/XComponent.hpp>
32 #include <rtl/ustring.hxx>
33 #include <comphelper/multicontainer2.hxx>
34 #include <cppuhelper/basemutex.hxx>
35 #include <cppuhelper/propshlp.hxx>
36 #include <cppuhelper/implbase.hxx>
37 #include <cppuhelper/weakref.hxx>
42 typedef ::cppu::WeakImplHelper
<
44 css::ui::XUIElementSettings
,
45 css::lang::XInitialization
,
46 css::lang::XComponent
,
47 css::util::XUpdatable
,
48 css::ui::XUIConfigurationListener
> UIConfigElementWrapperBase_BASE
;
50 class UIConfigElementWrapperBase
: private cppu::BaseMutex
,
51 public ::cppu::OBroadcastHelper
,
52 public ::cppu::OPropertySetHelper
,
53 public UIConfigElementWrapperBase_BASE
59 UIConfigElementWrapperBase( sal_Int16 nType
);
60 virtual ~UIConfigElementWrapperBase() override
;
63 virtual void SAL_CALL
acquire() noexcept override
64 { OWeakObject::acquire(); }
65 virtual void SAL_CALL
release() noexcept override
66 { OWeakObject::release(); }
67 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& type
) override
;
70 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
73 virtual void SAL_CALL
dispose() override
= 0;
74 virtual void SAL_CALL
addEventListener( const css::uno::Reference
< css::lang::XEventListener
>& xListener
) override
;
75 virtual void SAL_CALL
removeEventListener( const css::uno::Reference
< css::lang::XEventListener
>& aListener
) override
;
78 virtual void SAL_CALL
initialize( const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
81 virtual void SAL_CALL
updateSettings() override
= 0;
82 virtual css::uno::Reference
< css::container::XIndexAccess
> SAL_CALL
getSettings( sal_Bool bWriteable
) override
;
83 virtual void SAL_CALL
setSettings( const css::uno::Reference
< css::container::XIndexAccess
>& UISettings
) override
;
86 virtual css::uno::Reference
< css::frame::XFrame
> SAL_CALL
getFrame() override
;
87 virtual OUString SAL_CALL
getResourceURL() override
;
88 virtual ::sal_Int16 SAL_CALL
getType() override
;
89 virtual css::uno::Reference
< css::uno::XInterface
> SAL_CALL
getRealInterface() override
= 0;
92 virtual void SAL_CALL
update() override
;
94 // XUIConfigurationListener
95 virtual void SAL_CALL
elementInserted( const css::ui::ConfigurationEvent
& Event
) override
;
96 virtual void SAL_CALL
elementRemoved( const css::ui::ConfigurationEvent
& Event
) override
;
97 virtual void SAL_CALL
elementReplaced( const css::ui::ConfigurationEvent
& Event
) override
;
100 using cppu::OPropertySetHelper::disposing
;
101 virtual void SAL_CALL
disposing( const css::lang::EventObject
& aEvent
) override
;
107 // OPropertySetHelper
108 virtual sal_Bool SAL_CALL
convertFastPropertyValue ( css::uno::Any
& aConvertedValue
,
109 css::uno::Any
& aOldValue
,
111 const css::uno::Any
& aValue
) override
;
112 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast( sal_Int32 nHandle
,
113 const css::uno::Any
& aValue
) override
;
114 using cppu::OPropertySetHelper::getFastPropertyValue
;
115 virtual void SAL_CALL
getFastPropertyValue( css::uno::Any
& aValue
,
116 sal_Int32 nHandle
) const override
;
117 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() override
;
118 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() override
;
120 virtual void impl_fillNewData();
122 static css::uno::Sequence
< css::beans::Property
> impl_getStaticPropertyDescriptor();
125 bool m_bPersistent
: 1,
127 m_bConfigListener
: 1,
128 m_bConfigListening
: 1,
131 OUString m_aResourceURL
;
132 css::uno::Reference
< css::ui::XUIConfigurationManager
> m_xConfigSource
;
133 css::uno::Reference
< css::container::XIndexAccess
> m_xConfigData
;
134 css::uno::WeakReference
< css::frame::XFrame
> m_xWeakFrame
;
135 css::uno::Reference
< css::awt::XMenuBar
> m_xMenuBar
;
136 comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer
; /// container for ALL Listener
139 } // namespace framework
141 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */