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 TOOLKIT_GRIDEVENTFORWARDER_HXX
25 #define TOOLKIT_GRIDEVENTFORWARDER_HXX
26 
27 /** === begin UNO includes === **/
28 #include <com/sun/star/awt/grid/XGridDataListener.hpp>
29 #include <com/sun/star/awt/grid/XGridColumnListener.hpp>
30 #include <com/sun/star/container/XContainerListener.hpp>
31 /** === end UNO includes === **/
32 
33 #include <cppuhelper/implbase2.hxx>
34 
35 //......................................................................................................................
36 namespace toolkit
37 {
38 //......................................................................................................................
39 
40     class UnoGridControl;
41 
42 	//==================================================================================================================
43 	//= GridEventForwarder
44 	//==================================================================================================================
45     typedef ::cppu::ImplHelper2 <   ::com::sun::star::awt::grid::XGridDataListener
46                                 ,   ::com::sun::star::container::XContainerListener
47                                 >   GridEventForwarder_Base;
48 
49     class GridEventForwarder : public GridEventForwarder_Base
50 	{
51     public:
52         GridEventForwarder( UnoGridControl& i_parent );
53         virtual ~GridEventForwarder();
54 
55     public:
56         // XInterface
57         virtual void SAL_CALL acquire() throw();
58         virtual void SAL_CALL release() throw();
59 
60         // XGridDataListener
61         virtual void SAL_CALL rowsInserted( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
62         virtual void SAL_CALL rowsRemoved( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
63         virtual void SAL_CALL dataChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
64         virtual void SAL_CALL rowHeadingChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
65 
66         // XContainerListener
67         virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
68         virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
69         virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
70 
71         // XEventListener
72         virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
73 
74     private:
75         UnoGridControl& m_parent;
76 	};
77 
78 //......................................................................................................................
79 } // namespace toolkit
80 //......................................................................................................................
81 
82 #endif // TOOLKIT_GRIDEVENTFORWARDER_HXX
83