xref: /AOO41X/main/dbaccess/source/core/inc/PropertyForward.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef DBA_PROPERTYSETFORWARD_HXX
28 #define DBA_PROPERTYSETFORWARD_HXX
29 
30 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_
31 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
32 #endif
33 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
34 #include <com/sun/star/beans/XPropertySet.hpp>
35 #endif
36 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_
37 #include <com/sun/star/beans/XPropertySetInfo.hpp>
38 #endif
39 #ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
40 #include <com/sun/star/container/XNameContainer.hpp>
41 #endif
42 #ifndef _CPPUHELPER_IMPLBASE1_HXX_
43 #include <cppuhelper/implbase1.hxx>
44 #endif
45 #ifndef _COMPHELPER_BROADCASTHELPER_HXX_
46 #include <comphelper/broadcasthelper.hxx>
47 #endif
48 
49 #include <vector>
50 
51 //........................................................................
52 namespace dbaccess
53 {
54 //........................................................................
55 
56     // ===================================================================
57     // = OPropertyForward
58     // ===================================================================
59 	typedef	::cppu::WeakImplHelper1	<	::com::sun::star::beans::XPropertyChangeListener
60 									>	OPropertyForward_Base;
61     class OPropertyForward  :public ::comphelper::OBaseMutex
62 							,public OPropertyForward_Base
63 	{
64         ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >       m_xSource;
65         ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >       m_xDest;
66         ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >   m_xDestInfo;
67         ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >    m_xDestContainer;
68         ::rtl::OUString	    m_sName;
69         sal_Bool		    m_bInInsert;
70 
71     protected:
72 		virtual ~OPropertyForward();
73 
74 	public:
75 		OPropertyForward( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xSource,
76 						  const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _xDestContainer,
77 						  const ::rtl::OUString& _sName,
78 						  const ::std::vector< ::rtl::OUString >& _aPropertyList
79                          );
80 
81 		// ::com::sun::star::beans::XPropertyChangeListener
82 		virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException);
83 
84 		// ::com::sun::star::lang::XEventListener
85         virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& _rSource ) throw (::com::sun::star::uno::RuntimeException);
86 
87         inline void setName( const ::rtl::OUString& _sName ) { m_sName = _sName; }
88 		void setDefinition( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xDest);
89         inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getDefinition() const { return m_xDest; }
90     };
91 
92 //........................................................................
93 }	// namespace dbaccess
94 //........................................................................
95 #endif // DBA_PROPERTYSETFORWARD_HXX
96 
97