1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: PropertyForward.hxx,v $
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
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"
42 //........................................................................
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
;
63 OPropertyMediator(OPropertyMediator
&);
64 void operator =(OPropertyMediator
&);
66 virtual ~OPropertyMediator();
68 /** this function is called upon disposing the component
70 virtual void SAL_CALL
disposing();
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.
87 /** starts the listening mode again.
89 void startListening();
91 //........................................................................
93 //........................................................................
94 #endif // RPTUI_PROPERTYSETFORWARD_HXX