1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 RPTUI_PROPERTYSETFORWARD_HXX
20 #define RPTUI_PROPERTYSETFORWARD_HXX
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"
31 //........................................................................
34 //........................................................................
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
;
52 OPropertyMediator(OPropertyMediator
&);
53 void operator =(OPropertyMediator
&);
55 virtual ~OPropertyMediator();
57 /** this function is called upon disposing the component
59 virtual void SAL_CALL
disposing();
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 ,sal_Bool _bReverse
= sal_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
);
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
);
72 /** stop the listening mode.
76 /** starts the listening mode again.
78 void startListening();
80 //........................................................................
82 //........................................................................
83 #endif // RPTUI_PROPERTYSETFORWARD_HXX
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */