1*96de5490SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*96de5490SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*96de5490SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*96de5490SAndrew Rist  * distributed with this work for additional information
6*96de5490SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*96de5490SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*96de5490SAndrew Rist  * "License"); you may not use this file except in compliance
9*96de5490SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*96de5490SAndrew Rist  *
11*96de5490SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*96de5490SAndrew Rist  *
13*96de5490SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*96de5490SAndrew Rist  * software distributed under the License is distributed on an
15*96de5490SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*96de5490SAndrew Rist  * KIND, either express or implied.  See the License for the
17*96de5490SAndrew Rist  * specific language governing permissions and limitations
18*96de5490SAndrew Rist  * under the License.
19*96de5490SAndrew Rist  *
20*96de5490SAndrew Rist  *************************************************************/
21*96de5490SAndrew Rist 
22*96de5490SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_dbaccess.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _SBA_MULTIPLEX_HXX
28cdf0e10cSrcweir #include "sbamultiplex.hxx"
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir using namespace dbaui;
31cdf0e10cSrcweir 
32cdf0e10cSrcweir //==================================================================
33cdf0e10cSrcweir // the listener multiplexers
34cdf0e10cSrcweir //==================================================================
35cdf0e10cSrcweir 
36cdf0e10cSrcweir // XStatusListener
37cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXStatusMultiplexer, ::com::sun::star::frame::XStatusListener)
38cdf0e10cSrcweir 
39cdf0e10cSrcweir void SAL_CALL SbaXStatusMultiplexer::statusChanged(const ::com::sun::star::frame::FeatureStateEvent& e) throw (::com::sun::star::uno::RuntimeException)
40cdf0e10cSrcweir {
41cdf0e10cSrcweir 	m_aLastKnownStatus = e;
42cdf0e10cSrcweir 	m_aLastKnownStatus.Source = &m_rParent;
43cdf0e10cSrcweir 	::cppu::OInterfaceIteratorHelper aIt( *this );
44cdf0e10cSrcweir 	while ( aIt.hasMoreElements() )
45cdf0e10cSrcweir 		static_cast< ::com::sun::star::frame::XStatusListener* >( aIt.next() )->statusChanged( m_aLastKnownStatus );
46cdf0e10cSrcweir }																						\
47cdf0e10cSrcweir 
48cdf0e10cSrcweir // LoadListener
49cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXLoadMultiplexer, ::com::sun::star::form::XLoadListener)
50cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXLoadMultiplexer, ::com::sun::star::form::XLoadListener, loaded, ::com::sun::star::lang::EventObject)
51cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXLoadMultiplexer, ::com::sun::star::form::XLoadListener, unloaded, ::com::sun::star::lang::EventObject)
52cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXLoadMultiplexer, ::com::sun::star::form::XLoadListener, unloading, ::com::sun::star::lang::EventObject)
53cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXLoadMultiplexer, ::com::sun::star::form::XLoadListener, reloading, ::com::sun::star::lang::EventObject)
54cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXLoadMultiplexer, ::com::sun::star::form::XLoadListener, reloaded, ::com::sun::star::lang::EventObject)
55cdf0e10cSrcweir 
56cdf0e10cSrcweir // ::com::sun::star::sdbc::XRowSetListener
57cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXRowSetMultiplexer, ::com::sun::star::sdbc::XRowSetListener)
58cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXRowSetMultiplexer, ::com::sun::star::sdbc::XRowSetListener, cursorMoved, ::com::sun::star::lang::EventObject)
59cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXRowSetMultiplexer, ::com::sun::star::sdbc::XRowSetListener, rowChanged, ::com::sun::star::lang::EventObject)
60cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXRowSetMultiplexer, ::com::sun::star::sdbc::XRowSetListener, rowSetChanged, ::com::sun::star::lang::EventObject)
61cdf0e10cSrcweir 
62cdf0e10cSrcweir // ::com::sun::star::sdb::XRowSetApproveListener
63cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXRowSetApproveMultiplexer, ::com::sun::star::sdb::XRowSetApproveListener)
64cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(SbaXRowSetApproveMultiplexer, ::com::sun::star::sdb::XRowSetApproveListener, approveCursorMove, ::com::sun::star::lang::EventObject)
65cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(SbaXRowSetApproveMultiplexer, ::com::sun::star::sdb::XRowSetApproveListener, approveRowChange, ::com::sun::star::sdb::RowChangeEvent)
66cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(SbaXRowSetApproveMultiplexer, ::com::sun::star::sdb::XRowSetApproveListener, approveRowSetChange, ::com::sun::star::lang::EventObject)
67cdf0e10cSrcweir 
68cdf0e10cSrcweir // ::com::sun::star::sdb::XSQLErrorListener
69cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXSQLErrorMultiplexer, ::com::sun::star::sdb::XSQLErrorListener)
70cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXSQLErrorMultiplexer, ::com::sun::star::sdb::XSQLErrorListener, errorOccured, ::com::sun::star::sdb::SQLErrorEvent)
71cdf0e10cSrcweir 
72cdf0e10cSrcweir // ::com::sun::star::form::XDatabaseParameterListener
73cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXParameterMultiplexer, ::com::sun::star::form::XDatabaseParameterListener)
74cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(SbaXParameterMultiplexer, ::com::sun::star::form::XDatabaseParameterListener, approveParameter, ::com::sun::star::form::DatabaseParameterEvent)
75cdf0e10cSrcweir 
76cdf0e10cSrcweir // ::com::sun::star::form::XSubmitListener
77cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXSubmitMultiplexer, ::com::sun::star::form::XSubmitListener)
78cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(SbaXSubmitMultiplexer, ::com::sun::star::form::XSubmitListener, approveSubmit, ::com::sun::star::lang::EventObject)
79cdf0e10cSrcweir 
80cdf0e10cSrcweir // ::com::sun::star::form::XResetListener
81cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXResetMultiplexer, ::com::sun::star::form::XResetListener)
82cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_BOOL_METHOD(SbaXResetMultiplexer, ::com::sun::star::form::XResetListener, approveReset, ::com::sun::star::lang::EventObject)
83cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_VOID_METHOD(SbaXResetMultiplexer, ::com::sun::star::form::XResetListener, resetted, ::com::sun::star::lang::EventObject)
84cdf0e10cSrcweir 
85cdf0e10cSrcweir // ::com::sun::star::beans::XPropertyChangeListener
86cdf0e10cSrcweir IMPLEMENT_PROPERTY_MULTIPLEXER(SbaXPropertyChangeMultiplexer, ::com::sun::star::beans::XPropertyChangeListener, propertyChange, ::com::sun::star::beans::PropertyChangeEvent, (::com::sun::star::uno::RuntimeException))
87cdf0e10cSrcweir 
88cdf0e10cSrcweir // ::com::sun::star::beans::XVetoableChangeListener
89cdf0e10cSrcweir IMPLEMENT_PROPERTY_MULTIPLEXER(SbaXVetoableChangeMultiplexer, ::com::sun::star::beans::XVetoableChangeListener, vetoableChange, ::com::sun::star::beans::PropertyChangeEvent, (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException))
90cdf0e10cSrcweir 
91cdf0e10cSrcweir // ::com::sun::star::beans::XPropertiesChangeListener
92cdf0e10cSrcweir IMPLEMENT_LISTENER_MULTIPLEXER_CORE(SbaXPropertiesChangeMultiplexer, ::com::sun::star::beans::XPropertiesChangeListener);
93cdf0e10cSrcweir void SbaXPropertiesChangeMultiplexer::propertiesChange(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent>& aEvts) throw(::com::sun::star::uno::RuntimeException)
94cdf0e10cSrcweir {
95cdf0e10cSrcweir 	// the SbaXPropertiesChangeMultiplexer doesn't care about the property names a listener logs on for, it simply
96cdf0e10cSrcweir 	// forwards _all_ changes to _all_ listeners
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent> aMulti(aEvts);
99cdf0e10cSrcweir 	::com::sun::star::beans::PropertyChangeEvent* pMulti = aMulti.getArray();
100cdf0e10cSrcweir 	for (sal_uInt16 i=0; i<aMulti.getLength(); ++i, ++pMulti)
101cdf0e10cSrcweir 		pMulti->Source = &m_rParent;
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 	::cppu::OInterfaceIteratorHelper aIt(*this);
104cdf0e10cSrcweir 	while (aIt.hasMoreElements())
105cdf0e10cSrcweir 		((::com::sun::star::beans::XPropertiesChangeListener*)aIt.next())->propertiesChange(aMulti);
106cdf0e10cSrcweir }
107cdf0e10cSrcweir 
108