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 : #ifndef INCLUDED_TOOLKIT_HELPER_LISTENERMULTIPLEXER_HXX
21 : #define INCLUDED_TOOLKIT_HELPER_LISTENERMULTIPLEXER_HXX
22 :
23 : #include <toolkit/dllapi.h>
24 : #include <com/sun/star/lang/XEventListener.hpp>
25 : #include <com/sun/star/awt/XFocusListener.hpp>
26 : #include <com/sun/star/awt/XWindowListener.hpp>
27 : #include <com/sun/star/awt/XVclContainerListener.hpp>
28 : #include <com/sun/star/awt/XKeyListener.hpp>
29 : #include <com/sun/star/awt/XMouseListener.hpp>
30 : #include <com/sun/star/awt/XMouseMotionListener.hpp>
31 : #include <com/sun/star/awt/XPaintListener.hpp>
32 : #include <com/sun/star/awt/XTopWindowListener.hpp>
33 : #include <com/sun/star/awt/XTextListener.hpp>
34 : #include <com/sun/star/awt/XActionListener.hpp>
35 : #include <com/sun/star/awt/XItemListener.hpp>
36 : #include <com/sun/star/awt/XTabListener.hpp>
37 : #include <com/sun/star/container/XContainerListener.hpp>
38 : #include <com/sun/star/awt/XSpinListener.hpp>
39 : #include <com/sun/star/awt/XAdjustmentListener.hpp>
40 : #include <com/sun/star/awt/XMenuListener.hpp>
41 : #include <com/sun/star/awt/tree/XTreeExpansionListener.hpp>
42 : #include <com/sun/star/awt/tree/XTreeEditListener.hpp>
43 : #include <com/sun/star/view/XSelectionChangeListener.hpp>
44 : #include <com/sun/star/util/VetoException.hpp>
45 : #include <cppuhelper/weak.hxx>
46 : #include <cppuhelper/interfacecontainer.hxx>
47 : #include <osl/mutex.hxx>
48 : #include <toolkit/helper/mutexhelper.hxx>
49 : #include <toolkit/helper/macros.hxx>
50 : #include <com/sun/star/awt/grid/XGridSelectionListener.hpp>
51 : #include <com/sun/star/awt/tab/XTabPageContainerListener.hpp>
52 :
53 : // class ListenerMultiplexerBase
54 :
55 :
56 : class TOOLKIT_DLLPUBLIC ListenerMultiplexerBase : public MutexHelper,
57 : public ::cppu::OInterfaceContainerHelper,
58 : public ::com::sun::star::uno::XInterface
59 : {
60 : private:
61 : ::cppu::OWeakObject& mrContext;
62 :
63 : protected:
64 0 : ::cppu::OWeakObject& GetContext() { return mrContext; }
65 :
66 : public:
67 : ListenerMultiplexerBase( ::cppu::OWeakObject& rSource );
68 : virtual ~ListenerMultiplexerBase();
69 :
70 : // ::com::sun::star::uno::XInterface
71 : ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
72 0 : void SAL_CALL acquire() throw() SAL_OVERRIDE { mrContext.acquire(); }
73 0 : void SAL_CALL release() throw() SAL_OVERRIDE { mrContext.release(); }
74 : };
75 :
76 :
77 :
78 : // class EventListenerMultiplexer
79 :
80 0 : DECL_LISTENERMULTIPLEXER_START( EventListenerMultiplexer, ::com::sun::star::lang::XEventListener )
81 : DECL_LISTENERMULTIPLEXER_END
82 :
83 :
84 : // class FocusListenerMultiplexer
85 :
86 0 : DECL_LISTENERMULTIPLEXER_START( FocusListenerMultiplexer, ::com::sun::star::awt::XFocusListener )
87 : void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
88 : void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
89 : DECL_LISTENERMULTIPLEXER_END
90 :
91 :
92 :
93 : // class WindowListenerMultiplexer
94 :
95 0 : DECL_LISTENERMULTIPLEXER_START( WindowListenerMultiplexer, ::com::sun::star::awt::XWindowListener )
96 : void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
97 : void SAL_CALL windowMoved( const ::com::sun::star::awt::WindowEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
98 : void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
99 : void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
100 : DECL_LISTENERMULTIPLEXER_END
101 :
102 :
103 :
104 :
105 : // class VclContainerListenerMultiplexer
106 :
107 0 : DECL_LISTENERMULTIPLEXER_START( VclContainerListenerMultiplexer, ::com::sun::star::awt::XVclContainerListener )
108 : void SAL_CALL windowAdded( const ::com::sun::star::awt::VclContainerEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
109 : void SAL_CALL windowRemoved( const ::com::sun::star::awt::VclContainerEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
110 : DECL_LISTENERMULTIPLEXER_END
111 :
112 :
113 : // class KeyListenerMultiplexer
114 :
115 0 : DECL_LISTENERMULTIPLEXER_START( KeyListenerMultiplexer, ::com::sun::star::awt::XKeyListener )
116 : void SAL_CALL keyPressed( const ::com::sun::star::awt::KeyEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
117 : void SAL_CALL keyReleased( const ::com::sun::star::awt::KeyEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
118 : DECL_LISTENERMULTIPLEXER_END
119 :
120 :
121 : // class MouseListenerMultiplexer
122 :
123 0 : DECL_LISTENERMULTIPLEXER_START_DLLPUB( MouseListenerMultiplexer, ::com::sun::star::awt::XMouseListener )
124 : void SAL_CALL mousePressed( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
125 : void SAL_CALL mouseReleased( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
126 : void SAL_CALL mouseEntered( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
127 : void SAL_CALL mouseExited( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
128 : DECL_LISTENERMULTIPLEXER_END
129 :
130 :
131 : // class MouseMotionListenerMultiplexer
132 :
133 0 : DECL_LISTENERMULTIPLEXER_START( MouseMotionListenerMultiplexer, ::com::sun::star::awt::XMouseMotionListener )
134 : void SAL_CALL mouseDragged( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
135 : void SAL_CALL mouseMoved( const ::com::sun::star::awt::MouseEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
136 : DECL_LISTENERMULTIPLEXER_END
137 :
138 :
139 : // class PaintListenerMultiplexer
140 :
141 0 : DECL_LISTENERMULTIPLEXER_START( PaintListenerMultiplexer, ::com::sun::star::awt::XPaintListener )
142 : void SAL_CALL windowPaint( const ::com::sun::star::awt::PaintEvent& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
143 : DECL_LISTENERMULTIPLEXER_END
144 :
145 :
146 : // class TopWindowListenerMultiplexer
147 :
148 0 : DECL_LISTENERMULTIPLEXER_START( TopWindowListenerMultiplexer, ::com::sun::star::awt::XTopWindowListener )
149 : void SAL_CALL windowOpened( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
150 : void SAL_CALL windowClosing( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
151 : void SAL_CALL windowClosed( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
152 : void SAL_CALL windowMinimized( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
153 : void SAL_CALL windowNormalized( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
154 : void SAL_CALL windowActivated( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
155 : void SAL_CALL windowDeactivated( const ::com::sun::star::lang::EventObject& e ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
156 : DECL_LISTENERMULTIPLEXER_END
157 :
158 :
159 : // class TextListenerMultiplexer
160 :
161 0 : DECL_LISTENERMULTIPLEXER_START_DLLPUB( TextListenerMultiplexer, ::com::sun::star::awt::XTextListener )
162 : void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
163 : DECL_LISTENERMULTIPLEXER_END
164 :
165 :
166 : // class ActionListenerMultiplexer
167 :
168 0 : DECL_LISTENERMULTIPLEXER_START_DLLPUB( ActionListenerMultiplexer, ::com::sun::star::awt::XActionListener )
169 : void SAL_CALL actionPerformed( const ::com::sun::star::awt::ActionEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
170 : DECL_LISTENERMULTIPLEXER_END
171 :
172 :
173 : // class ItemListenerMultiplexer
174 :
175 0 : DECL_LISTENERMULTIPLEXER_START_DLLPUB( ItemListenerMultiplexer, ::com::sun::star::awt::XItemListener )
176 : void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
177 : DECL_LISTENERMULTIPLEXER_END
178 :
179 :
180 : // class TabListenerMultiplexer
181 :
182 0 : DECL_LISTENERMULTIPLEXER_START_DLLPUB( TabListenerMultiplexer, ::com::sun::star::awt::XTabListener )
183 : void SAL_CALL inserted( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
184 : void SAL_CALL removed( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
185 : void SAL_CALL changed( ::sal_Int32 ID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Properties ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
186 : void SAL_CALL activated( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
187 : void SAL_CALL deactivated( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
188 : DECL_LISTENERMULTIPLEXER_END
189 :
190 :
191 : // class ContainerListenerMultiplexer
192 :
193 0 : DECL_LISTENERMULTIPLEXER_START( ContainerListenerMultiplexer, ::com::sun::star::container::XContainerListener )
194 : void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
195 : void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
196 : void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
197 : DECL_LISTENERMULTIPLEXER_END
198 :
199 :
200 : // class SpinListenerMultiplexer
201 :
202 0 : DECL_LISTENERMULTIPLEXER_START_DLLPUB( SpinListenerMultiplexer, ::com::sun::star::awt::XSpinListener )
203 : void SAL_CALL up( const ::com::sun::star::awt::SpinEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
204 : void SAL_CALL down( const ::com::sun::star::awt::SpinEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
205 : void SAL_CALL first( const ::com::sun::star::awt::SpinEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
206 : void SAL_CALL last( const ::com::sun::star::awt::SpinEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
207 : DECL_LISTENERMULTIPLEXER_END
208 :
209 :
210 : // class AdjustmentListenerMultiplexer
211 :
212 0 : DECL_LISTENERMULTIPLEXER_START( AdjustmentListenerMultiplexer, ::com::sun::star::awt::XAdjustmentListener )
213 : void SAL_CALL adjustmentValueChanged( const ::com::sun::star::awt::AdjustmentEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
214 : DECL_LISTENERMULTIPLEXER_END
215 :
216 :
217 : // class MenuListenerMultiplexer
218 :
219 0 : DECL_LISTENERMULTIPLEXER_START( MenuListenerMultiplexer, ::com::sun::star::awt::XMenuListener )
220 : void SAL_CALL itemHighlighted( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
221 : void SAL_CALL itemSelected( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
222 : void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
223 : void SAL_CALL itemDeactivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
224 : DECL_LISTENERMULTIPLEXER_END
225 :
226 :
227 : // class TreeSelectionListenerMultiplexer
228 :
229 0 : DECL_LISTENERMULTIPLEXER_START_DLLPUB( TreeSelectionListenerMultiplexer, ::com::sun::star::view::XSelectionChangeListener )
230 : virtual void SAL_CALL selectionChanged( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
231 : DECL_LISTENERMULTIPLEXER_END
232 :
233 :
234 : // class TreeExpansionListenerMultiplexer
235 :
236 0 : DECL_LISTENERMULTIPLEXER_START_DLLPUB( TreeExpansionListenerMultiplexer, ::com::sun::star::awt::tree::XTreeExpansionListener )
237 : virtual void SAL_CALL requestChildNodes( const ::com::sun::star::awt::tree::TreeExpansionEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
238 : virtual void SAL_CALL treeExpanding( const ::com::sun::star::awt::tree::TreeExpansionEvent& aEvent ) throw (::com::sun::star::awt::tree::ExpandVetoException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
239 : virtual void SAL_CALL treeCollapsing( const ::com::sun::star::awt::tree::TreeExpansionEvent& aEvent ) throw (::com::sun::star::awt::tree::ExpandVetoException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
240 : virtual void SAL_CALL treeExpanded( const ::com::sun::star::awt::tree::TreeExpansionEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
241 : virtual void SAL_CALL treeCollapsed( const ::com::sun::star::awt::tree::TreeExpansionEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
242 : DECL_LISTENERMULTIPLEXER_END
243 :
244 :
245 : // class TreeEditListenerMultiplexer
246 :
247 0 : DECL_LISTENERMULTIPLEXER_START_DLLPUB( TreeEditListenerMultiplexer, ::com::sun::star::awt::tree::XTreeEditListener )
248 : virtual void SAL_CALL nodeEditing( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& Node ) throw (::com::sun::star::uno::RuntimeException,::com::sun::star::util::VetoException, std::exception) SAL_OVERRIDE;
249 : virtual void SAL_CALL nodeEdited( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tree::XTreeNode >& Node, const OUString& NewText ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
250 : DECL_LISTENERMULTIPLEXER_END
251 :
252 :
253 : // class SelectionListenerMultiplexer
254 :
255 0 : DECL_LISTENERMULTIPLEXER_START_DLLPUB( SelectionListenerMultiplexer, ::com::sun::star::awt::grid::XGridSelectionListener )
256 : void SAL_CALL selectionChanged( const ::com::sun::star::awt::grid::GridSelectionEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
257 : DECL_LISTENERMULTIPLEXER_END
258 :
259 :
260 : // class TabPageListenerMultiplexer
261 :
262 0 : DECL_LISTENERMULTIPLEXER_START_DLLPUB( TabPageListenerMultiplexer, ::com::sun::star::awt::tab::XTabPageContainerListener )
263 : void SAL_CALL tabPageActivated( const ::com::sun::star::awt::tab::TabPageActivatedEvent& aEvent ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
264 : DECL_LISTENERMULTIPLEXER_END
265 :
266 : #endif // INCLUDED_TOOLKIT_HELPER_LISTENERMULTIPLEXER_HXX
267 :
268 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|