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