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 22 : void SAL_CALL GridEventForwarder::acquire() throw()
59 : {
60 22 : m_parent.acquire();
61 22 : }
62 :
63 :
64 22 : void SAL_CALL GridEventForwarder::release() throw()
65 : {
66 22 : m_parent.release();
67 22 : }
68 :
69 :
70 2 : void SAL_CALL GridEventForwarder::rowsInserted( const GridDataEvent& i_event ) throw (RuntimeException, std::exception)
71 : {
72 2 : Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
73 2 : if ( xPeer.is() )
74 2 : xPeer->rowsInserted( i_event );
75 2 : }
76 :
77 :
78 1 : void SAL_CALL GridEventForwarder::rowsRemoved( const GridDataEvent& i_event ) throw (RuntimeException, std::exception)
79 : {
80 1 : Reference< XGridDataListener > xPeer( m_parent.getPeer(), UNO_QUERY );
81 1 : if ( xPeer.is() )
82 1 : xPeer->rowsRemoved( i_event );
83 1 : }
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 3 : void SAL_CALL GridEventForwarder::elementInserted( const ContainerEvent& i_event ) throw (RuntimeException, std::exception)
103 : {
104 3 : Reference< XContainerListener > xPeer( m_parent.getPeer(), UNO_QUERY );
105 3 : if ( xPeer.is() )
106 3 : xPeer->elementInserted( i_event );
107 3 : }
108 :
109 :
110 1 : void SAL_CALL GridEventForwarder::elementRemoved( const ContainerEvent& i_event ) throw (RuntimeException, std::exception)
111 : {
112 1 : Reference< XContainerListener > xPeer( m_parent.getPeer(), UNO_QUERY );
113 1 : if ( xPeer.is() )
114 1 : xPeer->elementRemoved( i_event );
115 1 : }
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: */
|