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