Branch data 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 : : #include "grideventforwarder.hxx"
21 : : #include "gridcontrol.hxx"
22 : :
23 : : //......................................................................................................................
24 : : namespace toolkit
25 : : {
26 : : //......................................................................................................................
27 : :
28 : : /** === begin UNO using === **/
29 : : using ::com::sun::star::uno::Reference;
30 : : using ::com::sun::star::uno::XInterface;
31 : : using ::com::sun::star::uno::UNO_QUERY;
32 : : using ::com::sun::star::uno::UNO_QUERY_THROW;
33 : : using ::com::sun::star::uno::UNO_SET_THROW;
34 : : using ::com::sun::star::uno::Exception;
35 : : using ::com::sun::star::uno::RuntimeException;
36 : : using ::com::sun::star::uno::Any;
37 : : using ::com::sun::star::uno::makeAny;
38 : : using ::com::sun::star::uno::Sequence;
39 : : using ::com::sun::star::uno::Type;
40 : : using ::com::sun::star::awt::grid::GridDataEvent;
41 : : using ::com::sun::star::container::ContainerEvent;
42 : : using ::com::sun::star::lang::EventObject;
43 : : /** === end UNO using === **/
44 : :
45 : : //==================================================================================================================
46 : : //= GridEventForwarder
47 : : //==================================================================================================================
48 : : //------------------------------------------------------------------------------------------------------------------
49 : 0 : GridEventForwarder::GridEventForwarder( UnoGridControl& i_parent )
50 : 0 : :m_parent( i_parent )
51 : : {
52 : 0 : }
53 : :
54 : : //------------------------------------------------------------------------------------------------------------------
55 : 0 : GridEventForwarder::~GridEventForwarder()
56 : : {
57 [ # # ]: 0 : }
58 : :
59 : : //------------------------------------------------------------------------------------------------------------------
60 : 0 : void SAL_CALL GridEventForwarder::acquire() throw()
61 : : {
62 : 0 : m_parent.acquire();
63 : 0 : }
64 : :
65 : : //------------------------------------------------------------------------------------------------------------------
66 : 0 : void SAL_CALL GridEventForwarder::release() throw()
67 : : {
68 : 0 : m_parent.release();
69 : 0 : }
70 : :
71 : : //------------------------------------------------------------------------------------------------------------------
72 : 0 : void SAL_CALL GridEventForwarder::rowsInserted( const GridDataEvent& i_event ) throw (RuntimeException)
73 : : {
74 [ # # ][ # # ]: 0 : Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
75 [ # # ]: 0 : if ( xPeer.is() )
76 [ # # ][ # # ]: 0 : xPeer->rowsInserted( i_event );
77 : 0 : }
78 : :
79 : : //------------------------------------------------------------------------------------------------------------------
80 : 0 : void SAL_CALL GridEventForwarder::rowsRemoved( const GridDataEvent& i_event ) throw (RuntimeException)
81 : : {
82 [ # # ][ # # ]: 0 : Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
83 [ # # ]: 0 : if ( xPeer.is() )
84 [ # # ][ # # ]: 0 : xPeer->rowsRemoved( i_event );
85 : 0 : }
86 : :
87 : : //------------------------------------------------------------------------------------------------------------------
88 : 0 : void SAL_CALL GridEventForwarder::dataChanged( const GridDataEvent& i_event ) throw (RuntimeException)
89 : : {
90 [ # # ][ # # ]: 0 : Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
91 [ # # ]: 0 : if ( xPeer.is() )
92 [ # # ][ # # ]: 0 : xPeer->dataChanged( i_event );
93 : 0 : }
94 : :
95 : : //------------------------------------------------------------------------------------------------------------------
96 : 0 : void SAL_CALL GridEventForwarder::rowHeadingChanged( const GridDataEvent& i_event ) throw (RuntimeException)
97 : : {
98 [ # # ][ # # ]: 0 : Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
99 [ # # ]: 0 : if ( xPeer.is() )
100 [ # # ][ # # ]: 0 : xPeer->rowHeadingChanged( i_event );
101 : 0 : }
102 : :
103 : : //------------------------------------------------------------------------------------------------------------------
104 : 0 : void SAL_CALL GridEventForwarder::elementInserted( const ContainerEvent& i_event ) throw (RuntimeException)
105 : : {
106 [ # # ][ # # ]: 0 : Reference< XContainerListener > xPeer( m_parent.getPeer(), UNO_QUERY );
107 [ # # ]: 0 : if ( xPeer.is() )
108 [ # # ][ # # ]: 0 : xPeer->elementInserted( i_event );
109 : 0 : }
110 : :
111 : : //------------------------------------------------------------------------------------------------------------------
112 : 0 : void SAL_CALL GridEventForwarder::elementRemoved( const ContainerEvent& i_event ) throw (RuntimeException)
113 : : {
114 [ # # ][ # # ]: 0 : Reference< XContainerListener > xPeer( m_parent.getPeer(), UNO_QUERY );
115 [ # # ]: 0 : if ( xPeer.is() )
116 [ # # ][ # # ]: 0 : xPeer->elementRemoved( i_event );
117 : 0 : }
118 : :
119 : : //------------------------------------------------------------------------------------------------------------------
120 : 0 : void SAL_CALL GridEventForwarder::elementReplaced( const ContainerEvent& i_event ) throw (RuntimeException)
121 : : {
122 [ # # ][ # # ]: 0 : Reference< XContainerListener > xPeer( m_parent.getPeer(), UNO_QUERY );
123 [ # # ]: 0 : if ( xPeer.is() )
124 [ # # ][ # # ]: 0 : xPeer->elementReplaced( i_event );
125 : 0 : }
126 : :
127 : : //------------------------------------------------------------------------------------------------------------------
128 : 0 : void SAL_CALL GridEventForwarder::disposing( const EventObject& i_event ) throw (RuntimeException)
129 : : {
130 [ # # ][ # # ]: 0 : Reference< XEventListener > xPeer( m_parent.getPeer(), UNO_QUERY );
131 [ # # ]: 0 : if ( xPeer.is() )
132 [ # # ][ # # ]: 0 : xPeer->disposing( i_event );
133 : 0 : }
134 : :
135 : : //......................................................................................................................
136 : : } // namespace toolkit
137 : : //......................................................................................................................
138 : :
139 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|