bump product version to 5.0.4.1
[LibreOffice.git] / reportdesign / inc / PropertyForward.hxx
blobb77d0cd60eeadc4023dbba4586f1c87b88816f77
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/compbase1.hxx>
27 #include <cppuhelper/basemutex.hxx>
28 #include "RptDef.hxx"
32 namespace rptui
35 typedef ::cppu::WeakComponentImplHelper1< ::com::sun::star::beans::XPropertyChangeListener
36 > OPropertyForward_Base;
38 /** \class OPropertyMediator
39 * \brief This class ensures the communication between two XPropertySet instances.
40 * Identical properties will be set at the other propertyset.
41 * \ingroup reportdesign_source_ui_misc
43 class REPORTDESIGN_DLLPUBLIC OPropertyMediator : public ::cppu::BaseMutex
44 ,public OPropertyForward_Base
46 TPropertyNamePair m_aNameMap;
47 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xSource;
48 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> m_xSourceInfo;
49 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xDest;
50 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> m_xDestInfo;
51 bool m_bInChange;
52 OPropertyMediator(OPropertyMediator&) SAL_DELETED_FUNCTION;
53 void operator =(OPropertyMediator&) SAL_DELETED_FUNCTION;
54 protected:
55 virtual ~OPropertyMediator();
57 /** this function is called upon disposing the component
59 virtual void SAL_CALL disposing() SAL_OVERRIDE;
60 public:
61 OPropertyMediator(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xSource
62 ,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xDest
63 ,const TPropertyNamePair& _aNameMap
64 ,bool _bReverse = false);
66 // ::com::sun::star::beans::XPropertyChangeListener
67 virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
69 // ::com::sun::star::lang::XEventListener
70 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& _rSource ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
72 /** stop the listening mode.
74 void stopListening();
76 /** starts the listening mode again.
78 void startListening();
81 } // namespace rptui
83 #endif // INCLUDED_REPORTDESIGN_INC_PROPERTYFORWARD_HXX
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */