1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SVX_FMGRIDIF_HXX
20 #define INCLUDED_SVX_FMGRIDIF_HXX
22 #include <svx/svxdllapi.h>
24 #include <com/sun/star/view/XSelectionSupplier.hpp>
25 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
26 #include <com/sun/star/container/XEnumerationAccess.hpp>
27 #include <com/sun/star/container/XContainer.hpp>
28 #include <com/sun/star/container/XContainerListener.hpp>
29 #include <com/sun/star/sdbc/XRowSetListener.hpp>
30 #include <com/sun/star/sdb/XRowSetSupplier.hpp>
31 #include <com/sun/star/form/XReset.hpp>
32 #include <com/sun/star/form/XBoundComponent.hpp>
33 #include <com/sun/star/form/XLoadListener.hpp>
34 #include <com/sun/star/form/XGridControl.hpp>
35 #include <com/sun/star/form/XGridPeer.hpp>
36 #include <com/sun/star/frame/XDispatchProvider.hpp>
37 #include <com/sun/star/frame/XStatusListener.hpp>
38 #include <com/sun/star/frame/XDispatchProviderInterception.hpp>
39 #include <com/sun/star/view/XSelectionChangeListener.hpp>
40 #include <com/sun/star/uno/XComponentContext.hpp>
41 #include <com/sun/star/util/XModeSelector.hpp>
42 #include <com/sun/star/util/XModifyListener.hpp>
43 #include <com/sun/star/util/XModifyBroadcaster.hpp>
45 #include <tools/wintypes.hxx>
46 #include <toolkit/controls/unocontrol.hxx>
47 #include <toolkit/awt/vclxwindow.hxx>
48 #include <comphelper/uno3.hxx>
49 #include <cppuhelper/implbase.hxx>
50 #include <cppuhelper/implbase10.hxx>
54 class SAL_WARN_UNUSED OWeakSubObject
: public ::cppu::OWeakObject
57 ::cppu::OWeakObject
& m_rParent
;
60 OWeakSubObject(::cppu::OWeakObject
& rParent
) : m_rParent(rParent
) { }
62 virtual void SAL_CALL
acquire() throw() SAL_OVERRIDE
{ m_rParent
.acquire(); }
63 virtual void SAL_CALL
release() throw() SAL_OVERRIDE
{ m_rParent
.release(); }
67 // FmXModifyMultiplexer
69 class SAL_WARN_UNUSED FmXModifyMultiplexer
:public OWeakSubObject
70 ,public ::cppu::OInterfaceContainerHelper
71 ,public ::com::sun::star::util::XModifyListener
74 FmXModifyMultiplexer( ::cppu::OWeakObject
& rSource
, ::osl::Mutex
& rMutex
);
75 DECLARE_UNO3_DEFAULTS(FmXModifyMultiplexer
,OWeakSubObject
)
76 virtual ::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
;
78 // ::com::sun::star::lang::XEventListener
79 virtual void SAL_CALL
disposing(const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
81 // ::com::sun::star::util::XModifyListener
82 virtual void SAL_CALL
modified(const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
84 // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
85 void * SAL_CALL
operator new( size_t size
) throw() { return OWeakSubObject::operator new(size
); }
86 void SAL_CALL
operator delete( void * p
) throw() { OWeakSubObject::operator delete(p
); }
90 // FmXUpdateMultiplexer
92 class SAL_WARN_UNUSED FmXUpdateMultiplexer
: public OWeakSubObject
,
93 public ::cppu::OInterfaceContainerHelper
,
94 public ::com::sun::star::form::XUpdateListener
97 FmXUpdateMultiplexer( ::cppu::OWeakObject
& rSource
, ::osl::Mutex
& rMutex
);
98 DECLARE_UNO3_DEFAULTS(FmXUpdateMultiplexer
,OWeakSubObject
)
100 virtual ::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
;
102 // ::com::sun::star::lang::XEventListener
103 virtual void SAL_CALL
disposing(const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
105 // ::com::sun::star::form::XUpdateListener
106 virtual sal_Bool SAL_CALL
approveUpdate(const ::com::sun::star::lang::EventObject
&) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
107 virtual void SAL_CALL
updated(const ::com::sun::star::lang::EventObject
&) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
109 // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
110 void * SAL_CALL
operator new( size_t size
) throw() { return OWeakSubObject::operator new(size
); }
111 void SAL_CALL
operator delete( void * p
) throw() { OWeakSubObject::operator delete(p
); }
115 // FmXSelectionMultiplexer
117 class SAL_WARN_UNUSED FmXSelectionMultiplexer
:public OWeakSubObject
118 ,public ::cppu::OInterfaceContainerHelper
119 ,public ::com::sun::star::view::XSelectionChangeListener
122 FmXSelectionMultiplexer( ::cppu::OWeakObject
& rSource
, ::osl::Mutex
& rMutex
);
123 DECLARE_UNO3_DEFAULTS(FmXSelectionMultiplexer
, OWeakSubObject
)
125 virtual ::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
;
127 // ::com::sun::star::lang::XEventListener
128 virtual void SAL_CALL
disposing(const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
130 // ::com::sun::star::view::XSelectionChangeListener
131 virtual void SAL_CALL
selectionChanged( const ::com::sun::star::lang::EventObject
& aEvent
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
133 // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
134 void * SAL_CALL
operator new( size_t size
) throw() { return OWeakSubObject::operator new(size
); }
135 void SAL_CALL
operator delete( void * p
) throw() { OWeakSubObject::operator delete(p
); }
139 // FmXGridControlMultiplexer
141 class SAL_WARN_UNUSED FmXGridControlMultiplexer
:public OWeakSubObject
142 ,public ::cppu::OInterfaceContainerHelper
143 ,public ::com::sun::star::form::XGridControlListener
146 FmXGridControlMultiplexer( ::cppu::OWeakObject
& rSource
, ::osl::Mutex
& rMutex
);
147 DECLARE_UNO3_DEFAULTS( FmXGridControlMultiplexer
, OWeakSubObject
)
149 virtual ::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
;
151 // ::com::sun::star::lang::XEventListener
152 virtual void SAL_CALL
disposing(const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
154 // ::com::sun::star::view::XSelectionChangeListener
155 virtual void SAL_CALL
columnChanged( const ::com::sun::star::lang::EventObject
& _event
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
157 // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
158 void * SAL_CALL
operator new( size_t size
) throw() { return OWeakSubObject::operator new(size
); }
159 void SAL_CALL
operator delete( void * p
) throw() { OWeakSubObject::operator delete(p
); }
163 // FmXContainerMultiplexer
165 class SAL_WARN_UNUSED FmXContainerMultiplexer
: public OWeakSubObject
,
166 public ::cppu::OInterfaceContainerHelper
,
167 public ::com::sun::star::container::XContainerListener
170 FmXContainerMultiplexer( ::cppu::OWeakObject
& rSource
, ::osl::Mutex
& rMutex
);
171 DECLARE_UNO3_DEFAULTS(FmXContainerMultiplexer
,OWeakSubObject
)
172 virtual ::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
;
174 // ::com::sun::star::lang::XEventListener
175 virtual void SAL_CALL
disposing(const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
177 // ::com::sun::star::container::XContainerListener
178 virtual void SAL_CALL
elementInserted(const ::com::sun::star::container::ContainerEvent
& Event
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
179 virtual void SAL_CALL
elementRemoved(const ::com::sun::star::container::ContainerEvent
& Event
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
180 virtual void SAL_CALL
elementReplaced(const ::com::sun::star::container::ContainerEvent
& Event
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
182 // resolve ambiguity : both OWeakObject and OInterfaceContainerHelper have these memory operators
183 void * SAL_CALL
operator new( size_t size
) throw() { return OWeakSubObject::operator new(size
); }
184 void SAL_CALL
operator delete( void * p
) throw() { OWeakSubObject::operator delete(p
); }
190 typedef ::cppu::ImplHelper10
< ::com::sun::star::form::XBoundComponent
,
191 ::com::sun::star::form::XGridControl
,
192 ::com::sun::star::util::XModifyBroadcaster
,
193 ::com::sun::star::container::XIndexAccess
,
194 ::com::sun::star::container::XEnumerationAccess
,
195 ::com::sun::star::util::XModeSelector
,
196 ::com::sun::star::container::XContainer
,
197 ::com::sun::star::frame::XDispatchProvider
,
198 ::com::sun::star::frame::XDispatchProviderInterception
,
199 ::com::sun::star::view::XSelectionSupplier
200 > FmXGridControl_BASE
;
203 class SVX_DLLPUBLIC SAL_WARN_UNUSED FmXGridControl
:public UnoControl
204 ,public FmXGridControl_BASE
206 FmXModifyMultiplexer m_aModifyListeners
;
207 FmXUpdateMultiplexer m_aUpdateListeners
;
208 FmXContainerMultiplexer m_aContainerListeners
;
209 FmXSelectionMultiplexer m_aSelectionListeners
;
210 FmXGridControlMultiplexer m_aGridControlListeners
;
213 sal_uInt16 m_nPeerCreationLevel
;
216 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xContext
;
219 FmXGridControl(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>&);
220 virtual ~FmXGridControl();
223 DECLARE_UNO3_AGG_DEFAULTS(FmXGridControl
, UnoControl
)
224 virtual ::com::sun::star::uno::Any SAL_CALL
queryAggregation(const ::com::sun::star::uno::Type
& _rType
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
227 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
228 virtual ::com::sun::star::uno::Sequence
<sal_Int8
> SAL_CALL
getImplementationId( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
230 // ::com::sun::star::lang::XComponent
231 virtual void SAL_CALL
dispose() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
233 // ::com::sun::star::lang::XServiceInfo
234 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) throw(std::exception
) SAL_OVERRIDE
;
235 virtual OUString SAL_CALL
getImplementationName() throw(std::exception
) SAL_OVERRIDE
;
236 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() throw(std::exception
) SAL_OVERRIDE
;
238 // ::com::sun::star::awt::XControl
239 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
, std::exception
) SAL_OVERRIDE
;
240 virtual sal_Bool SAL_CALL
setModel(const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlModel
>& Model
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
241 virtual void SAL_CALL
setDesignMode(sal_Bool bOn
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
243 // ::com::sun::star::awt::XView
244 virtual void SAL_CALL
draw( sal_Int32 x
, sal_Int32 y
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
246 // ::com::sun::star::form::XBoundComponent
247 virtual void SAL_CALL
addUpdateListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XUpdateListener
>& l
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
248 virtual void SAL_CALL
removeUpdateListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XUpdateListener
>& l
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
249 virtual sal_Bool SAL_CALL
commit() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
251 // ::com::sun::star::container::XElementAccess
252 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
253 virtual sal_Bool SAL_CALL
hasElements( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
255 // ::com::sun::star::container::XEnumerationAccess
256 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XEnumeration
> SAL_CALL
createEnumeration() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
258 // ::com::sun::star::container::XIndexAccess
259 virtual sal_Int32 SAL_CALL
getCount() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
260 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
, std::exception
) SAL_OVERRIDE
;
262 // ::com::sun::star::form::XGridControl
263 virtual void SAL_CALL
addGridControlListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XGridControlListener
>& _listener
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
264 virtual void SAL_CALL
removeGridControlListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XGridControlListener
>& _listener
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
266 // ::com::sun::star::form::XGrid (base of XGridControl)
267 virtual sal_Int16 SAL_CALL
getCurrentColumnPosition() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
268 virtual void SAL_CALL
setCurrentColumnPosition(sal_Int16 nPos
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
270 // ::com::sun::star::form::XGridFieldDataSupplier (base of XGridControl)
271 virtual ::com::sun::star::uno::Sequence
< sal_Bool
> SAL_CALL
queryFieldDataType( const ::com::sun::star::uno::Type
& xType
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
272 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
, std::exception
) SAL_OVERRIDE
;
275 virtual OUString
GetComponentServiceName() SAL_OVERRIDE
;
277 // ::com::sun::star::util::XModifyBroadcaster
278 virtual void SAL_CALL
addModifyListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& l
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
279 virtual void SAL_CALL
removeModifyListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& l
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
281 // ::com::sun::star::util::XModeSelector
282 virtual void SAL_CALL
setMode(const OUString
& Mode
) throw(::com::sun::star::lang::NoSupportException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
283 virtual OUString SAL_CALL
getMode() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
284 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedModes() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
285 virtual sal_Bool SAL_CALL
supportsMode(const OUString
& Mode
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
287 // ::com::sun::star::container::XContainer
288 virtual void SAL_CALL
addContainerListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& l
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
289 virtual void SAL_CALL
removeContainerListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& l
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
291 // ::com::sun::star::frame::XDispatchProvider
292 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
> SAL_CALL
queryDispatch(const ::com::sun::star::util::URL
& aURL
, const OUString
& aTargetFrameName
, sal_Int32 nSearchFlags
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
293 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
, std::exception
) SAL_OVERRIDE
;
295 // ::com::sun::star::frame::XDispatchProviderInterception
296 virtual void SAL_CALL
registerDispatchProviderInterceptor(const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProviderInterceptor
>& xInterceptor
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
297 virtual void SAL_CALL
releaseDispatchProviderInterceptor(const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProviderInterceptor
>& xInterceptor
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
299 // ::com::sun::star::view::XSelectionSupplier
300 virtual sal_Bool SAL_CALL
select( const ::com::sun::star::uno::Any
& aSelection
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
301 virtual ::com::sun::star::uno::Any SAL_CALL
getSelection( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
302 virtual void SAL_CALL
addSelectionChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::view::XSelectionChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
303 virtual void SAL_CALL
removeSelectionChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::view::XSelectionChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
306 virtual FmXGridPeer
* imp_CreatePeer(vcl::Window
* pParent
);
307 // ImplCreatePeer would be better, but doesn't work because it's not exported
312 // FmXGridPeer -> Peer for the Gridcontrol
315 class SVX_DLLPUBLIC SAL_WARN_UNUSED FmXGridPeer
:
316 public cppu::ImplInheritanceHelper
<
318 css::form::XGridPeer
,
319 css::form::XBoundComponent
,
320 css::form::XGridControl
,
321 css::sdb::XRowSetSupplier
,
322 css::util::XModifyBroadcaster
,
323 css::beans::XPropertyChangeListener
,
324 css::container::XContainerListener
,
325 css::sdbc::XRowSetListener
,
326 css::form::XLoadListener
,
327 css::view::XSelectionChangeListener
,
328 css::container::XIndexAccess
,
329 css::container::XEnumerationAccess
,
330 css::util::XModeSelector
,
331 css::container::XContainer
,
332 css::frame::XStatusListener
,
333 css::frame::XDispatchProvider
,
334 css::frame::XDispatchProviderInterception
,
335 css::form::XResetListener
,
336 css::view::XSelectionSupplier
>
338 css::uno::Reference
< css::container::XIndexContainer
> m_xColumns
;
339 css::uno::Reference
< css::sdbc::XRowSet
> m_xCursor
;
340 ::cppu::OInterfaceContainerHelper m_aModifyListeners
,
342 m_aContainerListeners
,
343 m_aSelectionListeners
,
344 m_aGridControlListeners
;
347 sal_Int32 m_nCursorListening
;
349 css::uno::Reference
< css::frame::XDispatchProviderInterceptor
> m_xFirstDispatchInterceptor
;
351 bool m_bInterceptingDispatch
;
354 // one bool for each supported url
355 css::uno::Reference
< css::frame::XDispatch
> * m_pDispatchers
;
356 // one dispatcher for each supported url
357 // (I would like to have a vector here but including the stl in an exported file seems
358 // very risky to me ....)
360 class GridListenerDelegator
;
361 friend class GridListenerDelegator
;
362 GridListenerDelegator
* m_pGridListener
;
365 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
366 ::osl::Mutex m_aMutex
;
369 FmXGridPeer(const css::uno::Reference
< css::uno::XComponentContext
>&);
370 virtual ~FmXGridPeer();
372 // spaeter Constructor, immer nach dem realen Constructor zu rufen !
373 void Create(vcl::Window
* pParent
, WinBits nStyle
);
375 // ::com::sun::star::lang::XUnoTunnel
376 static const ::com::sun::star::uno::Sequence
< sal_Int8
>& getUnoTunnelImplementationId() throw();
377 static FmXGridPeer
* getImplementation( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _rxIFace
) throw();
378 sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& _rIdentifier
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
380 // ::com::sun::star::form::XGridPeer
381 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexContainer
> SAL_CALL
getColumns( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
382 virtual void SAL_CALL
setColumns( const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexContainer
>& aColumns
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
384 // ::com::sun::star::lang::XComponent
385 virtual void SAL_CALL
dispose() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
387 // ::com::sun::star::lang::XEventListener
388 virtual void SAL_CALL
disposing(const ::com::sun::star::lang::EventObject
& Source
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
390 // ::com::sun::star::form::XBoundComponent
391 virtual void SAL_CALL
addUpdateListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XUpdateListener
>& l
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
392 virtual void SAL_CALL
removeUpdateListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XUpdateListener
>& l
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
393 virtual sal_Bool SAL_CALL
commit() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
395 // ::com::sun::star::container::XElementAccess
396 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
397 virtual sal_Bool SAL_CALL
hasElements( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
399 // ::com::sun::star::container::XEnumerationAccess
400 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XEnumeration
> SAL_CALL
createEnumeration() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
402 // ::com::sun::star::container::XIndexAccess
403 virtual sal_Int32 SAL_CALL
getCount() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
404 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
, std::exception
) SAL_OVERRIDE
;
406 // ::com::sun::star::beans::XPropertyChangeListener
407 virtual void SAL_CALL SAL_CALL
propertyChange(const ::com::sun::star::beans::PropertyChangeEvent
& evt
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
409 // ::com::sun::star::form::XLoadListener
410 virtual void SAL_CALL
loaded(const ::com::sun::star::lang::EventObject
& rEvent
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
411 virtual void SAL_CALL
unloaded(const ::com::sun::star::lang::EventObject
& rEvent
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
412 virtual void SAL_CALL
unloading(const ::com::sun::star::lang::EventObject
& aEvent
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
413 virtual void SAL_CALL
reloading(const ::com::sun::star::lang::EventObject
& aEvent
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
414 virtual void SAL_CALL
reloaded(const ::com::sun::star::lang::EventObject
& aEvent
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
416 // ::com::sun::star::sdbc::XRowSetListener
417 virtual void SAL_CALL
cursorMoved(const ::com::sun::star::lang::EventObject
& event
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
418 virtual void SAL_CALL
rowChanged(const ::com::sun::star::lang::EventObject
& event
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
419 virtual void SAL_CALL
rowSetChanged(const ::com::sun::star::lang::EventObject
& event
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
421 // ::com::sun::star::container::XContainerListener
422 virtual void SAL_CALL
elementInserted(const ::com::sun::star::container::ContainerEvent
& Event
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
423 virtual void SAL_CALL
elementRemoved(const ::com::sun::star::container::ContainerEvent
& Event
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
424 virtual void SAL_CALL
elementReplaced(const ::com::sun::star::container::ContainerEvent
& Event
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
427 virtual void SAL_CALL
setProperty( const OUString
& PropertyName
, const ::com::sun::star::uno::Any
& Value
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
428 virtual ::com::sun::star::uno::Any SAL_CALL
getProperty( const OUString
& PropertyName
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
429 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessibleContext
>
430 CreateAccessibleContext() SAL_OVERRIDE
;
432 // ::com::sun::star::form::XGridControl
433 virtual void SAL_CALL
addGridControlListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XGridControlListener
>& _listener
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
434 virtual void SAL_CALL
removeGridControlListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XGridControlListener
>& _listener
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
436 // ::com::sun::star::form::XGrid (base of XGridControl)
437 virtual sal_Int16 SAL_CALL
getCurrentColumnPosition() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
438 virtual void SAL_CALL
setCurrentColumnPosition(sal_Int16 nPos
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
440 // ::com::sun::star::form::XGridFieldDataSupplier (base of XGridControl)
441 virtual ::com::sun::star::uno::Sequence
< sal_Bool
> SAL_CALL
queryFieldDataType( const ::com::sun::star::uno::Type
& xType
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
442 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
, std::exception
) SAL_OVERRIDE
;
444 // ::com::sun::star::sdb::XRowSetSupplier
445 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRowSet
> SAL_CALL
getRowSet() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
446 virtual void SAL_CALL
setRowSet(const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRowSet
>& xDataSource
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
448 // ::com::sun::star::util::XModifyBroadcaster
449 virtual void SAL_CALL
addModifyListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& l
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
450 virtual void SAL_CALL
removeModifyListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& l
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
453 virtual void SAL_CALL SAL_CALL
setDesignMode(sal_Bool bOn
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
454 virtual sal_Bool SAL_CALL
isDesignMode() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
456 // ::com::sun::star::view::XSelectionChangeListener
457 virtual void SAL_CALL
selectionChanged(const ::com::sun::star::lang::EventObject
& aEvent
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
462 void updateGrid(const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XRowSet
>& _rDatabaseCursor
);
463 void startCursorListening();
464 void stopCursorListening();
466 // ::com::sun::star::util::XModeSelector
467 virtual void SAL_CALL
setMode(const OUString
& Mode
) throw(::com::sun::star::lang::NoSupportException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
468 virtual OUString SAL_CALL
getMode() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
469 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedModes() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
470 virtual sal_Bool SAL_CALL
supportsMode(const OUString
& Mode
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
472 // ::com::sun::star::container::XContainer
473 virtual void SAL_CALL
addContainerListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& l
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
474 virtual void SAL_CALL
removeContainerListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& l
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
476 void columnVisible(DbGridColumn
* pColumn
);
477 void columnHidden(DbGridColumn
* pColumn
);
479 // ::com::sun::star::awt::XView
480 virtual void SAL_CALL
draw( sal_Int32 x
, sal_Int32 y
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
482 // ::com::sun::star::frame::XDispatchProvider
483 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
> SAL_CALL
queryDispatch(const ::com::sun::star::util::URL
& aURL
, const OUString
& aTargetFrameName
, sal_Int32 nSearchFlags
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
484 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
, std::exception
) SAL_OVERRIDE
;
486 // ::com::sun::star::frame::XDispatchProviderInterception
487 virtual void SAL_CALL
registerDispatchProviderInterceptor(const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProviderInterceptor
>& xInterceptor
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
488 virtual void SAL_CALL
releaseDispatchProviderInterceptor(const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProviderInterceptor
>& xInterceptor
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
490 // ::com::sun::star::frame::XStatusListener
491 virtual void SAL_CALL
statusChanged(const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
493 // ::com::sun::star::form::XResetListener
494 virtual sal_Bool SAL_CALL
approveReset(const ::com::sun::star::lang::EventObject
& rEvent
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
495 virtual void SAL_CALL
resetted(const ::com::sun::star::lang::EventObject
& rEvent
) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
497 // ::com::sun::star::view::XSelectionSupplier
498 virtual sal_Bool SAL_CALL
select( const ::com::sun::star::uno::Any
& aSelection
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
499 virtual ::com::sun::star::uno::Any SAL_CALL
getSelection( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
500 virtual void SAL_CALL
addSelectionChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::view::XSelectionChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
501 virtual void SAL_CALL
removeSelectionChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::view::XSelectionChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
504 virtual VclPtr
<FmGridControl
> imp_CreateControl(vcl::Window
* pParent
, WinBits nStyle
);
506 static ::com::sun::star::uno::Sequence
< ::com::sun::star::util::URL
>& getSupportedURLs();
507 static ::com::sun::star::uno::Sequence
<sal_uInt16
>& getSupportedGridSlots();
508 void ConnectToDispatcher();
509 void DisConnectFromDispatcher();
510 void UpdateDispatches(); // will connect if not already connected and just update else
512 /** If a derived class wants to listen at some column properties, it doesn't have
513 to override all methods affecting columns (setColumns, elementInserted, elementRemoved ...)
514 Instead it may use addColumnListeners and removeColumnListeners which are called in all
517 virtual void addColumnListeners(const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xCol
);
518 virtual void removeColumnListeners(const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xCol
);
520 void selectionChanged();
521 void columnChanged();
523 DECL_LINK(OnQueryGridSlotState
, void*);
524 DECL_LINK(OnExecuteGridSlot
, void*);
529 #endif // _SVX_FMGRID_HXX
531 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */