LibreOffice Module framework (master) 1
uiconfigelementwrapperbase.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
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>
31
32#include <rtl/ustring.hxx>
38
39namespace framework
40{
41
42typedef ::cppu::WeakImplHelper<
43 css::ui::XUIElement,
44 css::ui::XUIElementSettings,
45 css::lang::XInitialization,
46 css::lang::XComponent,
47 css::util::XUpdatable,
48 css::ui::XUIConfigurationListener > UIConfigElementWrapperBase_BASE;
49
54{
55
56 // public methods
57
58 public:
60 virtual ~UIConfigElementWrapperBase() override;
61
62 // XInterface
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;
68
69 // XTypeProvider
70 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
71
72 // XComponent
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;
76
77 // XInitialization
78 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
79
80 // XUIElementSettings
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;
84
85 // XUIElement
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;
90
91 // XUpdatable
92 virtual void SAL_CALL update() override;
93
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;
98
99 // XEventListener
101 virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) override;
102
103 // protected methods
104
105 protected:
106
107 // OPropertySetHelper
108 virtual sal_Bool SAL_CALL convertFastPropertyValue ( css::uno::Any& aConvertedValue ,
109 css::uno::Any& aOldValue ,
110 sal_Int32 nHandle ,
111 const css::uno::Any& aValue ) override;
112 virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle ,
113 const css::uno::Any& aValue ) override;
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;
119
120 virtual void impl_fillNewData();
121
122 static css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor();
123
124 sal_Int16 m_nType;
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;
137};
138
139} // namespace framework
140
141/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) SAL_OVERRIDE
void SAL_CALL disposing()
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &aValue) override
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &aConvertedValue, css::uno::Any &aOldValue, sal_Int32 nHandle, const css::uno::Any &aValue) override
virtual void SAL_CALL elementInserted(const css::ui::ConfigurationEvent &Event) override
css::uno::Reference< css::awt::XMenuBar > m_xMenuBar
virtual void SAL_CALL acquire() noexcept override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual void SAL_CALL updateSettings() override=0
virtual OUString SAL_CALL getResourceURL() override
virtual void SAL_CALL setSettings(const css::uno::Reference< css::container::XIndexAccess > &UISettings) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getRealInterface() override=0
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
virtual void SAL_CALL elementReplaced(const css::ui::ConfigurationEvent &Event) override
css::uno::Reference< css::container::XIndexAccess > m_xConfigData
virtual void SAL_CALL elementRemoved(const css::ui::ConfigurationEvent &Event) override
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getSettings(sal_Bool bWriteable) override
virtual css::uno::Reference< css::frame::XFrame > SAL_CALL getFrame() override
css::uno::WeakReference< css::frame::XFrame > m_xWeakFrame
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL dispose() override=0
virtual ::sal_Int16 SAL_CALL getType() override
virtual void SAL_CALL release() noexcept override
static css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor()
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &type) override
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &aValue, sal_Int32 nHandle) const override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
css::uno::Reference< css::ui::XUIConfigurationManager > m_xConfigSource
::cppu::WeakImplHelper< css::ui::XUIElement, css::ui::XUIElementSettings, css::lang::XInitialization, css::lang::XComponent, css::util::XUpdatable, css::ui::XUIConfigurationListener > UIConfigElementWrapperBase_BASE
QPRO_FUNC_TYPE nType
unsigned char sal_Bool