1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fmgridif.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_FMGRIDIF_HXX
31 #define _SVX_FMGRIDIF_HXX
33 #include "svx/svxdllapi.h"
35 #include <com/sun/star/view/XSelectionSupplier.hpp>
36 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
37 #include <com/sun/star/container/XEnumerationAccess.hpp>
38 #include <com/sun/star/container/XContainer.hpp>
39 #include <com/sun/star/container/XContainerListener.hpp>
40 #include <com/sun/star/sdbc/XRowSetListener.hpp>
41 #include <com/sun/star/sdb/XRowSetSupplier.hpp>
42 #include <com/sun/star/form/XReset.hpp>
43 #include <com/sun/star/form/XBoundComponent.hpp>
44 #include <com/sun/star/form/XLoadListener.hpp>
45 #include <com/sun/star/form/XGridControl.hpp>
46 #include <com/sun/star/form/XGridPeer.hpp>
47 #include <com/sun/star/frame/XDispatchProvider.hpp>
48 #include <com/sun/star/frame/XStatusListener.hpp>
49 #include <com/sun/star/frame/XDispatchProviderInterception.hpp>
50 #include <com/sun/star/view/XSelectionChangeListener.hpp>
51 #include <com/sun/star/util/XModeSelector.hpp>
52 #include <com/sun/star/util/XModifyListener.hpp>
53 #include <com/sun/star/util/XModifyBroadcaster.hpp>
55 #include <vcl/wintypes.hxx>
56 #include <toolkit/controls/unocontrol.hxx>
57 #include <toolkit/awt/vclxwindow.hxx>
58 #include <comphelper/uno3.hxx>
59 #include <cppuhelper/implbase10.hxx>
61 #if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_19)
62 #define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_19
63 #define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 19
64 #include <comphelper/implbase_var.hxx>
70 class OWeakSubObject
: public ::cppu::OWeakObject
73 ::cppu::OWeakObject
& m_rParent
;
76 OWeakSubObject(::cppu::OWeakObject
& rParent
) : m_rParent(rParent
) { }
78 virtual void SAL_CALL
acquire() throw() { m_rParent
.acquire(); }
79 virtual void SAL_CALL
release() throw() { m_rParent
.release(); }
82 //==================================================================
83 // FmXModifyMultiplexer
84 //==================================================================
85 class FmXModifyMultiplexer
:public OWeakSubObject
86 ,public ::cppu::OInterfaceContainerHelper
87 ,public ::com::sun::star::util::XModifyListener
90 FmXModifyMultiplexer( ::cppu::OWeakObject
& rSource
, ::osl::Mutex
& rMutex
);
91 DECLARE_UNO3_DEFAULTS(FmXModifyMultiplexer
,OWeakSubObject
);
92 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(const ::com::sun::star::uno::Type
& _rType
) throw (::com::sun::star::uno::RuntimeException
);
94 // ::com::sun::star::lang::XEventListener
95 virtual void SAL_CALL
disposing(const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
);
97 // ::com::sun::star::util::XModifyListener
98 virtual void SAL_CALL
modified(const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
);
100 // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
101 void * SAL_CALL
operator new( size_t size
) throw() { return OWeakSubObject::operator new(size
); }
102 void SAL_CALL
operator delete( void * p
) throw() { OWeakSubObject::operator delete(p
); }
105 //==================================================================
106 // FmXUpdateMultiplexer
107 //==================================================================
108 class FmXUpdateMultiplexer
: public OWeakSubObject
,
109 public ::cppu::OInterfaceContainerHelper
,
110 public ::com::sun::star::form::XUpdateListener
113 FmXUpdateMultiplexer( ::cppu::OWeakObject
& rSource
, ::osl::Mutex
& rMutex
);
114 DECLARE_UNO3_DEFAULTS(FmXUpdateMultiplexer
,OWeakSubObject
);
116 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(const ::com::sun::star::uno::Type
& _rType
) throw (::com::sun::star::uno::RuntimeException
);
118 // ::com::sun::star::lang::XEventListener
119 virtual void SAL_CALL
disposing(const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
);
121 // ::com::sun::star::form::XUpdateListener
122 virtual sal_Bool SAL_CALL
approveUpdate(const ::com::sun::star::lang::EventObject
&) throw(::com::sun::star::uno::RuntimeException
);
123 virtual void SAL_CALL
updated(const ::com::sun::star::lang::EventObject
&) throw(::com::sun::star::uno::RuntimeException
);
125 // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
126 void * SAL_CALL
operator new( size_t size
) throw() { return OWeakSubObject::operator new(size
); }
127 void SAL_CALL
operator delete( void * p
) throw() { OWeakSubObject::operator delete(p
); }
130 //==================================================================
131 // FmXSelectionMultiplexer
132 //==================================================================
133 class FmXSelectionMultiplexer
:public OWeakSubObject
134 ,public ::cppu::OInterfaceContainerHelper
135 ,public ::com::sun::star::view::XSelectionChangeListener
138 FmXSelectionMultiplexer( ::cppu::OWeakObject
& rSource
, ::osl::Mutex
& rMutex
);
139 DECLARE_UNO3_DEFAULTS(FmXSelectionMultiplexer
, OWeakSubObject
);
141 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(const ::com::sun::star::uno::Type
& _rType
) throw (::com::sun::star::uno::RuntimeException
);
143 // ::com::sun::star::lang::XEventListener
144 virtual void SAL_CALL
disposing(const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
);
146 // ::com::sun::star::view::XSelectionChangeListener
147 virtual void SAL_CALL
selectionChanged( const ::com::sun::star::lang::EventObject
& aEvent
) throw (::com::sun::star::uno::RuntimeException
);
149 // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
150 void * SAL_CALL
operator new( size_t size
) throw() { return OWeakSubObject::operator new(size
); }
151 void SAL_CALL
operator delete( void * p
) throw() { OWeakSubObject::operator delete(p
); }
154 //==================================================================
155 // FmXGridControlMultiplexer
156 //==================================================================
157 class FmXGridControlMultiplexer
:public OWeakSubObject
158 ,public ::cppu::OInterfaceContainerHelper
159 ,public ::com::sun::star::form::XGridControlListener
162 FmXGridControlMultiplexer( ::cppu::OWeakObject
& rSource
, ::osl::Mutex
& rMutex
);
163 DECLARE_UNO3_DEFAULTS( FmXGridControlMultiplexer
, OWeakSubObject
);
165 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(const ::com::sun::star::uno::Type
& _rType
) throw (::com::sun::star::uno::RuntimeException
);
167 // ::com::sun::star::lang::XEventListener
168 virtual void SAL_CALL
disposing(const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
);
170 // ::com::sun::star::view::XSelectionChangeListener
171 virtual void SAL_CALL
columnChanged( const ::com::sun::star::lang::EventObject
& _event
) throw (::com::sun::star::uno::RuntimeException
);
173 // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
174 void * SAL_CALL
operator new( size_t size
) throw() { return OWeakSubObject::operator new(size
); }
175 void SAL_CALL
operator delete( void * p
) throw() { OWeakSubObject::operator delete(p
); }
178 //==================================================================
179 // FmXContainerMultiplexer
180 //==================================================================
181 class FmXContainerMultiplexer
: public OWeakSubObject
,
182 public ::cppu::OInterfaceContainerHelper
,
183 public ::com::sun::star::container::XContainerListener
186 FmXContainerMultiplexer( ::cppu::OWeakObject
& rSource
, ::osl::Mutex
& rMutex
);
187 DECLARE_UNO3_DEFAULTS(FmXContainerMultiplexer
,OWeakSubObject
);
188 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(const ::com::sun::star::uno::Type
& _rType
) throw (::com::sun::star::uno::RuntimeException
);
190 // ::com::sun::star::lang::XEventListener
191 virtual void SAL_CALL
disposing(const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
);
193 // ::com::sun::star::container::XContainerListener
194 virtual void SAL_CALL
elementInserted(const ::com::sun::star::container::ContainerEvent
& Event
) throw(::com::sun::star::uno::RuntimeException
);
195 virtual void SAL_CALL
elementRemoved(const ::com::sun::star::container::ContainerEvent
& Event
) throw(::com::sun::star::uno::RuntimeException
);
196 virtual void SAL_CALL
elementReplaced(const ::com::sun::star::container::ContainerEvent
& Event
) throw(::com::sun::star::uno::RuntimeException
);
198 // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
199 void * SAL_CALL
operator new( size_t size
) throw() { return OWeakSubObject::operator new(size
); }
200 void SAL_CALL
operator delete( void * p
) throw() { OWeakSubObject::operator delete(p
); }
203 //==================================================================
205 //==================================================================
206 typedef ::cppu::ImplHelper10
< ::com::sun::star::form::XBoundComponent
,
207 ::com::sun::star::form::XGridControl
,
208 ::com::sun::star::util::XModifyBroadcaster
,
209 ::com::sun::star::container::XIndexAccess
,
210 ::com::sun::star::container::XEnumerationAccess
,
211 ::com::sun::star::util::XModeSelector
,
212 ::com::sun::star::container::XContainer
,
213 ::com::sun::star::frame::XDispatchProvider
,
214 ::com::sun::star::frame::XDispatchProviderInterception
,
215 ::com::sun::star::view::XSelectionSupplier
216 > FmXGridControl_BASE
;
219 class SVX_DLLPUBLIC FmXGridControl
:public UnoControl
220 ,public FmXGridControl_BASE
222 FmXModifyMultiplexer m_aModifyListeners
;
223 FmXUpdateMultiplexer m_aUpdateListeners
;
224 FmXContainerMultiplexer m_aContainerListeners
;
225 FmXSelectionMultiplexer m_aSelectionListeners
;
226 FmXGridControlMultiplexer m_aGridControlListeners
;
229 sal_uInt16 m_nPeerCreationLevel
;
232 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> m_xServiceFactory
;
235 FmXGridControl(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>&);
236 virtual ~FmXGridControl();
239 DECLARE_UNO3_AGG_DEFAULTS(FmXGridControl
, UnoControl
);
240 virtual ::com::sun::star::uno::Any SAL_CALL
queryAggregation(const ::com::sun::star::uno::Type
& _rType
) throw (::com::sun::star::uno::RuntimeException
);
243 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( ) throw(::com::sun::star::uno::RuntimeException
);
244 virtual ::com::sun::star::uno::Sequence
<sal_Int8
> SAL_CALL
getImplementationId( ) throw(::com::sun::star::uno::RuntimeException
);
246 // ::com::sun::star::lang::XComponent
247 virtual void SAL_CALL
dispose() throw(::com::sun::star::uno::RuntimeException
);
249 // ::com::sun::star::lang::XServiceInfo
250 virtual sal_Bool SAL_CALL
supportsService(const ::rtl::OUString
& ServiceName
) throw();
251 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw();
252 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames() throw();
254 // ::com::sun::star::awt::XControl
255 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
);
256 virtual sal_Bool SAL_CALL
setModel(const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlModel
>& Model
) throw(::com::sun::star::uno::RuntimeException
);
257 virtual void SAL_CALL
setDesignMode(sal_Bool bOn
) throw(::com::sun::star::uno::RuntimeException
);
259 // ::com::sun::star::awt::XView
260 virtual void SAL_CALL
draw( sal_Int32 x
, sal_Int32 y
) throw(::com::sun::star::uno::RuntimeException
);
262 // ::com::sun::star::form::XBoundComponent
263 virtual void SAL_CALL
addUpdateListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XUpdateListener
>& l
) throw(::com::sun::star::uno::RuntimeException
);
264 virtual void SAL_CALL
removeUpdateListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XUpdateListener
>& l
) throw(::com::sun::star::uno::RuntimeException
);
265 virtual sal_Bool SAL_CALL
commit() throw(::com::sun::star::uno::RuntimeException
);
267 // ::com::sun::star::container::XElementAccess
268 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType( ) throw(::com::sun::star::uno::RuntimeException
);
269 virtual sal_Bool SAL_CALL
hasElements( ) throw(::com::sun::star::uno::RuntimeException
);
271 // ::com::sun::star::container::XEnumerationAccess
272 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XEnumeration
> SAL_CALL
createEnumeration() throw(::com::sun::star::uno::RuntimeException
);
274 // ::com::sun::star::container::XIndexAccess
275 virtual sal_Int32 SAL_CALL
getCount() throw(::com::sun::star::uno::RuntimeException
);
276 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
);
278 // ::com::sun::star::form::XGridControl
279 virtual void SAL_CALL
addGridControlListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XGridControlListener
>& _listener
) throw(::com::sun::star::uno::RuntimeException
);
280 virtual void SAL_CALL
removeGridControlListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XGridControlListener
>& _listener
) throw(::com::sun::star::uno::RuntimeException
);
282 // ::com::sun::star::form::XGrid (base of XGridControl)
283 virtual sal_Int16 SAL_CALL
getCurrentColumnPosition() throw(::com::sun::star::uno::RuntimeException
);
284 virtual void SAL_CALL
setCurrentColumnPosition(sal_Int16 nPos
) throw(::com::sun::star::uno::RuntimeException
);
286 // ::com::sun::star::form::XGridFieldDataSupplier (base of XGridControl)
287 virtual ::com::sun::star::uno::Sequence
< sal_Bool
> SAL_CALL
queryFieldDataType( const ::com::sun::star::uno::Type
& xType
) throw(::com::sun::star::uno::RuntimeException
);
288 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
);
291 virtual ::rtl::OUString
GetComponentServiceName();
293 // ::com::sun::star::util::XModifyBroadcaster
294 virtual void SAL_CALL
addModifyListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& l
) throw(::com::sun::star::uno::RuntimeException
);
295 virtual void SAL_CALL
removeModifyListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& l
) throw(::com::sun::star::uno::RuntimeException
);
297 // ::com::sun::star::util::XModeSelector
298 virtual void SAL_CALL
setMode(const ::rtl::OUString
& Mode
) throw(::com::sun::star::lang::NoSupportException
, ::com::sun::star::uno::RuntimeException
);
299 virtual ::rtl::OUString SAL_CALL
getMode() throw(::com::sun::star::uno::RuntimeException
);
300 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedModes() throw(::com::sun::star::uno::RuntimeException
);
301 virtual sal_Bool SAL_CALL
supportsMode(const ::rtl::OUString
& Mode
) throw(::com::sun::star::uno::RuntimeException
);
303 // ::com::sun::star::container::XContainer
304 virtual void SAL_CALL
addContainerListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& l
) throw(::com::sun::star::uno::RuntimeException
);
305 virtual void SAL_CALL
removeContainerListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& l
) throw(::com::sun::star::uno::RuntimeException
);
307 // ::com::sun::star::frame::XDispatchProvider
308 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
);
309 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
);
311 // ::com::sun::star::frame::XDispatchProviderInterception
312 virtual void SAL_CALL
registerDispatchProviderInterceptor(const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProviderInterceptor
>& xInterceptor
) throw(::com::sun::star::uno::RuntimeException
);
313 virtual void SAL_CALL
releaseDispatchProviderInterceptor(const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProviderInterceptor
>& xInterceptor
) throw(::com::sun::star::uno::RuntimeException
);
315 // ::com::sun::star::view::XSelectionSupplier
316 virtual sal_Bool SAL_CALL
select( const ::com::sun::star::uno::Any
& aSelection
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
317 virtual ::com::sun::star::uno::Any SAL_CALL
getSelection( ) throw (::com::sun::star::uno::RuntimeException
);
318 virtual void SAL_CALL
addSelectionChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::view::XSelectionChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
319 virtual void SAL_CALL
removeSelectionChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::view::XSelectionChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
322 virtual FmXGridPeer
* imp_CreatePeer(Window
* pParent
);
323 // ImplCreatePeer waere besser ;) geht aber nicht, da dann nicht exportiert
327 //==================================================================
328 // FmXGridPeer -> Peer fuers Gridcontrol
329 //==================================================================
330 typedef ::comphelper::ImplHelper19
< ::com::sun::star::form::XGridPeer
,
331 ::com::sun::star::form::XBoundComponent
,
332 ::com::sun::star::form::XGridControl
,
333 ::com::sun::star::sdb::XRowSetSupplier
,
334 ::com::sun::star::util::XModifyBroadcaster
,
335 ::com::sun::star::beans::XPropertyChangeListener
,
336 ::com::sun::star::container::XContainerListener
,
337 ::com::sun::star::sdbc::XRowSetListener
,
338 ::com::sun::star::form::XLoadListener
,
339 ::com::sun::star::view::XSelectionChangeListener
,
340 ::com::sun::star::container::XIndexAccess
,
341 ::com::sun::star::container::XEnumerationAccess
,
342 ::com::sun::star::util::XModeSelector
,
343 ::com::sun::star::container::XContainer
,
344 ::com::sun::star::frame::XStatusListener
,
345 ::com::sun::star::frame::XDispatchProvider
,
346 ::com::sun::star::frame::XDispatchProviderInterception
,
347 ::com::sun::star::form::XResetListener
,
348 ::com::sun::star::view::XSelectionSupplier
351 class SVX_DLLPUBLIC FmXGridPeer
:public VCLXWindow
352 ,public FmXGridPeer_BASE
354 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexContainer
> m_xColumns
;
355 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRowSet
> m_xCursor
;
356 ::cppu::OInterfaceContainerHelper m_aModifyListeners
,
358 m_aContainerListeners
,
359 m_aSelectionListeners
,
360 m_aGridControlListeners
;
362 ::rtl::OUString m_aMode
;
363 sal_Int32 m_nCursorListening
;
365 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProviderInterceptor
> m_xFirstDispatchInterceptor
;
367 sal_Bool m_bInterceptingDispatch
;
369 sal_Bool
* m_pStateCache
;
370 // one bool for each supported url
371 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
> * m_pDispatchers
;
372 // one dispatcher for each supported url
373 // (I would like to have a vector here but including the stl in an exported file seems
374 // very risky to me ....)
376 class GridListenerDelegator
;
377 friend class GridListenerDelegator
;
378 GridListenerDelegator
* m_pGridListener
;
381 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> m_xServiceFactory
;
382 ::osl::Mutex m_aMutex
;
385 FmXGridPeer(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>&);
388 // spaeter Constructor, immer nach dem realen Constructor zu rufen !
389 void Create(Window
* pParent
, WinBits nStyle
);
392 DECLARE_UNO3_DEFAULTS(FmXGridPeer
, VCLXWindow
);
393 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(const ::com::sun::star::uno::Type
& _rType
) throw (::com::sun::star::uno::RuntimeException
);
396 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( ) throw(::com::sun::star::uno::RuntimeException
);
397 virtual ::com::sun::star::uno::Sequence
<sal_Int8
> SAL_CALL
getImplementationId( ) throw(::com::sun::star::uno::RuntimeException
);
399 // ::com::sun::star::lang::XUnoTunnel
400 static const ::com::sun::star::uno::Sequence
< sal_Int8
>& getUnoTunnelImplementationId() throw();
401 static FmXGridPeer
* getImplementation( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _rxIFace
) throw();
402 sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& _rIdentifier
) throw(::com::sun::star::uno::RuntimeException
);
404 // ::com::sun::star::form::XGridPeer
405 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexContainer
> SAL_CALL
getColumns( ) throw(::com::sun::star::uno::RuntimeException
);
406 virtual void SAL_CALL
setColumns( const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexContainer
>& aColumns
) throw(::com::sun::star::uno::RuntimeException
);
408 // ::com::sun::star::lang::XComponent
409 virtual void SAL_CALL
dispose() throw(::com::sun::star::uno::RuntimeException
);
411 // ::com::sun::star::lang::XEventListener
412 virtual void SAL_CALL
disposing(const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
);
414 // ::com::sun::star::form::XBoundComponent
415 virtual void SAL_CALL
addUpdateListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XUpdateListener
>& l
) throw(::com::sun::star::uno::RuntimeException
);
416 virtual void SAL_CALL
removeUpdateListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XUpdateListener
>& l
) throw(::com::sun::star::uno::RuntimeException
);
417 virtual sal_Bool SAL_CALL
commit() throw(::com::sun::star::uno::RuntimeException
);
419 // ::com::sun::star::container::XElementAccess
420 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType( ) throw(::com::sun::star::uno::RuntimeException
);
421 virtual sal_Bool SAL_CALL
hasElements( ) throw(::com::sun::star::uno::RuntimeException
);
423 // ::com::sun::star::container::XEnumerationAccess
424 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XEnumeration
> SAL_CALL
createEnumeration() throw(::com::sun::star::uno::RuntimeException
);
426 // ::com::sun::star::container::XIndexAccess
427 virtual sal_Int32 SAL_CALL
getCount() throw(::com::sun::star::uno::RuntimeException
);
428 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
);
430 // ::com::sun::star::beans::XPropertyChangeListener
431 virtual void SAL_CALL SAL_CALL
propertyChange(const ::com::sun::star::beans::PropertyChangeEvent
& evt
) throw(::com::sun::star::uno::RuntimeException
);
433 // ::com::sun::star::form::XLoadListener
434 virtual void SAL_CALL
loaded(const ::com::sun::star::lang::EventObject
& rEvent
) throw(::com::sun::star::uno::RuntimeException
);
435 virtual void SAL_CALL
unloaded(const ::com::sun::star::lang::EventObject
& rEvent
) throw(::com::sun::star::uno::RuntimeException
);
436 virtual void SAL_CALL
unloading(const ::com::sun::star::lang::EventObject
& aEvent
) throw(::com::sun::star::uno::RuntimeException
);
437 virtual void SAL_CALL
reloading(const ::com::sun::star::lang::EventObject
& aEvent
) throw(::com::sun::star::uno::RuntimeException
);
438 virtual void SAL_CALL
reloaded(const ::com::sun::star::lang::EventObject
& aEvent
) throw(::com::sun::star::uno::RuntimeException
);
440 // ::com::sun::star::sdbc::XRowSetListener
441 virtual void SAL_CALL
cursorMoved(const ::com::sun::star::lang::EventObject
& event
) throw(::com::sun::star::uno::RuntimeException
);
442 virtual void SAL_CALL
rowChanged(const ::com::sun::star::lang::EventObject
& event
) throw(::com::sun::star::uno::RuntimeException
);
443 virtual void SAL_CALL
rowSetChanged(const ::com::sun::star::lang::EventObject
& event
) throw(::com::sun::star::uno::RuntimeException
);
445 // ::com::sun::star::container::XContainerListener
446 virtual void SAL_CALL
elementInserted(const ::com::sun::star::container::ContainerEvent
& Event
) throw(::com::sun::star::uno::RuntimeException
);
447 virtual void SAL_CALL
elementRemoved(const ::com::sun::star::container::ContainerEvent
& Event
) throw(::com::sun::star::uno::RuntimeException
);
448 virtual void SAL_CALL
elementReplaced(const ::com::sun::star::container::ContainerEvent
& Event
) throw(::com::sun::star::uno::RuntimeException
);
451 virtual void SAL_CALL
setProperty( const ::rtl::OUString
& PropertyName
, const ::com::sun::star::uno::Any
& Value
) throw(::com::sun::star::uno::RuntimeException
);
452 virtual ::com::sun::star::uno::Any SAL_CALL
getProperty( const ::rtl::OUString
& PropertyName
) throw(::com::sun::star::uno::RuntimeException
);
453 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessibleContext
>
454 CreateAccessibleContext();
456 // ::com::sun::star::form::XGridControl
457 virtual void SAL_CALL
addGridControlListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XGridControlListener
>& _listener
) throw(::com::sun::star::uno::RuntimeException
);
458 virtual void SAL_CALL
removeGridControlListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XGridControlListener
>& _listener
) throw(::com::sun::star::uno::RuntimeException
);
460 // ::com::sun::star::form::XGrid (base of XGridControl)
461 virtual sal_Int16 SAL_CALL
getCurrentColumnPosition() throw(::com::sun::star::uno::RuntimeException
);
462 virtual void SAL_CALL
setCurrentColumnPosition(sal_Int16 nPos
) throw(::com::sun::star::uno::RuntimeException
);
464 // ::com::sun::star::form::XGridFieldDataSupplier (base of XGridControl)
465 virtual ::com::sun::star::uno::Sequence
< sal_Bool
> SAL_CALL
queryFieldDataType( const ::com::sun::star::uno::Type
& xType
) throw(::com::sun::star::uno::RuntimeException
);
466 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
);
468 // ::com::sun::star::sdb::XRowSetSupplier
469 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRowSet
> SAL_CALL
getRowSet() throw(::com::sun::star::uno::RuntimeException
);
470 virtual void SAL_CALL
setRowSet(const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRowSet
>& xDataSource
) throw(::com::sun::star::uno::RuntimeException
);
472 // ::com::sun::star::util::XModifyBroadcaster
473 virtual void SAL_CALL
addModifyListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& l
) throw(::com::sun::star::uno::RuntimeException
);
474 virtual void SAL_CALL
removeModifyListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& l
) throw(::com::sun::star::uno::RuntimeException
);
477 virtual void SAL_CALL SAL_CALL
setDesignMode(sal_Bool bOn
) throw(::com::sun::star::uno::RuntimeException
);
478 virtual sal_Bool SAL_CALL
isDesignMode() throw(::com::sun::star::uno::RuntimeException
);
480 // ::com::sun::star::view::XSelectionChangeListener
481 virtual void SAL_CALL
selectionChanged(const ::com::sun::star::lang::EventObject
& aEvent
) throw(::com::sun::star::uno::RuntimeException
);
486 void updateGrid(const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRowSet
>& _rDatabaseCursor
);
487 void startCursorListening();
488 void stopCursorListening();
490 // ::com::sun::star::util::XModeSelector
491 virtual void SAL_CALL
setMode(const ::rtl::OUString
& Mode
) throw(::com::sun::star::lang::NoSupportException
, ::com::sun::star::uno::RuntimeException
);
492 virtual ::rtl::OUString SAL_CALL
getMode() throw(::com::sun::star::uno::RuntimeException
);
493 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedModes() throw(::com::sun::star::uno::RuntimeException
);
494 virtual sal_Bool SAL_CALL
supportsMode(const ::rtl::OUString
& Mode
) throw(::com::sun::star::uno::RuntimeException
);
496 // ::com::sun::star::container::XContainer
497 virtual void SAL_CALL
addContainerListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& l
) throw(::com::sun::star::uno::RuntimeException
);
498 virtual void SAL_CALL
removeContainerListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& l
) throw(::com::sun::star::uno::RuntimeException
);
500 void columnVisible(DbGridColumn
* pColumn
);
501 void columnHidden(DbGridColumn
* pColumn
);
503 // ::com::sun::star::awt::XView
504 virtual void SAL_CALL
draw( sal_Int32 x
, sal_Int32 y
) throw(::com::sun::star::uno::RuntimeException
);
506 // ::com::sun::star::frame::XDispatchProvider
507 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
);
508 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
);
510 // ::com::sun::star::frame::XDispatchProviderInterception
511 virtual void SAL_CALL
registerDispatchProviderInterceptor(const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProviderInterceptor
>& xInterceptor
) throw(::com::sun::star::uno::RuntimeException
);
512 virtual void SAL_CALL
releaseDispatchProviderInterceptor(const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProviderInterceptor
>& xInterceptor
) throw(::com::sun::star::uno::RuntimeException
);
514 // ::com::sun::star::frame::XStatusListener
515 virtual void SAL_CALL
statusChanged(const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw(::com::sun::star::uno::RuntimeException
);
517 // ::com::sun::star::form::XResetListener
518 virtual sal_Bool SAL_CALL
approveReset(const ::com::sun::star::lang::EventObject
& rEvent
) throw(::com::sun::star::uno::RuntimeException
);
519 virtual void SAL_CALL
resetted(const ::com::sun::star::lang::EventObject
& rEvent
) throw(::com::sun::star::uno::RuntimeException
);
521 // ::com::sun::star::view::XSelectionSupplier
522 virtual sal_Bool SAL_CALL
select( const ::com::sun::star::uno::Any
& aSelection
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
523 virtual ::com::sun::star::uno::Any SAL_CALL
getSelection( ) throw (::com::sun::star::uno::RuntimeException
);
524 virtual void SAL_CALL
addSelectionChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::view::XSelectionChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
525 virtual void SAL_CALL
removeSelectionChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::view::XSelectionChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
528 virtual FmGridControl
* imp_CreateControl(Window
* pParent
, WinBits nStyle
);
530 static ::com::sun::star::uno::Sequence
< ::com::sun::star::util::URL
>& getSupportedURLs();
531 static ::com::sun::star::uno::Sequence
<sal_uInt16
>& getSupportedGridSlots();
532 void ConnectToDispatcher();
533 void DisConnectFromDispatcher();
534 void UpdateDispatches(); // will connect if not already connected and just update else
536 /** If a derived class wants to listen at some column properties, it doesn't have
537 to overload all methods affecting columns (setColumns, elementInserted, elementRemoved ...)
538 Instead it may use addColumnListeners and removeColumnListeners which are called in all
541 virtual void addColumnListeners(const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xCol
);
542 virtual void removeColumnListeners(const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xCol
);
544 void selectionChanged();
545 void columnChanged();
547 DECL_LINK(OnQueryGridSlotState
, void*);
548 DECL_LINK(OnExecuteGridSlot
, void*);
553 #endif // _SVX_FMGRID_HXX