1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_dbaccess.hxx"
26 
27 #ifndef DBA_CONTAINERLISTENER_HXX
28 #include "ContainerListener.hxx"
29 #endif
30 
31 //........................................................................
32 namespace dbaccess
33 {
34 //........................................................................
35 
36     /** === begin UNO using === **/
37     using ::com::sun::star::container::ContainerEvent;
38     using ::com::sun::star::lang::WrappedTargetException;
39     using ::com::sun::star::uno::RuntimeException;
40     using ::com::sun::star::container::XContainerApproveListener;
41     using ::com::sun::star::container::XContainerListener;
42     using ::com::sun::star::lang::EventObject;
43     using ::com::sun::star::util::XVeto;
44     using ::com::sun::star::uno::Reference;
45     /** === end UNO using === **/
46 
47     //====================================================================
48 	//= OContainerListener
49 	//====================================================================
50     //--------------------------------------------------------------------
~OContainerListener()51     OContainerListener::~OContainerListener()
52     {
53     }
54 
55     //--------------------------------------------------------------------
approveInsertElement(const ContainerEvent & _Event)56     Reference< XVeto > SAL_CALL OContainerListener::approveInsertElement( const ContainerEvent& _Event ) throw (WrappedTargetException, RuntimeException)
57     {
58         ::osl::MutexGuard aGuard( m_rMutex );
59         if ( m_bDisposed )
60             return NULL;
61 
62         return dynamic_cast< XContainerApproveListener& >( m_rDestination ).approveInsertElement(  _Event );
63     }
64 
65     //--------------------------------------------------------------------
approveReplaceElement(const ContainerEvent & _Event)66     Reference< XVeto > SAL_CALL OContainerListener::approveReplaceElement( const ContainerEvent& _Event ) throw (WrappedTargetException, RuntimeException)
67     {
68         ::osl::MutexGuard aGuard( m_rMutex );
69         if ( m_bDisposed )
70             return NULL;
71 
72         return dynamic_cast< XContainerApproveListener& >( m_rDestination ).approveReplaceElement(  _Event );
73     }
74 
75     //--------------------------------------------------------------------
approveRemoveElement(const ContainerEvent & _Event)76     Reference< XVeto > SAL_CALL OContainerListener::approveRemoveElement( const ContainerEvent& _Event ) throw (WrappedTargetException, RuntimeException)
77     {
78         ::osl::MutexGuard aGuard( m_rMutex );
79         if ( m_bDisposed )
80             return NULL;
81 
82         return dynamic_cast< XContainerApproveListener& >( m_rDestination ).approveRemoveElement(  _Event );
83     }
84 
85     //--------------------------------------------------------------------
elementInserted(const ContainerEvent & _Event)86     void SAL_CALL OContainerListener::elementInserted( const ContainerEvent& _Event ) throw(RuntimeException)
87     {
88         ::osl::MutexGuard aGuard( m_rMutex );
89         if ( m_bDisposed )
90             return;
91 
92         dynamic_cast< XContainerListener& >( m_rDestination ).elementInserted(  _Event );
93     }
94 
95     //--------------------------------------------------------------------
elementRemoved(const ContainerEvent & _Event)96     void SAL_CALL OContainerListener::elementRemoved( const ContainerEvent& _Event ) throw(RuntimeException)
97     {
98         ::osl::MutexGuard aGuard( m_rMutex );
99         if ( m_bDisposed )
100             return;
101 
102         dynamic_cast< XContainerListener& >( m_rDestination ).elementRemoved(  _Event );
103     }
104 
105     //--------------------------------------------------------------------
elementReplaced(const ContainerEvent & _Event)106     void SAL_CALL OContainerListener::elementReplaced( const ContainerEvent& _Event ) throw(RuntimeException)
107     {
108         ::osl::MutexGuard aGuard( m_rMutex );
109         if ( m_bDisposed )
110             return;
111 
112         dynamic_cast< XContainerListener& >( m_rDestination ).elementReplaced(  _Event );
113     }
114 
115     //--------------------------------------------------------------------
disposing(const EventObject & _Source)116     void SAL_CALL OContainerListener::disposing( const EventObject& _Source ) throw(RuntimeException)
117     {
118         ::osl::MutexGuard aGuard( m_rMutex );
119         if ( m_bDisposed )
120             return;
121 
122         dynamic_cast< XContainerListener& >( m_rDestination ).disposing(  _Source );
123     }
124 
125 //........................................................................
126 }   // namespace dbaccess
127 //........................................................................
128