Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _SVX_FMGRIDIF_HXX
29 : : #define _SVX_FMGRIDIF_HXX
30 : :
31 : : #include "svx/svxdllapi.h"
32 : :
33 : : #include <com/sun/star/view/XSelectionSupplier.hpp>
34 : : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
35 : : #include <com/sun/star/container/XEnumerationAccess.hpp>
36 : : #include <com/sun/star/container/XContainer.hpp>
37 : : #include <com/sun/star/container/XContainerListener.hpp>
38 : : #include <com/sun/star/sdbc/XRowSetListener.hpp>
39 : : #include <com/sun/star/sdb/XRowSetSupplier.hpp>
40 : : #include <com/sun/star/form/XReset.hpp>
41 : : #include <com/sun/star/form/XBoundComponent.hpp>
42 : : #include <com/sun/star/form/XLoadListener.hpp>
43 : : #include <com/sun/star/form/XGridControl.hpp>
44 : : #include <com/sun/star/form/XGridPeer.hpp>
45 : : #include <com/sun/star/frame/XDispatchProvider.hpp>
46 : : #include <com/sun/star/frame/XStatusListener.hpp>
47 : : #include <com/sun/star/frame/XDispatchProviderInterception.hpp>
48 : : #include <com/sun/star/view/XSelectionChangeListener.hpp>
49 : : #include <com/sun/star/util/XModeSelector.hpp>
50 : : #include <com/sun/star/util/XModifyListener.hpp>
51 : : #include <com/sun/star/util/XModifyBroadcaster.hpp>
52 : :
53 : : #include <tools/wintypes.hxx>
54 : : #include <toolkit/controls/unocontrol.hxx>
55 : : #include <toolkit/awt/vclxwindow.hxx>
56 : : #include <comphelper/uno3.hxx>
57 : : #include <cppuhelper/implbase10.hxx>
58 : :
59 : : #ifndef INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_19
60 : : #define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_19
61 : : #define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 19
62 : : #include <comphelper/implbase_var.hxx>
63 : : #endif
64 : :
65 : :
66 : : class DbGridColumn;
67 : :
68 [ # # ]: 0 : class OWeakSubObject : public ::cppu::OWeakObject
69 : : {
70 : : protected:
71 : : ::cppu::OWeakObject& m_rParent;
72 : :
73 : : public:
74 : : OWeakSubObject(::cppu::OWeakObject& rParent) : m_rParent(rParent) { }
75 : :
76 : 0 : virtual void SAL_CALL acquire() throw() { m_rParent.acquire(); }
77 : 0 : virtual void SAL_CALL release() throw() { m_rParent.release(); }
78 : : };
79 : :
80 : : //==================================================================
81 : : // FmXModifyMultiplexer
82 : : //==================================================================
83 : : class FmXModifyMultiplexer :public OWeakSubObject
84 : : ,public ::cppu::OInterfaceContainerHelper
85 : : ,public ::com::sun::star::util::XModifyListener
86 : : {
87 : : public:
88 : : FmXModifyMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex );
89 : 0 : DECLARE_UNO3_DEFAULTS(FmXModifyMultiplexer,OWeakSubObject);
90 : : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
91 : :
92 : : // ::com::sun::star::lang::XEventListener
93 : : virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
94 : :
95 : : // ::com::sun::star::util::XModifyListener
96 : : virtual void SAL_CALL modified(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
97 : :
98 : : // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
99 : : void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); }
100 : : void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); }
101 : : };
102 : :
103 : : //==================================================================
104 : : // FmXUpdateMultiplexer
105 : : //==================================================================
106 : : class FmXUpdateMultiplexer : public OWeakSubObject,
107 : : public ::cppu::OInterfaceContainerHelper,
108 : : public ::com::sun::star::form::XUpdateListener
109 : : {
110 : : public:
111 : : FmXUpdateMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex );
112 : 0 : DECLARE_UNO3_DEFAULTS(FmXUpdateMultiplexer,OWeakSubObject);
113 : :
114 : : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
115 : :
116 : : // ::com::sun::star::lang::XEventListener
117 : : virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
118 : :
119 : : // ::com::sun::star::form::XUpdateListener
120 : : virtual sal_Bool SAL_CALL approveUpdate(const ::com::sun::star::lang::EventObject &) throw(::com::sun::star::uno::RuntimeException);
121 : : virtual void SAL_CALL updated(const ::com::sun::star::lang::EventObject &) throw(::com::sun::star::uno::RuntimeException);
122 : :
123 : : // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
124 : : void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); }
125 : : void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); }
126 : : };
127 : :
128 : : //==================================================================
129 : : // FmXSelectionMultiplexer
130 : : //==================================================================
131 : : class FmXSelectionMultiplexer :public OWeakSubObject
132 : : ,public ::cppu::OInterfaceContainerHelper
133 : : ,public ::com::sun::star::view::XSelectionChangeListener
134 : : {
135 : : public:
136 : : FmXSelectionMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex );
137 : 0 : DECLARE_UNO3_DEFAULTS(FmXSelectionMultiplexer, OWeakSubObject);
138 : :
139 : : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
140 : :
141 : : // ::com::sun::star::lang::XEventListener
142 : : virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
143 : :
144 : : // ::com::sun::star::view::XSelectionChangeListener
145 : : virtual void SAL_CALL selectionChanged( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
146 : :
147 : : // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
148 : : void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); }
149 : : void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); }
150 : : };
151 : :
152 : : //==================================================================
153 : : // FmXGridControlMultiplexer
154 : : //==================================================================
155 : : class FmXGridControlMultiplexer :public OWeakSubObject
156 : : ,public ::cppu::OInterfaceContainerHelper
157 : : ,public ::com::sun::star::form::XGridControlListener
158 : : {
159 : : public:
160 : : FmXGridControlMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex );
161 : 0 : DECLARE_UNO3_DEFAULTS( FmXGridControlMultiplexer, OWeakSubObject );
162 : :
163 : : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
164 : :
165 : : // ::com::sun::star::lang::XEventListener
166 : : virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
167 : :
168 : : // ::com::sun::star::view::XSelectionChangeListener
169 : : virtual void SAL_CALL columnChanged( const ::com::sun::star::lang::EventObject& _event ) throw (::com::sun::star::uno::RuntimeException);
170 : :
171 : : // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
172 : : void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); }
173 : : void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); }
174 : : };
175 : :
176 : : //==================================================================
177 : : // FmXContainerMultiplexer
178 : : //==================================================================
179 : : class FmXContainerMultiplexer : public OWeakSubObject,
180 : : public ::cppu::OInterfaceContainerHelper,
181 : : public ::com::sun::star::container::XContainerListener
182 : : {
183 : : public:
184 : : FmXContainerMultiplexer( ::cppu::OWeakObject& rSource, ::osl::Mutex& rMutex);
185 : 0 : DECLARE_UNO3_DEFAULTS(FmXContainerMultiplexer,OWeakSubObject);
186 : : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
187 : :
188 : : // ::com::sun::star::lang::XEventListener
189 : : virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
190 : :
191 : : // ::com::sun::star::container::XContainerListener
192 : : virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& Event) throw(::com::sun::star::uno::RuntimeException);
193 : : virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& Event) throw(::com::sun::star::uno::RuntimeException);
194 : : virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& Event) throw(::com::sun::star::uno::RuntimeException);
195 : :
196 : : // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
197 : : void * SAL_CALL operator new( size_t size ) throw() { return OWeakSubObject::operator new(size); }
198 : : void SAL_CALL operator delete( void * p ) throw() { OWeakSubObject::operator delete(p); }
199 : : };
200 : :
201 : : //==================================================================
202 : : // FmXGridControl
203 : : //==================================================================
204 : : typedef ::cppu::ImplHelper10< ::com::sun::star::form::XBoundComponent,
205 : : ::com::sun::star::form::XGridControl,
206 : : ::com::sun::star::util::XModifyBroadcaster,
207 : : ::com::sun::star::container::XIndexAccess,
208 : : ::com::sun::star::container::XEnumerationAccess,
209 : : ::com::sun::star::util::XModeSelector,
210 : : ::com::sun::star::container::XContainer,
211 : : ::com::sun::star::frame::XDispatchProvider,
212 : : ::com::sun::star::frame::XDispatchProviderInterception,
213 : : ::com::sun::star::view::XSelectionSupplier
214 : : > FmXGridControl_BASE;
215 : :
216 : : class FmXGridPeer;
217 : : class SVX_DLLPUBLIC FmXGridControl :public UnoControl
218 : : ,public FmXGridControl_BASE
219 : : {
220 : : FmXModifyMultiplexer m_aModifyListeners;
221 : : FmXUpdateMultiplexer m_aUpdateListeners;
222 : : FmXContainerMultiplexer m_aContainerListeners;
223 : : FmXSelectionMultiplexer m_aSelectionListeners;
224 : : FmXGridControlMultiplexer m_aGridControlListeners;
225 : :
226 : : protected:
227 : : sal_uInt16 m_nPeerCreationLevel;
228 : : sal_Bool m_bInDraw;
229 : :
230 : : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory;
231 : :
232 : : public:
233 : : FmXGridControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
234 : : virtual ~FmXGridControl();
235 : :
236 : : // UNO connection
237 : 8797 : DECLARE_UNO3_AGG_DEFAULTS(FmXGridControl, UnoControl);
238 : : virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
239 : :
240 : : // XTypeProvider
241 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
242 : : virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
243 : :
244 : : // ::com::sun::star::lang::XComponent
245 : : virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
246 : :
247 : : // ::com::sun::star::lang::XServiceInfo
248 : : virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw();
249 : : virtual ::rtl::OUString SAL_CALL getImplementationName() throw();
250 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw();
251 : :
252 : : // ::com::sun::star::awt::XControl
253 : : virtual void SAL_CALL createPeer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& _rToolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent) throw(::com::sun::star::uno::RuntimeException);
254 : : virtual sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw(::com::sun::star::uno::RuntimeException);
255 : : virtual void SAL_CALL setDesignMode(sal_Bool bOn) throw(::com::sun::star::uno::RuntimeException);
256 : :
257 : : // ::com::sun::star::awt::XView
258 : : virtual void SAL_CALL draw( sal_Int32 x, sal_Int32 y ) throw(::com::sun::star::uno::RuntimeException);
259 : :
260 : : // ::com::sun::star::form::XBoundComponent
261 : : virtual void SAL_CALL addUpdateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XUpdateListener >& l) throw(::com::sun::star::uno::RuntimeException);
262 : : virtual void SAL_CALL removeUpdateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XUpdateListener >& l) throw(::com::sun::star::uno::RuntimeException);
263 : : virtual sal_Bool SAL_CALL commit() throw(::com::sun::star::uno::RuntimeException);
264 : :
265 : : // ::com::sun::star::container::XElementAccess
266 : : virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
267 : : virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
268 : :
269 : : // ::com::sun::star::container::XEnumerationAccess
270 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration() throw(::com::sun::star::uno::RuntimeException);
271 : :
272 : : // ::com::sun::star::container::XIndexAccess
273 : : virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
274 : : virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 _rIndex) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
275 : :
276 : : // ::com::sun::star::form::XGridControl
277 : : virtual void SAL_CALL addGridControlListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XGridControlListener >& _listener ) throw(::com::sun::star::uno::RuntimeException);
278 : : virtual void SAL_CALL removeGridControlListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XGridControlListener >& _listener ) throw(::com::sun::star::uno::RuntimeException);
279 : :
280 : : // ::com::sun::star::form::XGrid (base of XGridControl)
281 : : virtual sal_Int16 SAL_CALL getCurrentColumnPosition() throw(::com::sun::star::uno::RuntimeException);
282 : : virtual void SAL_CALL setCurrentColumnPosition(sal_Int16 nPos) throw(::com::sun::star::uno::RuntimeException);
283 : :
284 : : // ::com::sun::star::form::XGridFieldDataSupplier (base of XGridControl)
285 : : virtual ::com::sun::star::uno::Sequence< sal_Bool > SAL_CALL queryFieldDataType( const ::com::sun::star::uno::Type& xType ) throw(::com::sun::star::uno::RuntimeException);
286 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL queryFieldData( sal_Int32 nRow, const ::com::sun::star::uno::Type& xType ) throw(::com::sun::star::uno::RuntimeException);
287 : :
288 : : // UnoControl
289 : : virtual ::rtl::OUString GetComponentServiceName();
290 : :
291 : : // ::com::sun::star::util::XModifyBroadcaster
292 : : virtual void SAL_CALL addModifyListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& l) throw(::com::sun::star::uno::RuntimeException);
293 : : virtual void SAL_CALL removeModifyListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& l) throw(::com::sun::star::uno::RuntimeException);
294 : :
295 : : // ::com::sun::star::util::XModeSelector
296 : : virtual void SAL_CALL setMode(const ::rtl::OUString& Mode) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
297 : : virtual ::rtl::OUString SAL_CALL getMode() throw(::com::sun::star::uno::RuntimeException);
298 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedModes() throw(::com::sun::star::uno::RuntimeException);
299 : : virtual sal_Bool SAL_CALL supportsMode(const ::rtl::OUString& Mode) throw(::com::sun::star::uno::RuntimeException);
300 : :
301 : : // ::com::sun::star::container::XContainer
302 : : virtual void SAL_CALL addContainerListener(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& l) throw(::com::sun::star::uno::RuntimeException);
303 : : virtual void SAL_CALL removeContainerListener(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& l) throw(::com::sun::star::uno::RuntimeException);
304 : :
305 : : // ::com::sun::star::frame::XDispatchProvider
306 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch(const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw(::com::sun::star::uno::RuntimeException);
307 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches(const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& aDescripts) throw(::com::sun::star::uno::RuntimeException);
308 : :
309 : : // ::com::sun::star::frame::XDispatchProviderInterception
310 : : virtual void SAL_CALL registerDispatchProviderInterceptor(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& xInterceptor) throw(::com::sun::star::uno::RuntimeException);
311 : : virtual void SAL_CALL releaseDispatchProviderInterceptor(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& xInterceptor) throw(::com::sun::star::uno::RuntimeException);
312 : :
313 : : // ::com::sun::star::view::XSelectionSupplier
314 : : virtual sal_Bool SAL_CALL select( const ::com::sun::star::uno::Any& aSelection ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
315 : : virtual ::com::sun::star::uno::Any SAL_CALL getSelection( ) throw (::com::sun::star::uno::RuntimeException);
316 : : virtual void SAL_CALL addSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
317 : : virtual void SAL_CALL removeSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
318 : :
319 : : protected:
320 : : virtual FmXGridPeer* imp_CreatePeer(Window* pParent);
321 : : // ImplCreatePeer would be better, but doesn't work because it's not exported
322 : :
323 : : };
324 : :
325 : : //==================================================================
326 : : // FmXGridPeer -> Peer for the Gridcontrol
327 : : //==================================================================
328 : : typedef ::comphelper::ImplHelper19 < ::com::sun::star::form::XGridPeer,
329 : : ::com::sun::star::form::XBoundComponent,
330 : : ::com::sun::star::form::XGridControl,
331 : : ::com::sun::star::sdb::XRowSetSupplier,
332 : : ::com::sun::star::util::XModifyBroadcaster,
333 : : ::com::sun::star::beans::XPropertyChangeListener,
334 : : ::com::sun::star::container::XContainerListener,
335 : : ::com::sun::star::sdbc::XRowSetListener,
336 : : ::com::sun::star::form::XLoadListener,
337 : : ::com::sun::star::view::XSelectionChangeListener,
338 : : ::com::sun::star::container::XIndexAccess,
339 : : ::com::sun::star::container::XEnumerationAccess,
340 : : ::com::sun::star::util::XModeSelector,
341 : : ::com::sun::star::container::XContainer,
342 : : ::com::sun::star::frame::XStatusListener,
343 : : ::com::sun::star::frame::XDispatchProvider,
344 : : ::com::sun::star::frame::XDispatchProviderInterception,
345 : : ::com::sun::star::form::XResetListener,
346 : : ::com::sun::star::view::XSelectionSupplier
347 : : > FmXGridPeer_BASE;
348 : : class FmGridControl;
349 : : class SVX_DLLPUBLIC FmXGridPeer :public VCLXWindow
350 : : ,public FmXGridPeer_BASE
351 : : {
352 : : ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > m_xColumns;
353 : : ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > m_xCursor;
354 : : ::cppu::OInterfaceContainerHelper m_aModifyListeners,
355 : : m_aUpdateListeners,
356 : : m_aContainerListeners,
357 : : m_aSelectionListeners,
358 : : m_aGridControlListeners;
359 : :
360 : : ::rtl::OUString m_aMode;
361 : : sal_Int32 m_nCursorListening;
362 : :
363 : : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > m_xFirstDispatchInterceptor;
364 : :
365 : : sal_Bool m_bInterceptingDispatch;
366 : :
367 : : sal_Bool* m_pStateCache;
368 : : // one bool for each supported url
369 : : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > * m_pDispatchers;
370 : : // one dispatcher for each supported url
371 : : // (I would like to have a vector here but including the stl in an exported file seems
372 : : // very risky to me ....)
373 : :
374 : : class GridListenerDelegator;
375 : : friend class GridListenerDelegator;
376 : : GridListenerDelegator* m_pGridListener;
377 : :
378 : : protected:
379 : : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory;
380 : : ::osl::Mutex m_aMutex;
381 : :
382 : : public:
383 : : FmXGridPeer(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
384 : : ~FmXGridPeer();
385 : :
386 : : // spaeter Constructor, immer nach dem realen Constructor zu rufen !
387 : : void Create(Window* pParent, WinBits nStyle);
388 : :
389 : : // UNO connection
390 : 32156 : DECLARE_UNO3_DEFAULTS(FmXGridPeer, VCLXWindow);
391 : : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
392 : :
393 : : // XTypeProvider
394 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
395 : : virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
396 : :
397 : : // ::com::sun::star::lang::XUnoTunnel
398 : : static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelImplementationId() throw();
399 : : static FmXGridPeer* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxIFace ) throw();
400 : : sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& _rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
401 : :
402 : : // ::com::sun::star::form::XGridPeer
403 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException);
404 : : virtual void SAL_CALL setColumns( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& aColumns ) throw(::com::sun::star::uno::RuntimeException);
405 : :
406 : : // ::com::sun::star::lang::XComponent
407 : : virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
408 : :
409 : : // ::com::sun::star::lang::XEventListener
410 : : virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(::com::sun::star::uno::RuntimeException);
411 : :
412 : : // ::com::sun::star::form::XBoundComponent
413 : : virtual void SAL_CALL addUpdateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XUpdateListener >& l) throw(::com::sun::star::uno::RuntimeException);
414 : : virtual void SAL_CALL removeUpdateListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XUpdateListener >& l) throw(::com::sun::star::uno::RuntimeException);
415 : : virtual sal_Bool SAL_CALL commit() throw(::com::sun::star::uno::RuntimeException);
416 : :
417 : : // ::com::sun::star::container::XElementAccess
418 : : virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
419 : : virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
420 : :
421 : : // ::com::sun::star::container::XEnumerationAccess
422 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration() throw(::com::sun::star::uno::RuntimeException);
423 : :
424 : : // ::com::sun::star::container::XIndexAccess
425 : : virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
426 : : virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 _rIndex) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
427 : :
428 : : // ::com::sun::star::beans::XPropertyChangeListener
429 : : virtual void SAL_CALL SAL_CALL propertyChange(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
430 : :
431 : : // ::com::sun::star::form::XLoadListener
432 : : virtual void SAL_CALL loaded(const ::com::sun::star::lang::EventObject& rEvent) throw(::com::sun::star::uno::RuntimeException);
433 : : virtual void SAL_CALL unloaded(const ::com::sun::star::lang::EventObject& rEvent) throw(::com::sun::star::uno::RuntimeException);
434 : : virtual void SAL_CALL unloading(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException);
435 : : virtual void SAL_CALL reloading(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException);
436 : : virtual void SAL_CALL reloaded(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException);
437 : :
438 : : // ::com::sun::star::sdbc::XRowSetListener
439 : : virtual void SAL_CALL cursorMoved(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException);
440 : : virtual void SAL_CALL rowChanged(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException);
441 : : virtual void SAL_CALL rowSetChanged(const ::com::sun::star::lang::EventObject& event) throw(::com::sun::star::uno::RuntimeException);
442 : :
443 : : // ::com::sun::star::container::XContainerListener
444 : : virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& Event) throw(::com::sun::star::uno::RuntimeException);
445 : : virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& Event) throw(::com::sun::star::uno::RuntimeException);
446 : : virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& Event) throw(::com::sun::star::uno::RuntimeException);
447 : :
448 : : // VCLXWindow
449 : : virtual void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
450 : : virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
451 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
452 : : CreateAccessibleContext();
453 : :
454 : : // ::com::sun::star::form::XGridControl
455 : : virtual void SAL_CALL addGridControlListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XGridControlListener >& _listener ) throw(::com::sun::star::uno::RuntimeException);
456 : : virtual void SAL_CALL removeGridControlListener( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XGridControlListener >& _listener ) throw(::com::sun::star::uno::RuntimeException);
457 : :
458 : : // ::com::sun::star::form::XGrid (base of XGridControl)
459 : : virtual sal_Int16 SAL_CALL getCurrentColumnPosition() throw(::com::sun::star::uno::RuntimeException);
460 : : virtual void SAL_CALL setCurrentColumnPosition(sal_Int16 nPos) throw(::com::sun::star::uno::RuntimeException);
461 : :
462 : : // ::com::sun::star::form::XGridFieldDataSupplier (base of XGridControl)
463 : : virtual ::com::sun::star::uno::Sequence< sal_Bool > SAL_CALL queryFieldDataType( const ::com::sun::star::uno::Type& xType ) throw(::com::sun::star::uno::RuntimeException);
464 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL queryFieldData( sal_Int32 nRow, const ::com::sun::star::uno::Type& xType ) throw(::com::sun::star::uno::RuntimeException);
465 : :
466 : : // ::com::sun::star::sdb::XRowSetSupplier
467 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > SAL_CALL getRowSet() throw(::com::sun::star::uno::RuntimeException);
468 : : virtual void SAL_CALL setRowSet(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xDataSource) throw(::com::sun::star::uno::RuntimeException);
469 : :
470 : : // ::com::sun::star::util::XModifyBroadcaster
471 : : virtual void SAL_CALL addModifyListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& l) throw(::com::sun::star::uno::RuntimeException);
472 : : virtual void SAL_CALL removeModifyListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& l) throw(::com::sun::star::uno::RuntimeException);
473 : :
474 : : // UnoControl
475 : : virtual void SAL_CALL SAL_CALL setDesignMode(sal_Bool bOn) throw(::com::sun::star::uno::RuntimeException);
476 : : virtual sal_Bool SAL_CALL isDesignMode() throw(::com::sun::star::uno::RuntimeException);
477 : :
478 : : // ::com::sun::star::view::XSelectionChangeListener
479 : : virtual void SAL_CALL selectionChanged(const ::com::sun::star::lang::EventObject& aEvent) throw(::com::sun::star::uno::RuntimeException);
480 : :
481 : : void CellModified();
482 : :
483 : : // PropertyListening
484 : : void updateGrid(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rDatabaseCursor);
485 : : void startCursorListening();
486 : : void stopCursorListening();
487 : :
488 : : // ::com::sun::star::util::XModeSelector
489 : : virtual void SAL_CALL setMode(const ::rtl::OUString& Mode) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
490 : : virtual ::rtl::OUString SAL_CALL getMode() throw(::com::sun::star::uno::RuntimeException);
491 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedModes() throw(::com::sun::star::uno::RuntimeException);
492 : : virtual sal_Bool SAL_CALL supportsMode(const ::rtl::OUString& Mode) throw(::com::sun::star::uno::RuntimeException);
493 : :
494 : : // ::com::sun::star::container::XContainer
495 : : virtual void SAL_CALL addContainerListener(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& l) throw(::com::sun::star::uno::RuntimeException);
496 : : virtual void SAL_CALL removeContainerListener(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& l) throw(::com::sun::star::uno::RuntimeException);
497 : :
498 : : void columnVisible(DbGridColumn* pColumn);
499 : : void columnHidden(DbGridColumn* pColumn);
500 : :
501 : : // ::com::sun::star::awt::XView
502 : : virtual void SAL_CALL draw( sal_Int32 x, sal_Int32 y ) throw(::com::sun::star::uno::RuntimeException);
503 : :
504 : : // ::com::sun::star::frame::XDispatchProvider
505 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch(const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw(::com::sun::star::uno::RuntimeException);
506 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches(const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& aDescripts) throw(::com::sun::star::uno::RuntimeException);
507 : :
508 : : // ::com::sun::star::frame::XDispatchProviderInterception
509 : : virtual void SAL_CALL registerDispatchProviderInterceptor(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& xInterceptor) throw(::com::sun::star::uno::RuntimeException);
510 : : virtual void SAL_CALL releaseDispatchProviderInterceptor(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& xInterceptor) throw(::com::sun::star::uno::RuntimeException);
511 : :
512 : : // ::com::sun::star::frame::XStatusListener
513 : : virtual void SAL_CALL statusChanged(const ::com::sun::star::frame::FeatureStateEvent& Event) throw(::com::sun::star::uno::RuntimeException);
514 : :
515 : : // ::com::sun::star::form::XResetListener
516 : : virtual sal_Bool SAL_CALL approveReset(const ::com::sun::star::lang::EventObject& rEvent) throw(::com::sun::star::uno::RuntimeException);
517 : : virtual void SAL_CALL resetted(const ::com::sun::star::lang::EventObject& rEvent) throw(::com::sun::star::uno::RuntimeException);
518 : :
519 : : // ::com::sun::star::view::XSelectionSupplier
520 : : virtual sal_Bool SAL_CALL select( const ::com::sun::star::uno::Any& aSelection ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
521 : : virtual ::com::sun::star::uno::Any SAL_CALL getSelection( ) throw (::com::sun::star::uno::RuntimeException);
522 : : virtual void SAL_CALL addSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
523 : : virtual void SAL_CALL removeSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
524 : :
525 : : protected:
526 : : virtual FmGridControl* imp_CreateControl(Window* pParent, WinBits nStyle);
527 : :
528 : : static ::com::sun::star::uno::Sequence< ::com::sun::star::util::URL>& getSupportedURLs();
529 : : static ::com::sun::star::uno::Sequence<sal_uInt16>& getSupportedGridSlots();
530 : : void ConnectToDispatcher();
531 : : void DisConnectFromDispatcher();
532 : : void UpdateDispatches(); // will connect if not already connected and just update else
533 : :
534 : : /** If a derived class wants to listen at some column properties, it doesn't have
535 : : to overload all methods affecting columns (setColumns, elementInserted, elementRemoved ...)
536 : : Instead it may use addColumnListeners and removeColumnListeners which are called in all
537 : : the cases.
538 : : */
539 : : virtual void addColumnListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xCol);
540 : : virtual void removeColumnListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xCol);
541 : :
542 : : void selectionChanged();
543 : : void columnChanged();
544 : :
545 : : DECL_LINK(OnQueryGridSlotState, void*);
546 : : DECL_LINK(OnExecuteGridSlot, void*);
547 : : };
548 : :
549 : :
550 : :
551 : : #endif // _SVX_FMGRID_HXX
552 : :
553 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|