1 /*************************************************************************
2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3  *
4  * Copyright 2000, 2010 Oracle and/or its affiliates.
5  *
6  * OpenOffice.org - a multi-platform office productivity suite
7  *
8  * This file is part of OpenOffice.org.
9  *
10  * OpenOffice.org is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU Lesser General Public License version 3
12  * only, as published by the Free Software Foundation.
13  *
14  * OpenOffice.org is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU Lesser General Public License version 3 for more details
18  * (a copy is included in the LICENSE file that accompanied this code).
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with OpenOffice.org.  If not, see
22  * <http://www.openoffice.org/license.html>
23  * for a copy of the LGPLv3 License.
24  *
25  ************************************************************************/
26 
27 #ifndef TOOLKIT_GRIDEVENTFORWARDER_HXX
28 #define TOOLKIT_GRIDEVENTFORWARDER_HXX
29 
30 /** === begin UNO includes === **/
31 #include <com/sun/star/awt/grid/XGridDataListener.hpp>
32 #include <com/sun/star/awt/grid/XGridColumnListener.hpp>
33 #include <com/sun/star/container/XContainerListener.hpp>
34 /** === end UNO includes === **/
35 
36 #include <cppuhelper/implbase2.hxx>
37 
38 //......................................................................................................................
39 namespace toolkit
40 {
41 //......................................................................................................................
42 
43     class UnoGridControl;
44 
45 	//==================================================================================================================
46 	//= GridEventForwarder
47 	//==================================================================================================================
48     typedef ::cppu::ImplHelper2 <   ::com::sun::star::awt::grid::XGridDataListener
49                                 ,   ::com::sun::star::container::XContainerListener
50                                 >   GridEventForwarder_Base;
51 
52     class GridEventForwarder : public GridEventForwarder_Base
53 	{
54     public:
55         GridEventForwarder( UnoGridControl& i_parent );
56         virtual ~GridEventForwarder();
57 
58     public:
59         // XInterface
60         virtual void SAL_CALL acquire() throw();
61         virtual void SAL_CALL release() throw();
62 
63         // XGridDataListener
64         virtual void SAL_CALL rowsInserted( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
65         virtual void SAL_CALL rowsRemoved( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
66         virtual void SAL_CALL dataChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
67         virtual void SAL_CALL rowHeadingChanged( const ::com::sun::star::awt::grid::GridDataEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
68 
69         // XContainerListener
70         virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
71         virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
72         virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
73 
74         // XEventListener
75         virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException);
76 
77     private:
78         UnoGridControl& m_parent;
79 	};
80 
81 //......................................................................................................................
82 } // namespace toolkit
83 //......................................................................................................................
84 
85 #endif // TOOLKIT_GRIDEVENTFORWARDER_HXX
86