merge the formfield patch from ooo-build
[ooovba.git] / reportdesign / inc / PropertyForward.hxx
blob257bc8b947fdefb05b1b934b72d49904e56e853a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: PropertyForward.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef RPTUI_PROPERTYSETFORWARD_HXX
31 #define RPTUI_PROPERTYSETFORWARD_HXX
33 #include "dllapi.h"
34 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
35 #include <com/sun/star/beans/XPropertySet.hpp>
36 #include <com/sun/star/beans/XPropertySetInfo.hpp>
37 #include <cppuhelper/compbase1.hxx>
38 #include "cppuhelper/basemutex.hxx"
39 #include "RptDef.hxx"
42 //........................................................................
43 namespace rptui
45 //........................................................................
46 typedef ::cppu::WeakComponentImplHelper1< ::com::sun::star::beans::XPropertyChangeListener
47 > OPropertyForward_Base;
49 /** \class OPropertyMediator
50 * \brief This class ensures the communication between two XPropertySet instances.
51 * Identical properties will be set at the other propertyset.
52 * \ingroup reportdesign_source_ui_misc
54 class REPORTDESIGN_DLLPUBLIC OPropertyMediator : public ::cppu::BaseMutex
55 ,public OPropertyForward_Base
57 TPropertyNamePair m_aNameMap;
58 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xSource;
59 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> m_xSourceInfo;
60 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xDest;
61 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> m_xDestInfo;
62 sal_Bool m_bInChange;
63 OPropertyMediator(OPropertyMediator&);
64 void operator =(OPropertyMediator&);
65 protected:
66 virtual ~OPropertyMediator();
68 /** this function is called upon disposing the component
70 virtual void SAL_CALL disposing();
71 public:
72 OPropertyMediator(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xSource
73 ,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xDest
74 ,const TPropertyNamePair& _aNameMap
75 ,sal_Bool _bReverse = sal_False);
77 // ::com::sun::star::beans::XPropertyChangeListener
78 virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException);
80 // ::com::sun::star::lang::XEventListener
81 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& _rSource ) throw (::com::sun::star::uno::RuntimeException);
83 /** stop the listening mode.
85 void stopListening();
87 /** starts the listening mode again.
89 void startListening();
91 //........................................................................
92 } // namespace rptui
93 //........................................................................
94 #endif // RPTUI_PROPERTYSETFORWARD_HXX