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 .
19 #ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTAINERMEDIATOR_HXX
20 #define INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTAINERMEDIATOR_HXX
22 #include <com/sun/star/container/XContainerListener.hpp>
23 #include <com/sun/star/container/XContainer.hpp>
24 #include <com/sun/star/container/XNameContainer.hpp>
25 #include <com/sun/star/beans/XPropertySet.hpp>
27 #include <cppuhelper/basemutex.hxx>
28 #include <cppuhelper/implbase.hxx>
29 #include <rtl/ref.hxx>
36 class OPropertyForward
;
38 class OContainerMediator
: public ::cppu::BaseMutex
39 ,public ::cppu::WeakImplHelper
< css::container::XContainerListener
>
42 typedef ::rtl::Reference
< OPropertyForward
> TPropertyForward
;
43 typedef ::std::map
< OUString
, TPropertyForward
> PropertyForwardList
;
44 PropertyForwardList m_aForwardList
;
45 css::uno::Reference
< css::container::XNameAccess
> m_xSettings
; // can not be weak
46 css::uno::Reference
< css::container::XContainer
> m_xContainer
; // can not be weak
49 virtual ~OContainerMediator() override
;
53 const css::uno::Reference
< css::container::XContainer
>& _xContainer
,
54 const css::uno::Reference
< css::container::XNameAccess
>& _xSettings
57 virtual void SAL_CALL
elementInserted( const css::container::ContainerEvent
& _rEvent
) throw(css::uno::RuntimeException
, std::exception
) override
;
58 virtual void SAL_CALL
elementRemoved( const css::container::ContainerEvent
& _rEvent
) throw(css::uno::RuntimeException
, std::exception
) override
;
59 virtual void SAL_CALL
elementReplaced( const css::container::ContainerEvent
& _rEvent
) throw(css::uno::RuntimeException
, std::exception
) override
;
60 virtual void SAL_CALL
disposing( const css::lang::EventObject
& Source
) throw(css::uno::RuntimeException
, std::exception
) override
;
62 void notifyElementCreated(const OUString
& _sElementName
63 ,const css::uno::Reference
< css::beans::XPropertySet
>& _xElement
);
66 /** cleans up the instance, by deregistering as listener at the containers,
67 and resetting them to <NULL/>
69 void impl_cleanup_nothrow();
71 /** initializes the properties of the given object from its counterpart in our settings container
73 void impl_initSettings_nothrow(
74 const OUString
& _rName
,
75 const css::uno::Reference
< css::beans::XPropertySet
>& _rxDestination
79 } // namespace dbaccess
81 #endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTAINERMEDIATOR_HXX
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */