2010-10-27 12:33:13 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-14 17:39:53 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2013-11-05 02:18:53 +01:00
|
|
|
#ifndef INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTAINERMEDIATOR_HXX
|
|
|
|
#define INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTAINERMEDIATOR_HXX
|
2004-08-02 14:12:21 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/container/XContainerListener.hpp>
|
|
|
|
#include <com/sun/star/container/XContainer.hpp>
|
|
|
|
#include <com/sun/star/container/XNameContainer.hpp>
|
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
2006-10-18 12:28:07 +00:00
|
|
|
|
2016-07-01 09:46:23 +02:00
|
|
|
#include <cppuhelper/basemutex.hxx>
|
2015-07-17 11:59:26 +09:00
|
|
|
#include <cppuhelper/implbase.hxx>
|
2006-10-18 12:28:07 +00:00
|
|
|
#include <rtl/ref.hxx>
|
2004-08-02 14:12:21 +00:00
|
|
|
|
2006-10-18 12:28:07 +00:00
|
|
|
#include <map>
|
2004-08-02 14:12:21 +00:00
|
|
|
|
|
|
|
namespace dbaccess
|
|
|
|
{
|
|
|
|
|
2006-10-18 12:28:07 +00:00
|
|
|
class OPropertyForward;
|
|
|
|
|
2016-07-01 09:46:23 +02:00
|
|
|
class OContainerMediator : public ::cppu::BaseMutex
|
2015-08-03 09:14:58 +02:00
|
|
|
,public ::cppu::WeakImplHelper< css::container::XContainerListener >
|
2004-08-02 14:12:21 +00:00
|
|
|
{
|
2006-10-18 12:28:07 +00:00
|
|
|
private:
|
2017-12-18 14:24:50 +02:00
|
|
|
typedef std::map< OUString, ::rtl::Reference< OPropertyForward > > PropertyForwardList;
|
2015-08-03 09:14:58 +02:00
|
|
|
PropertyForwardList m_aForwardList;
|
|
|
|
css::uno::Reference< css::container::XNameAccess > m_xSettings; // can not be weak
|
|
|
|
css::uno::Reference< css::container::XContainer > m_xContainer; // can not be weak
|
2006-10-18 12:28:07 +00:00
|
|
|
|
2004-08-02 14:12:21 +00:00
|
|
|
protected:
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~OContainerMediator() override;
|
2006-10-18 12:28:07 +00:00
|
|
|
|
2004-08-02 14:12:21 +00:00
|
|
|
public:
|
2006-10-18 12:28:07 +00:00
|
|
|
OContainerMediator(
|
2015-08-03 09:14:58 +02:00
|
|
|
const css::uno::Reference< css::container::XContainer >& _xContainer,
|
2015-11-24 11:28:56 +01:00
|
|
|
const css::uno::Reference< css::container::XNameAccess >& _xSettings
|
2006-10-18 12:28:07 +00:00
|
|
|
);
|
2004-08-02 14:12:21 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL elementInserted( const css::container::ContainerEvent& _rEvent ) override;
|
|
|
|
virtual void SAL_CALL elementRemoved( const css::container::ContainerEvent& _rEvent ) override;
|
|
|
|
virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& _rEvent ) override;
|
|
|
|
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
|
2004-08-02 14:12:21 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void notifyElementCreated(const OUString& _sElementName
|
2015-08-03 09:14:58 +02:00
|
|
|
,const css::uno::Reference< css::beans::XPropertySet>& _xElement);
|
2006-10-18 12:28:07 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
/** cleans up the instance, by deregistering as listener at the containers,
|
|
|
|
and resetting them to <NULL/>
|
|
|
|
*/
|
|
|
|
void impl_cleanup_nothrow();
|
|
|
|
|
2009-11-03 14:53:24 +01:00
|
|
|
/** initializes the properties of the given object from its counterpart in our settings container
|
2006-10-18 12:28:07 +00:00
|
|
|
*/
|
2009-11-03 14:53:24 +01:00
|
|
|
void impl_initSettings_nothrow(
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& _rName,
|
2015-08-03 09:14:58 +02:00
|
|
|
const css::uno::Reference< css::beans::XPropertySet >& _rxDestination
|
2009-11-03 14:53:24 +01:00
|
|
|
);
|
2004-08-02 14:12:21 +00:00
|
|
|
};
|
2010-10-13 00:09:16 +02:00
|
|
|
|
2004-08-02 14:12:21 +00:00
|
|
|
} // namespace dbaccess
|
|
|
|
|
2013-11-05 02:18:53 +01:00
|
|
|
#endif // INCLUDED_DBACCESS_SOURCE_CORE_INC_CONTAINERMEDIATOR_HXX
|
2010-10-27 12:33:13 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|