xref: /AOO41X/main/forms/source/component/errorbroadcaster.hxx (revision 2d785d7ea953737df3731803a26e291d82066c5a)
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 #ifndef FORMS_ERRORBROADCASTER_HXX
25 #define FORMS_ERRORBROADCASTER_HXX
26 
27 #include <cppuhelper/implbase1.hxx>
28 #include <com/sun/star/sdb/XSQLErrorBroadcaster.hpp>
29 #include <cppuhelper/interfacecontainer.h>
30 #include <com/sun/star/sdbc/SQLException.hpp>
31 #include <com/sun/star/sdb/SQLErrorEvent.hpp>
32 
33 //.........................................................................
34 namespace frm
35 {
36 //.........................................................................
37 
38     //=====================================================================
39     //= OErrorBroadcaster
40     //=====================================================================
41     typedef ::cppu::ImplHelper1 <   ::com::sun::star::sdb::XSQLErrorBroadcaster
42                                 >   OErrorBroadcaster_BASE;
43 
44     class OErrorBroadcaster : public OErrorBroadcaster_BASE
45     {
46     private:
47         ::cppu::OBroadcastHelper&           m_rBHelper;
48         ::cppu::OInterfaceContainerHelper   m_aErrorListeners;
49 
50     protected:
51         OErrorBroadcaster( ::cppu::OBroadcastHelper& _rBHelper );
52         virtual ~OErrorBroadcaster( );
53 
54         void SAL_CALL disposing();
55 
56         void SAL_CALL onError( const ::com::sun::star::sdbc::SQLException& _rException, const ::rtl::OUString& _rContextDescription );
57         void SAL_CALL onError( const ::com::sun::star::sdb::SQLErrorEvent& _rException );
58 
59     protected:
60     // XSQLErrorBroadcaster
61         virtual void SAL_CALL addSQLErrorListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener >& _rListener ) throw (::com::sun::star::uno::RuntimeException);
62         virtual void SAL_CALL removeSQLErrorListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSQLErrorListener >& _rListener ) throw (::com::sun::star::uno::RuntimeException);
63     };
64 
65 //.........................................................................
66 }   // namespace frm
67 //.........................................................................
68 
69 #endif // FORMS_ERRORBROADCASTER_HXX
70 
71