Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / reportdesign / inc / PropertyForward.hxx
blobc86858d877202ad908e2840029de151db5268518
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_REPORTDESIGN_INC_PROPERTYFORWARD_HXX
20 #define INCLUDED_REPORTDESIGN_INC_PROPERTYFORWARD_HXX
22 #include "dllapi.h"
23 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/beans/XPropertySetInfo.hpp>
26 #include <cppuhelper/compbase.hxx>
27 #include <cppuhelper/basemutex.hxx>
28 #include "RptDef.hxx"
31 namespace rptui
34 typedef ::cppu::WeakComponentImplHelper< css::beans::XPropertyChangeListener
35 > OPropertyForward_Base;
37 /** \class OPropertyMediator
38 * \brief This class ensures the communication between two XPropertySet instances.
39 * Identical properties will be set at the other propertyset.
40 * \ingroup reportdesign_source_ui_misc
42 class REPORTDESIGN_DLLPUBLIC OPropertyMediator : public ::cppu::BaseMutex
43 ,public OPropertyForward_Base
45 TPropertyNamePair m_aNameMap;
46 css::uno::Reference< css::beans::XPropertySet> m_xSource;
47 css::uno::Reference< css::beans::XPropertySetInfo> m_xSourceInfo;
48 css::uno::Reference< css::beans::XPropertySet> m_xDest;
49 css::uno::Reference< css::beans::XPropertySetInfo> m_xDestInfo;
50 bool m_bInChange;
51 OPropertyMediator(OPropertyMediator const &) = delete;
52 void operator =(OPropertyMediator const &) = delete;
53 protected:
54 virtual ~OPropertyMediator() override;
56 /** this function is called upon disposing the component
58 virtual void SAL_CALL disposing() override;
59 public:
60 OPropertyMediator(const css::uno::Reference< css::beans::XPropertySet>& _xSource
61 ,const css::uno::Reference< css::beans::XPropertySet>& _xDest
62 ,const TPropertyNamePair& _aNameMap
63 ,bool _bReverse = false);
65 // css::beans::XPropertyChangeListener
66 virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& evt ) override;
68 // css::lang::XEventListener
69 virtual void SAL_CALL disposing( const css::lang::EventObject& _rSource ) override;
71 /** stop the listening mode.
73 void stopListening();
75 /** starts the listening mode again.
77 void startListening();
80 } // namespace rptui
82 #endif // INCLUDED_REPORTDESIGN_INC_PROPERTYFORWARD_HXX
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */