LibreOffice Module dbaccess (master) 1
ContainerMediator.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#pragma once
20
21#include <com/sun/star/container/XContainerListener.hpp>
22#include <com/sun/star/container/XContainer.hpp>
23#include <com/sun/star/container/XNameAccess.hpp>
24#include <com/sun/star/beans/XPropertySet.hpp>
25
28#include <rtl/ref.hxx>
29
30#include <map>
31
32namespace dbaccess
33{
34
35 class OPropertyForward;
36
38 ,public ::cppu::WeakImplHelper< css::container::XContainerListener >
39 {
40 private:
41 typedef std::map< OUString, ::rtl::Reference< OPropertyForward > > PropertyForwardList;
43 css::uno::Reference< css::container::XNameAccess > m_xSettings; // can not be weak
44 css::uno::Reference< css::container::XContainer > m_xContainer; // can not be weak
45
46 protected:
47 virtual ~OContainerMediator() override;
48
49 public:
51 const css::uno::Reference< css::container::XContainer >& _xContainer,
52 const css::uno::Reference< css::container::XNameAccess >& _xSettings
53 );
54
55 virtual void SAL_CALL elementInserted( const css::container::ContainerEvent& _rEvent ) override;
56 virtual void SAL_CALL elementRemoved( const css::container::ContainerEvent& _rEvent ) override;
57 virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& _rEvent ) override;
58 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
59
60 void notifyElementCreated(const OUString& _sElementName
61 ,const css::uno::Reference< css::beans::XPropertySet>& _xElement);
62
63 private:
68
72 const OUString& _rName,
73 const css::uno::Reference< css::beans::XPropertySet >& _rxDestination
74 );
75 };
76
77} // namespace dbaccess
78
79/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void impl_initSettings_nothrow(const OUString &_rName, const css::uno::Reference< css::beans::XPropertySet > &_rxDestination)
initializes the properties of the given object from its counterpart in our settings container
virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent &_rEvent) override
virtual ~OContainerMediator() override
void impl_cleanup_nothrow()
cleans up the instance, by deregistering as listener at the containers, and resetting them to <NULL>
css::uno::Reference< css::container::XContainer > m_xContainer
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
PropertyForwardList m_aForwardList
virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent &_rEvent) override
virtual void SAL_CALL elementInserted(const css::container::ContainerEvent &_rEvent) override
css::uno::Reference< css::container::XNameAccess > m_xSettings
void notifyElementCreated(const OUString &_sElementName, const css::uno::Reference< css::beans::XPropertySet > &_xElement)
OContainerMediator(const css::uno::Reference< css::container::XContainer > &_xContainer, const css::uno::Reference< css::container::XNameAccess > &_xSettings)
std::map< OUString, ::rtl::Reference< OPropertyForward > > PropertyForwardList