Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / toolkit / source / controls / grid / grideventforwarder.cxx
blob9de7a9a56d1bf41a6a4823ef3b10acc79de09ba3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "grideventforwarder.hxx"
21 #include "gridcontrol.hxx"
24 namespace toolkit
28 using ::com::sun::star::uno::Reference;
29 using ::com::sun::star::uno::UNO_QUERY;
30 using ::com::sun::star::uno::RuntimeException;
31 using ::com::sun::star::awt::grid::GridDataEvent;
32 using ::com::sun::star::container::ContainerEvent;
33 using ::com::sun::star::lang::EventObject;
36 //= GridEventForwarder
39 GridEventForwarder::GridEventForwarder( UnoGridControl& i_parent )
40 :m_parent( i_parent )
45 GridEventForwarder::~GridEventForwarder()
50 void SAL_CALL GridEventForwarder::acquire() throw()
52 m_parent.acquire();
56 void SAL_CALL GridEventForwarder::release() throw()
58 m_parent.release();
62 void SAL_CALL GridEventForwarder::rowsInserted( const GridDataEvent& i_event )
64 Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
65 if ( xPeer.is() )
66 xPeer->rowsInserted( i_event );
70 void SAL_CALL GridEventForwarder::rowsRemoved( const GridDataEvent& i_event )
72 Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
73 if ( xPeer.is() )
74 xPeer->rowsRemoved( i_event );
78 void SAL_CALL GridEventForwarder::dataChanged( const GridDataEvent& i_event )
80 Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
81 if ( xPeer.is() )
82 xPeer->dataChanged( i_event );
86 void SAL_CALL GridEventForwarder::rowHeadingChanged( const GridDataEvent& i_event )
88 Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
89 if ( xPeer.is() )
90 xPeer->rowHeadingChanged( i_event );
94 void SAL_CALL GridEventForwarder::elementInserted( const ContainerEvent& i_event )
96 Reference< XContainerListener > xPeer( m_parent.getPeer(), UNO_QUERY );
97 if ( xPeer.is() )
98 xPeer->elementInserted( i_event );
102 void SAL_CALL GridEventForwarder::elementRemoved( const ContainerEvent& i_event )
104 Reference< XContainerListener > xPeer( m_parent.getPeer(), UNO_QUERY );
105 if ( xPeer.is() )
106 xPeer->elementRemoved( i_event );
110 void SAL_CALL GridEventForwarder::elementReplaced( const ContainerEvent& i_event )
112 Reference< XContainerListener > xPeer( m_parent.getPeer(), UNO_QUERY );
113 if ( xPeer.is() )
114 xPeer->elementReplaced( i_event );
118 void SAL_CALL GridEventForwarder::disposing( const EventObject& i_event )
120 Reference< XEventListener > xPeer( m_parent.getPeer(), UNO_QUERY );
121 if ( xPeer.is() )
122 xPeer->disposing( i_event );
126 } // namespace toolkit
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */