Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 :
21 : #include "ContainerListener.hxx"
22 :
23 : //........................................................................
24 : namespace dbaccess
25 : {
26 : //........................................................................
27 :
28 : /** === begin UNO using === **/
29 : using ::com::sun::star::container::ContainerEvent;
30 : using ::com::sun::star::lang::WrappedTargetException;
31 : using ::com::sun::star::uno::RuntimeException;
32 : using ::com::sun::star::container::XContainerApproveListener;
33 : using ::com::sun::star::container::XContainerListener;
34 : using ::com::sun::star::lang::EventObject;
35 : using ::com::sun::star::util::XVeto;
36 : using ::com::sun::star::uno::Reference;
37 : /** === end UNO using === **/
38 :
39 : //====================================================================
40 : //= OContainerListener
41 : //====================================================================
42 : //--------------------------------------------------------------------
43 0 : OContainerListener::~OContainerListener()
44 : {
45 0 : }
46 :
47 : //--------------------------------------------------------------------
48 0 : Reference< XVeto > SAL_CALL OContainerListener::approveInsertElement( const ContainerEvent& _Event ) throw (WrappedTargetException, RuntimeException)
49 : {
50 0 : ::osl::MutexGuard aGuard( m_rMutex );
51 0 : if ( m_bDisposed )
52 0 : return NULL;
53 :
54 0 : return dynamic_cast< XContainerApproveListener& >( m_rDestination ).approveInsertElement( _Event );
55 : }
56 :
57 : //--------------------------------------------------------------------
58 0 : Reference< XVeto > SAL_CALL OContainerListener::approveReplaceElement( const ContainerEvent& _Event ) throw (WrappedTargetException, RuntimeException)
59 : {
60 0 : ::osl::MutexGuard aGuard( m_rMutex );
61 0 : if ( m_bDisposed )
62 0 : return NULL;
63 :
64 0 : return dynamic_cast< XContainerApproveListener& >( m_rDestination ).approveReplaceElement( _Event );
65 : }
66 :
67 : //--------------------------------------------------------------------
68 0 : Reference< XVeto > SAL_CALL OContainerListener::approveRemoveElement( const ContainerEvent& _Event ) throw (WrappedTargetException, RuntimeException)
69 : {
70 0 : ::osl::MutexGuard aGuard( m_rMutex );
71 0 : if ( m_bDisposed )
72 0 : return NULL;
73 :
74 0 : return dynamic_cast< XContainerApproveListener& >( m_rDestination ).approveRemoveElement( _Event );
75 : }
76 :
77 : //--------------------------------------------------------------------
78 0 : void SAL_CALL OContainerListener::elementInserted( const ContainerEvent& _Event ) throw(RuntimeException)
79 : {
80 0 : ::osl::MutexGuard aGuard( m_rMutex );
81 0 : if ( m_bDisposed )
82 0 : return;
83 :
84 0 : dynamic_cast< XContainerListener& >( m_rDestination ).elementInserted( _Event );
85 : }
86 :
87 : //--------------------------------------------------------------------
88 0 : void SAL_CALL OContainerListener::elementRemoved( const ContainerEvent& _Event ) throw(RuntimeException)
89 : {
90 0 : ::osl::MutexGuard aGuard( m_rMutex );
91 0 : if ( m_bDisposed )
92 0 : return;
93 :
94 0 : dynamic_cast< XContainerListener& >( m_rDestination ).elementRemoved( _Event );
95 : }
96 :
97 : //--------------------------------------------------------------------
98 0 : void SAL_CALL OContainerListener::elementReplaced( const ContainerEvent& _Event ) throw(RuntimeException)
99 : {
100 0 : ::osl::MutexGuard aGuard( m_rMutex );
101 0 : if ( m_bDisposed )
102 0 : return;
103 :
104 0 : dynamic_cast< XContainerListener& >( m_rDestination ).elementReplaced( _Event );
105 : }
106 :
107 : //--------------------------------------------------------------------
108 0 : void SAL_CALL OContainerListener::disposing( const EventObject& _Source ) throw(RuntimeException)
109 : {
110 0 : ::osl::MutexGuard aGuard( m_rMutex );
111 0 : if ( m_bDisposed )
112 0 : return;
113 :
114 0 : dynamic_cast< XContainerListener& >( m_rDestination ).disposing( _Source );
115 : }
116 :
117 : //........................................................................
118 : } // namespace dbaccess
119 : //........................................................................
120 :
121 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|