LibreOffice Module svx (master)  1
formcontroller.hxx
Go to the documentation of this file.
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_SOURCE_INC_FORMCONTROLLER_HXX
20 #define INCLUDED_SVX_SOURCE_INC_FORMCONTROLLER_HXX
21 
22 #include <sal/config.h>
23 
24 #include <memory>
25 #include <vector>
26 
27 #include "delayedevent.hxx"
30 #include "sqlparserclient.hxx"
31 
32 #include <com/sun/star/awt/XControl.hpp>
33 #include <com/sun/star/awt/XControlModel.hpp>
34 #include <com/sun/star/awt/XFocusListener.hpp>
35 #include <com/sun/star/awt/XItemListener.hpp>
36 #include <com/sun/star/awt/XMouseListener.hpp>
37 #include <com/sun/star/awt/XTabController.hpp>
38 #include <com/sun/star/awt/XTextComponent.hpp>
39 #include <com/sun/star/awt/XWindow.hpp>
40 #include <com/sun/star/container/XContainerListener.hpp>
41 #include <com/sun/star/form/DatabaseParameterEvent.hpp>
42 #include <com/sun/star/form/validation/XFormComponentValidityListener.hpp>
43 #include <com/sun/star/form/XConfirmDeleteListener.hpp>
44 #include <com/sun/star/form/XDatabaseParameterListener.hpp>
45 #include <com/sun/star/form/runtime/XFormController.hpp>
46 #include <com/sun/star/form/runtime/XFilterController.hpp>
47 #include <com/sun/star/form/XFormControllerListener.hpp>
48 #include <com/sun/star/form/XGridControlListener.hpp>
49 #include <com/sun/star/form/XLoadListener.hpp>
50 #include <com/sun/star/form/XResetListener.hpp>
51 #include <com/sun/star/frame/XDispatch.hpp>
52 #include <com/sun/star/frame/XDispatchProviderInterception.hpp>
53 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
54 #include <com/sun/star/lang/XServiceInfo.hpp>
55 #include <com/sun/star/script/XEventAttacherManager.hpp>
56 #include <com/sun/star/sdb/XRowSetApproveListener.hpp>
57 #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
58 #include <com/sun/star/sdb/XSQLErrorListener.hpp>
59 #include <com/sun/star/sdbc/XRowSetListener.hpp>
60 #include <com/sun/star/task/XInteractionHandler.hpp>
61 #include <com/sun/star/util/XModifyListener.hpp>
62 
65 #include <cppuhelper/basemutex.hxx>
66 #include <cppuhelper/propshlp.hxx>
67 #include <rtl/ref.hxx>
68 #include <vcl/timer.hxx>
69 #include <vcl/idle.hxx>
70 
71 #include <cppuhelper/compbase.hxx>
72 
74 {
75  bool operator() (const css::uno::Reference< css::awt::XTextComponent >& x, const css::uno::Reference< css::awt::XTextComponent >& y) const
76  {
77  return reinterpret_cast<sal_Int64>(x.get()) < reinterpret_cast<sal_Int64>(y.get());
78  }
79 };
80 
81 typedef ::std::map< css::uno::Reference< css::awt::XTextComponent >, OUString, FmXTextComponentLess> FmFilterRow;
82 typedef ::std::vector< FmFilterRow > FmFilterRows;
83 
84 namespace svxform
85 {
86  typedef ::std::vector< css::uno::Reference< css::awt::XTextComponent > > FilterComponents;
88  struct FmFieldInfo;
89 
90  typedef cppu::WeakComponentImplHelper < css::form::runtime::XFormController
91  , css::form::runtime::XFilterController
92  , css::awt::XFocusListener
93  , css::form::XLoadListener
94  , css::beans::XPropertyChangeListener
95  , css::awt::XTextListener
96  , css::awt::XItemListener
97  , css::container::XContainerListener
98  , css::util::XModifyListener
99  , css::form::XConfirmDeleteListener
100  , css::sdb::XSQLErrorListener
101  , css::sdbc::XRowSetListener
102  , css::sdb::XRowSetApproveListener
103  , css::form::XDatabaseParameterListener
104  , css::lang::XServiceInfo
105  , css::form::XResetListener
106  , css::frame::XDispatch
107  , css::awt::XMouseListener
108  , css::form::validation::XFormComponentValidityListener
109  , css::task::XInteractionHandler
110  , css::form::XGridControlListener
111  , css::form::runtime::XFeatureInvalidation
113 
114  class ColumnInfoCache;
115  class FormController final : public ::cppu::BaseMutex
116  ,public FormController_BASE
118  ,public DispatchInterceptor
119  ,public ::comphelper::OAggregationArrayUsageHelper< FormController >
120  ,public ::svxform::OSQLParserClient
121  {
122  typedef ::std::map < sal_Int16,
123  css::uno::Reference< css::frame::XDispatch >
125 
126  css::uno::Reference< css::uno::XAggregation> m_xAggregate;
127  css::uno::Reference< css::awt::XTabController> m_xTabController;
128  css::uno::Reference< css::awt::XControl> m_xActiveControl, m_xCurrentControl;
129  css::uno::Reference< css::container::XIndexAccess> m_xModelAsIndex;
130  css::uno::Reference< css::script::XEventAttacherManager> m_xModelAsManager;
131  css::uno::Reference< css::uno::XInterface> m_xParent;
132  css::uno::Reference< css::uno::XComponentContext> m_xComponentContext;
133  // Composer used for checking filter conditions
134  css::uno::Reference< css::sdb::XSingleSelectQueryComposer > m_xComposer;
135  css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHandler;
136  css::uno::Reference< css::form::runtime::XFormControllerContext > m_xFormControllerContext;
137 
138  css::uno::Sequence< css::uno::Reference< css::awt::XControl> > m_aControls;
147 
148  std::vector< css::uno::Reference< css::form::runtime::XFormController > >
150  FilterComponents m_aFilterComponents;
152 
155 
158 
159  css::uno::Reference< css::form::runtime::XFormOperations >
162  ::std::set< sal_Int16 > m_aInvalidFeatures; // for asynchronous feature invalidation
163 
164  OUString m_aMode;
165 
170 
171  ::std::unique_ptr< ColumnInfoCache >
173 
174  sal_Int32 m_nCurrentFilterPosition; // current level for filtering (or-criteria)
175 
178  bool m_bLocked : 1;
179  bool m_bDBConnection : 1; // focus listener only for database forms
180  bool m_bCycle : 1;
181  bool m_bCanInsert : 1;
182  bool m_bCanUpdate : 1;
183  bool m_bCommitLock : 1; // lock the committing of controls see focusGained
184  bool m_bModified : 1; // is the content of a control modified?
186  bool m_bFiltering : 1;
187  bool m_bAttachEvents : 1;
188  bool m_bDetachEvents : 1;
190  bool m_bSuspendFilterTextListening; // no bit field, passed around as reference
191 
192  // as we want to intercept dispatches of _all_ controls we're responsible for, and an object implementing
193  // the css::frame::XDispatchProviderInterceptor interface can intercept only _one_ objects dispatches, we need a helper class
194  std::vector<rtl::Reference<DispatchInterceptionMultiplexer>> m_aControlDispatchInterceptors;
195 
196  public:
197  FormController( const css::uno::Reference< css::uno::XComponentContext > & _rxORB );
198 
199  // returns the window which should be used as parent window for dialogs
200  static css::uno::Reference<css::awt::XWindow> getDialogParentWindow(css::uno::Reference<css::form::runtime::XFormController> xFormController);
201 
202  private:
203  virtual ~FormController() override;
204 
205  // XInterface
206  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& type) override;
207  virtual void SAL_CALL acquire() noexcept override;
208  virtual void SAL_CALL release() noexcept override;
209 
210  // XTypeProvider
211  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
212  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
213 
214  // XDispatch
215  virtual void SAL_CALL dispatch( const css::util::URL& _rURL, const css::uno::Sequence< css::beans::PropertyValue >& _rArgs ) override;
216  virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& _rxListener, const css::util::URL& _rURL ) override;
217  virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& _rxListener, const css::util::URL& _rURL ) override;
218 
219  // css::container::XChild
220  virtual css::uno::Reference< css::uno::XInterface> SAL_CALL getParent() override;
221  virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface>& Parent) override;
222 
223  // css::lang::XEventListener
224  virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
225 
226  // OComponentHelper
227  virtual void SAL_CALL disposing() override;
228 
229  // OPropertySetHelper
230  virtual sal_Bool SAL_CALL convertFastPropertyValue( css::uno::Any & rConvertedValue, css::uno::Any & rOldValue,
231  sal_Int32 nHandle, const css::uno::Any& rValue ) override;
232 
233  virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& rValue ) override;
234  virtual void SAL_CALL getFastPropertyValue( css::uno::Any& rValue, sal_Int32 nHandle ) const override;
235 
236  virtual css::uno::Reference< css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override;
237  virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
238 
240 
241  // XFilterController
242  virtual ::sal_Int32 SAL_CALL getFilterComponents() override;
243  virtual ::sal_Int32 SAL_CALL getDisjunctiveTerms() override;
244  virtual void SAL_CALL addFilterControllerListener( const css::uno::Reference< css::form::runtime::XFilterControllerListener >& Listener ) override;
245  virtual void SAL_CALL removeFilterControllerListener( const css::uno::Reference< css::form::runtime::XFilterControllerListener >& Listener ) override;
246  virtual void SAL_CALL setPredicateExpression( ::sal_Int32 Component, ::sal_Int32 Term, const OUString& PredicateExpression ) override;
247  virtual css::uno::Reference< css::awt::XControl > SAL_CALL getFilterComponent( ::sal_Int32 Component ) override;
248  virtual css::uno::Sequence< css::uno::Sequence< OUString > > SAL_CALL getPredicateExpressions() override;
249  virtual void SAL_CALL removeDisjunctiveTerm( ::sal_Int32 Term ) override;
250  virtual void SAL_CALL appendEmptyDisjunctiveTerm() override;
251  virtual ::sal_Int32 SAL_CALL getActiveTerm() override;
252  virtual void SAL_CALL setActiveTerm( ::sal_Int32 ActiveTerm ) override;
253 
254  // XElementAccess
255  virtual css::uno::Type SAL_CALL getElementType() override;
256  virtual sal_Bool SAL_CALL hasElements() override;
257 
258  // css::container::XEnumerationAccess
259  virtual css::uno::Reference< css::container::XEnumeration> SAL_CALL createEnumeration() override;
260 
261  // css::container::XContainerListener
262  virtual void SAL_CALL elementInserted(const css::container::ContainerEvent& rEvent) override;
263  virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent& rEvent) override;
264  virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent& rEvent) override;
265 
266  // XLoadListener
267  virtual void SAL_CALL loaded(const css::lang::EventObject& rEvent) override;
268  virtual void SAL_CALL unloaded(const css::lang::EventObject& rEvent) override;
269  virtual void SAL_CALL unloading(const css::lang::EventObject& aEvent) override;
270  virtual void SAL_CALL reloading(const css::lang::EventObject& aEvent) override;
271  virtual void SAL_CALL reloaded(const css::lang::EventObject& aEvent) override;
272 
273  // XModeSelector
274  virtual void SAL_CALL setMode(const OUString& Mode) override;
275  virtual OUString SAL_CALL getMode() override;
276  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedModes() override;
277  virtual sal_Bool SAL_CALL supportsMode(const OUString& Mode) override;
278 
279  // css::container::XIndexAccess
280  virtual sal_Int32 SAL_CALL getCount() override;
281  virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override;
282 
283  // XModifyBroadcaster
284  virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener>& l) override;
285  virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener>& l) override;
286 
287  // XFocusListener
288  virtual void SAL_CALL focusGained(const css::awt::FocusEvent& e) override;
289  virtual void SAL_CALL focusLost(const css::awt::FocusEvent& e) override;
290 
291  // XMouseListener
292  virtual void SAL_CALL mousePressed( const css::awt::MouseEvent& _rEvent ) override;
293  virtual void SAL_CALL mouseReleased( const css::awt::MouseEvent& _rEvent ) override;
294  virtual void SAL_CALL mouseEntered( const css::awt::MouseEvent& _rEvent ) override;
295  virtual void SAL_CALL mouseExited( const css::awt::MouseEvent& _rEvent ) override;
296 
297  // XFormComponentValidityListener
298  virtual void SAL_CALL componentValidityChanged( const css::lang::EventObject& _rSource ) override;
299 
300  // XInteractionHandler
301  virtual void SAL_CALL handle( const css::uno::Reference< css::task::XInteractionRequest >& Request ) override;
302 
303  // XGridControlListener
304  virtual void SAL_CALL columnChanged( const css::lang::EventObject& _event ) override;
305 
306  // css::beans::XPropertyChangeListener -> change of states
307  virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent& evt) override;
308 
309  // XTextListener -> set modify
310  virtual void SAL_CALL textChanged(const css::awt::TextEvent& rEvent) override;
311 
312  // XItemListener -> set modify
313  virtual void SAL_CALL itemStateChanged(const css::awt::ItemEvent& rEvent) override;
314 
315  // XModifyListener -> set modify
316  virtual void SAL_CALL modified(const css::lang::EventObject& rEvent) override;
317 
318  // XFormController
319  virtual css::uno::Reference< css::form::runtime::XFormOperations > SAL_CALL getFormOperations() override;
320  virtual css::uno::Reference< css::awt::XControl> SAL_CALL getCurrentControl() override;
321  virtual void SAL_CALL addActivateListener(const css::uno::Reference< css::form::XFormControllerListener>& l) override;
322  virtual void SAL_CALL removeActivateListener(const css::uno::Reference< css::form::XFormControllerListener>& l) override;
323  virtual void SAL_CALL addChildController( const css::uno::Reference< css::form::runtime::XFormController >& ChildController ) override;
324 
325  virtual css::uno::Reference< css::form::runtime::XFormControllerContext > SAL_CALL getContext() override;
326  virtual void SAL_CALL setContext( const css::uno::Reference< css::form::runtime::XFormControllerContext >& _context ) override;
327  virtual css::uno::Reference< css::task::XInteractionHandler > SAL_CALL getInteractionHandler() override;
328  virtual void SAL_CALL setInteractionHandler( const css::uno::Reference< css::task::XInteractionHandler >& _interactionHandler ) override;
329 
330  // XTabController
331  virtual css::uno::Sequence< css::uno::Reference< css::awt::XControl> > SAL_CALL getControls() override;
332 
333  virtual void SAL_CALL setModel(const css::uno::Reference< css::awt::XTabControllerModel>& Model) override;
334  virtual css::uno::Reference< css::awt::XTabControllerModel> SAL_CALL getModel() override;
335 
336  virtual void SAL_CALL setContainer(const css::uno::Reference< css::awt::XControlContainer>& Container) override;
337  virtual css::uno::Reference< css::awt::XControlContainer> SAL_CALL getContainer() override;
338 
339  virtual void SAL_CALL autoTabOrder() override;
340  virtual void SAL_CALL activateTabOrder() override;
341 
342  virtual void SAL_CALL activateFirst() override;
343  virtual void SAL_CALL activateLast() override;
344 
345  // css::sdbc::XRowSetListener
346  virtual void SAL_CALL cursorMoved(const css::lang::EventObject& event) override;
347  virtual void SAL_CALL rowChanged(const css::lang::EventObject& event) override;
348  virtual void SAL_CALL rowSetChanged(const css::lang::EventObject& event) override;
349 
350  // XRowSetApproveListener
351  virtual sal_Bool SAL_CALL approveCursorMove(const css::lang::EventObject& event) override;
352  virtual sal_Bool SAL_CALL approveRowChange(const css::sdb::RowChangeEvent& event) override;
353  virtual sal_Bool SAL_CALL approveRowSetChange(const css::lang::EventObject& event) override;
354 
355  // XRowSetApproveBroadcaster
356  virtual void SAL_CALL addRowSetApproveListener(const css::uno::Reference< css::sdb::XRowSetApproveListener>& listener) override;
357  virtual void SAL_CALL removeRowSetApproveListener(const css::uno::Reference< css::sdb::XRowSetApproveListener>& listener) override;
358 
359  // XSQLErrorBroadcaster
360  virtual void SAL_CALL errorOccured(const css::sdb::SQLErrorEvent& aEvent) override;
361 
362  // XSQLErrorListener
363  virtual void SAL_CALL addSQLErrorListener(const css::uno::Reference< css::sdb::XSQLErrorListener>& _rListener) override;
364  virtual void SAL_CALL removeSQLErrorListener(const css::uno::Reference< css::sdb::XSQLErrorListener>& _rListener) override;
365 
366  // XDatabaseParameterBroadcaster2
367  virtual void SAL_CALL addDatabaseParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener>& aListener) override;
368  virtual void SAL_CALL removeDatabaseParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener>& aListener) override;
369 
370  // XDatabaseParameterBroadcaster
371  virtual void SAL_CALL addParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener>& aListener) override;
372  virtual void SAL_CALL removeParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener>& aListener) override;
373 
374  // XDatabaseParameterListener
375  virtual sal_Bool SAL_CALL approveParameter(const css::form::DatabaseParameterEvent& aEvent) override;
376 
377  // XConfirmDeleteBroadcaster
378  virtual void SAL_CALL addConfirmDeleteListener(const css::uno::Reference< css::form::XConfirmDeleteListener>& aListener) override;
379  virtual void SAL_CALL removeConfirmDeleteListener(const css::uno::Reference< css::form::XConfirmDeleteListener>& aListener) override;
380 
381  // XConfirmDeleteListener
382  virtual sal_Bool SAL_CALL confirmDelete(const css::sdb::RowChangeEvent& aEvent) override;
383 
384  // XServiceInfo
385  virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
386  virtual OUString SAL_CALL getImplementationName() override;
387  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
388 
389  // XResetListener
390  virtual sal_Bool SAL_CALL approveReset(const css::lang::EventObject& rEvent) override;
391  virtual void SAL_CALL resetted(const css::lang::EventObject& rEvent) override;
392 
393  // XFeatureInvalidation
394  virtual void SAL_CALL invalidateFeatures( const css::uno::Sequence< ::sal_Int16 >& Features ) override;
395  virtual void SAL_CALL invalidateAllFeatures( ) override;
396 
397 // method for registration
398  static css::uno::Sequence< OUString > const & getSupportedServiceNames_Static();
399 
400  // comphelper::OPropertyArrayUsageHelper
401  virtual void fillProperties(
402  css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
403  css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
404  ) const override;
405 
406  // DispatchInterceptor
407  virtual css::uno::Reference< css::frame::XDispatch>
409  const css::util::URL& aURL,
410  const OUString& aTargetFrameName,
411  sal_Int32 nSearchFlags
412  ) override;
413 
414  virtual ::osl::Mutex* getInterceptorMutex() override { return &m_aMutex; }
415 
417  void updateAllDispatchers() const;
418 
422 
423  void startFiltering();
424  void stopFiltering();
425  void setFilter(::std::vector<FmFieldInfo>&);
426  void startListening();
427  void stopListening();
428 
439 
453  bool replaceControl(
454  const css::uno::Reference< css::awt::XControl >& _rxExistentControl,
455  const css::uno::Reference< css::awt::XControl >& _rxNewControl
456  );
457 
458  // we're listening at all bound controls for modifications
459  void startControlModifyListening(const css::uno::Reference< css::awt::XControl>& xControl);
460  void stopControlModifyListening(const css::uno::Reference< css::awt::XControl>& xControl);
461 
462  void setLocks();
463  void setControlLock(const css::uno::Reference< css::awt::XControl>& xControl);
464  void addToEventAttacher(const css::uno::Reference< css::awt::XControl>& xControl);
465  void removeFromEventAttacher(const css::uno::Reference< css::awt::XControl>& xControl);
466  void toggleAutoFields(bool bAutoFields);
468  void unload();
470 
471  void startFormListening( const css::uno::Reference< css::beans::XPropertySet >& _rxForm, bool _bPropertiesOnly );
472  void stopFormListening( const css::uno::Reference< css::beans::XPropertySet >& _rxForm, bool _bPropertiesOnly );
473 
474  css::uno::Reference< css::awt::XControl> findControl( css::uno::Sequence< css::uno::Reference< css::awt::XControl> >& rCtrls, const css::uno::Reference< css::awt::XControlModel>& rxCtrlModel, bool _bRemove, bool _bOverWrite ) const;
475 
476  void insertControl(const css::uno::Reference< css::awt::XControl>& xControl);
477  void removeControl(const css::uno::Reference< css::awt::XControl>& xControl);
478 
480  void implControlInserted( const css::uno::Reference< css::awt::XControl>& _rxControl, bool _bAddToEventAttacher );
482  void implControlRemoved( const css::uno::Reference< css::awt::XControl>& _rxControl, bool _bRemoveFromEventAttacher );
483 
486  void implSetCurrentControl( const css::uno::Reference< css::awt::XControl >& _rxControl );
487 
491 
492  bool impl_isDisposed_nofail() const { return FormController_BASE::rBHelper.bDisposed; }
493  void impl_checkDisposed_throw() const;
494 
495  void impl_onModify();
496 
503  void impl_addFilterRow( const FmFilterRow& _row );
504 
507  void impl_appendEmptyFilterRow( ::osl::ClearableMutexGuard& _rClearBeforeNotify );
508 
509  bool isLocked() const {return m_bLocked;}
510  bool determineLockState() const;
511 
512  css::uno::Reference< css::frame::XDispatchProviderInterceptor> createInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterception>& _xInterception);
513  // create a new interceptor, register it on the given object
514  void deleteInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterception>& _xInterception);
515  // if createInterceptor was called for the given object the according interceptor will be removed
516  // from the objects interceptor chain and released
517 
536  OUString& /* [out] */ _rFirstInvalidityExplanation,
537  css::uno::Reference< css::awt::XControlModel >& /* [out] */ _rxFirstInvalidModel
538  );
539 
542  css::uno::Reference< css::awt::XControl >
543  locateControl( const css::uno::Reference< css::awt::XControlModel >& _rxModel );
544 
545  // set the text for all filters
547 
548  // in filter mode we do not listen for changes
550  css::uno::Reference< css::awt::XControl> isInList(const css::uno::Reference< css::awt::XWindowPeer>& xPeer) const;
551 
552  DECL_LINK( OnActivateTabOrder, Timer*, void );
553  DECL_LINK( OnInvalidateFeatures, Timer*, void );
554  DECL_LINK( OnLoad, void*, void );
555  DECL_LINK( OnToggleAutoFields, void*, void );
556  DECL_LINK( OnActivated, void*, void );
557  DECL_LINK( OnDeactivated, void*, void );
558  };
559 
560 }
561 
562 #endif // INCLUDED_SVX_SOURCE_INC_FORMCONTROLLER_HXX
563 
564 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void startControlModifyListening(const css::uno::Reference< css::awt::XControl > &xControl)
virtual void SAL_CALL dispatch(const css::util::URL &_rURL, const css::uno::Sequence< css::beans::PropertyValue > &_rArgs) override
::comphelper::OInterfaceContainerHelper2 m_aDeleteListeners
virtual sal_Bool SAL_CALL approveRowChange(const css::sdb::RowChangeEvent &event) override
Type
virtual void SAL_CALL autoTabOrder() override
css::uno::Reference< css::uno::XInterface > m_xParent
virtual void SAL_CALL activateTabOrder() override
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &_rxListener, const css::util::URL &_rURL) override
FormController(const css::uno::Reference< css::uno::XComponentContext > &_rxORB)
virtual css::uno::Reference< css::frame::XDispatch > interceptedQueryDispatch(const css::util::URL &aURL, const OUString &aTargetFrameName, sal_Int32 nSearchFlags) override
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
FilterComponents m_aFilterComponents
css::uno::Reference< css::form::runtime::XFormControllerContext > m_xFormControllerContext
void setFilter(::std::vector< FmFieldInfo > &)
virtual css::uno::Reference< css::awt::XControlContainer > SAL_CALL getContainer() override
signed char sal_Int8
virtual void SAL_CALL invalidateAllFeatures() override
virtual void SAL_CALL addParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener > &aListener) override
::comphelper::OInterfaceContainerHelper2 m_aModifyListeners
virtual void SAL_CALL componentValidityChanged(const css::lang::EventObject &_rSource) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &type) override
cppu::WeakComponentImplHelper< css::form::runtime::XFormController, css::form::runtime::XFilterController, css::awt::XFocusListener, css::form::XLoadListener, css::beans::XPropertyChangeListener, css::awt::XTextListener, css::awt::XItemListener, css::container::XContainerListener, css::util::XModifyListener, css::form::XConfirmDeleteListener, css::sdb::XSQLErrorListener, css::sdbc::XRowSetListener, css::sdb::XRowSetApproveListener, css::form::XDatabaseParameterListener, css::lang::XServiceInfo, css::form::XResetListener, css::frame::XDispatch, css::awt::XMouseListener, css::form::validation::XFormComponentValidityListener, css::task::XInteractionHandler, css::form::XGridControlListener, css::form::runtime::XFeatureInvalidation > FormController_BASE
void implControlInserted(const css::uno::Reference< css::awt::XControl > &_rxControl, bool _bAddToEventAttacher)
called when a new control is to be handled by the controller
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
css::uno::Reference< css::awt::XControl > m_xCurrentControl
std::vector< rtl::Reference< DispatchInterceptionMultiplexer > > m_aControlDispatchInterceptors
virtual void SAL_CALL reloaded(const css::lang::EventObject &aEvent) override
::std::unique_ptr< ColumnInfoCache > m_pColumnInfoCache
virtual void SAL_CALL removeRowSetApproveListener(const css::uno::Reference< css::sdb::XRowSetApproveListener > &listener) override
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &l) override
::std::vector< FmFilterRow > FmFilterRows
mutable::osl::Mutex m_aMutex
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
css::uno::Sequence< css::uno::Reference< css::awt::XControl > > m_aControls
virtual void SAL_CALL focusLost(const css::awt::FocusEvent &e) override
void implSetCurrentControl(const css::uno::Reference< css::awt::XControl > &_rxControl)
sets m_xCurrentControl, plus does administrative tasks depending on it
css::uno::Reference< css::form::runtime::XFormOperations > m_xFormOperations
Mode
virtual css::uno::Sequence< css::uno::Reference< css::awt::XControl > > SAL_CALL getControls() override
small class which encapsulates posting a Link instance as ApplicationUserEvent
virtual void SAL_CALL removeSQLErrorListener(const css::uno::Reference< css::sdb::XSQLErrorListener > &_rListener) override
virtual void SAL_CALL addActivateListener(const css::uno::Reference< css::form::XFormControllerListener > &l) override
virtual css::uno::Sequence< css::uno::Sequence< OUString > > SAL_CALL getPredicateExpressions() override
virtual ::sal_Int32 SAL_CALL getActiveTerm() override
::comphelper::OInterfaceContainerHelper2 m_aErrorListeners
virtual void SAL_CALL removeFilterControllerListener(const css::uno::Reference< css::form::runtime::XFilterControllerListener > &Listener) override
bool ensureInteractionHandler()
ensures that we have an interaction handler, if possible
virtual css::uno::Reference< css::form::runtime::XFormOperations > SAL_CALL getFormOperations() override
virtual sal_Bool SAL_CALL approveReset(const css::lang::EventObject &rEvent) override
void toggleAutoFields(bool bAutoFields)
virtual void SAL_CALL disposing() override
virtual void SAL_CALL reloading(const css::lang::EventObject &aEvent) override
css::uno::Reference< css::frame::XDispatchProviderInterceptor > createInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterception > &_xInterception)
virtual void SAL_CALL focusGained(const css::awt::FocusEvent &e) override
virtual void SAL_CALL acquire() noexcept override
css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHandler
virtual void SAL_CALL mouseReleased(const css::awt::MouseEvent &_rEvent) override
void setControlLock(const css::uno::Reference< css::awt::XControl > &xControl)
void impl_addFilterRow(const FmFilterRow &_row)
adds the given filter row to m_aFilterRows, setting m_nCurrentFilterPosition to 0 if the newly added ...
virtual css::uno::Type SAL_CALL getElementType() override
css::uno::Reference< css::awt::XControl > isInList(const css::uno::Reference< css::awt::XWindowPeer > &xPeer) const
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL addSQLErrorListener(const css::uno::Reference< css::sdb::XSQLErrorListener > &_rListener) override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual sal_Bool SAL_CALL hasElements() override
::std::pair< MetaAction *, int > Component
virtual void SAL_CALL modified(const css::lang::EventObject &rEvent) override
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &evt) override
css::uno::Reference< css::awt::XControl > m_xActiveControl
virtual ::sal_Int32 SAL_CALL getFilterComponents() override
virtual void SAL_CALL unloading(const css::lang::EventObject &aEvent) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL addRowSetApproveListener(const css::uno::Reference< css::sdb::XRowSetApproveListener > &listener) override
virtual sal_Int32 SAL_CALL getCount() override
virtual css::uno::Reference< css::awt::XControl > SAL_CALL getCurrentControl() override
virtual void SAL_CALL setModel(const css::uno::Reference< css::awt::XTabControllerModel > &Model) override
virtual void fillProperties(css::uno::Sequence< css::beans::Property > &_rProps, css::uno::Sequence< css::beans::Property > &_rAggregateProps) const override
virtual void SAL_CALL columnChanged(const css::lang::EventObject &_event) override
::svxform::DelayedEvent m_aToggleEvent
::comphelper::OInterfaceContainerHelper2 m_aRowSetApproveListeners
void stopControlModifyListening(const css::uno::Reference< css::awt::XControl > &xControl)
void impl_appendEmptyFilterRow(::osl::ClearableMutexGuard &_rClearBeforeNotify)
adds an empty filter row to m_aFilterRows, and notifies our listeners
bool impl_isDisposed_nofail() const
void addToEventAttacher(const css::uno::Reference< css::awt::XControl > &xControl)
virtual void SAL_CALL mouseEntered(const css::awt::MouseEvent &_rEvent) override
css::uno::Reference< css::awt::XControl > findControl(css::uno::Sequence< css::uno::Reference< css::awt::XControl > > &rCtrls, const css::uno::Reference< css::awt::XControlModel > &rxCtrlModel, bool _bRemove, bool _bOverWrite) const
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
virtual void SAL_CALL addFilterControllerListener(const css::uno::Reference< css::form::runtime::XFilterControllerListener > &Listener) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
css::uno::Reference< css::container::XIndexAccess > m_xModelAsIndex
unsigned char sal_Bool
virtual ::osl::Mutex * getInterceptorMutex() override
void stopFormListening(const css::uno::Reference< css::beans::XPropertySet > &_rxForm, bool _bPropertiesOnly)
css::uno::Reference< css::uno::XAggregation > m_xAggregate
bool isListeningForChanges() const
virtual void SAL_CALL unloaded(const css::lang::EventObject &rEvent) override
css::uno::Reference< css::script::XEventAttacherManager > m_xModelAsManager
::comphelper::OInterfaceContainerHelper2 m_aParameterListeners
::svxform::DelayedEvent m_aActivationEvent
virtual void SAL_CALL setMode(const OUString &Mode) override
virtual void SAL_CALL cursorMoved(const css::lang::EventObject &event) override
virtual sal_Bool SAL_CALL approveParameter(const css::form::DatabaseParameterEvent &aEvent) override
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &l) override
virtual void SAL_CALL setInteractionHandler(const css::uno::Reference< css::task::XInteractionHandler > &_interactionHandler) override
virtual void SAL_CALL release() noexcept override
bool replaceControl(const css::uno::Reference< css::awt::XControl > &_rxExistentControl, const css::uno::Reference< css::awt::XControl > &_rxNewControl)
replaces one of our controls with another one
virtual void SAL_CALL resetted(const css::lang::EventObject &rEvent) override
virtual sal_Bool SAL_CALL confirmDelete(const css::sdb::RowChangeEvent &aEvent) override
::std::map< css::uno::Reference< css::awt::XTextComponent >, OUString, FmXTextComponentLess > FmFilterRow
void implControlRemoved(const css::uno::Reference< css::awt::XControl > &_rxControl, bool _bRemoveFromEventAttacher)
called when a control is not to be handled by the controller anymore
virtual void SAL_CALL removeDisjunctiveTerm(::sal_Int32 Term) override
::comphelper::OInterfaceContainerHelper2 m_aFilterListeners
css::uno::Reference< css::awt::XControl > locateControl(const css::uno::Reference< css::awt::XControlModel > &_rxModel)
locates the control which belongs to a given model
virtual void SAL_CALL mouseExited(const css::awt::MouseEvent &_rEvent) override
virtual OUString SAL_CALL getImplementationName() override
::std::vector< css::uno::Reference< css::awt::XTextComponent > > FilterComponents
static css::uno::Reference< css::awt::XWindow > getDialogParentWindow(css::uno::Reference< css::form::runtime::XFormController > xFormController)
void removeFromEventAttacher(const css::uno::Reference< css::awt::XControl > &xControl)
virtual void SAL_CALL addConfirmDeleteListener(const css::uno::Reference< css::form::XConfirmDeleteListener > &aListener) override
DispatcherContainer m_aFeatureDispatchers
virtual void SAL_CALL removeConfirmDeleteListener(const css::uno::Reference< css::form::XConfirmDeleteListener > &aListener) override
virtual ::sal_Int32 SAL_CALL getDisjunctiveTerms() override
virtual sal_Bool SAL_CALL approveRowSetChange(const css::lang::EventObject &event) override
virtual void SAL_CALL errorOccured(const css::sdb::SQLErrorEvent &aEvent) override
virtual css::uno::Reference< css::form::runtime::XFormControllerContext > SAL_CALL getContext() override
bool determineLockState() const
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent &rEvent) override
::svxform::DelayedEvent m_aLoadEvent
virtual void SAL_CALL setContainer(const css::uno::Reference< css::awt::XControlContainer > &Container) override
virtual void SAL_CALL setContext(const css::uno::Reference< css::form::runtime::XFormControllerContext > &_context) override
void startFormListening(const css::uno::Reference< css::beans::XPropertySet > &_rxForm, bool _bPropertiesOnly)
::std::map< sal_Int16, css::uno::Reference< css::frame::XDispatch > > DispatcherContainer
void deleteInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterception > &_xInterception)
::svxform::ControlBorderManager m_aControlBorderManager
css::uno::Reference< css::sdb::XSingleSelectQueryComposer > m_xComposer
css::uno::Reference< css::awt::XTabController > m_xTabController
manages the dynamic border color for form controls
virtual void SAL_CALL handle(const css::uno::Reference< css::task::XInteractionRequest > &Request) override
virtual ~FormController() override
static css::uno::Sequence< OUString > const & getSupportedServiceNames_Static()
virtual void SAL_CALL removeActivateListener(const css::uno::Reference< css::form::XFormControllerListener > &l) override
::comphelper::OInterfaceContainerHelper2 m_aActivateListeners
bool checkFormComponentValidity(OUString &_rFirstInvalidityExplanation, css::uno::Reference< css::awt::XControlModel > &_rxFirstInvalidModel)
checks all form controls belonging to our form for validity
virtual sal_Bool SAL_CALL approveCursorMove(const css::lang::EventObject &event) override
void implInvalidateCurrentControlDependentFeatures()
invalidates the FormFeatures which depend on the current control
bool operator()(const css::uno::Reference< css::awt::XTextComponent > &x, const css::uno::Reference< css::awt::XTextComponent > &y) const
virtual void SAL_CALL mousePressed(const css::awt::MouseEvent &_rEvent) override
virtual OUString SAL_CALL getMode() override
OPropertySetHelper(OBroadcastHelper &rBHelper)
void disposeAllFeaturesAndDispatchers()
disposes all dispatchers in m_aFeatureDispatchers, and empties m_aFeatureDispatchers ...
DECL_LINK(OnActivateTabOrder, Timer *, void)
virtual css::uno::Reference< css::awt::XControl > SAL_CALL getFilterComponent(::sal_Int32 Component) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedModes() override
::svxform::DelayedEvent m_aDeactivationEvent
virtual void SAL_CALL invalidateFeatures(const css::uno::Sequence< ::sal_Int16 > &Features) override
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
void insertControl(const css::uno::Reference< css::awt::XControl > &xControl)
virtual void SAL_CALL removeParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener > &aListener) override
virtual css::uno::Reference< css::awt::XTabControllerModel > SAL_CALL getModel() override
class FmSearchEngine - Impl class for FmSearchDialog
virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent &rEvent) override
virtual void SAL_CALL rowSetChanged(const css::lang::EventObject &event) override
std::vector< css::uno::Reference< css::form::runtime::XFormController > > m_aChildren
virtual css::uno::Reference< css::task::XInteractionHandler > SAL_CALL getInteractionHandler() override
css::uno::Reference< css::uno::XComponentContext > m_xComponentContext
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual void SAL_CALL activateFirst() override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual void SAL_CALL rowChanged(const css::lang::EventObject &event) override
virtual void SAL_CALL addDatabaseParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener > &aListener) override
void impl_checkDisposed_throw() const
void removeControl(const css::uno::Reference< css::awt::XControl > &xControl)
virtual void SAL_CALL textChanged(const css::awt::TextEvent &rEvent) override
virtual void SAL_CALL itemStateChanged(const css::awt::ItemEvent &rEvent) override
virtual void SAL_CALL setActiveTerm(::sal_Int32 ActiveTerm) override
virtual void SAL_CALL removeDatabaseParameterListener(const css::uno::Reference< css::form::XDatabaseParameterListener > &aListener) override
virtual void SAL_CALL elementInserted(const css::container::ContainerEvent &rEvent) override
struct _ADOIndex Index
virtual sal_Bool SAL_CALL supportsMode(const OUString &Mode) override
virtual void SAL_CALL addChildController(const css::uno::Reference< css::form::runtime::XFormController > &ChildController) override
void updateAllDispatchers() const
update all our dispatchers
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &_rxListener, const css::util::URL &_rURL) override
virtual void SAL_CALL appendEmptyDisjunctiveTerm() override
virtual void SAL_CALL loaded(const css::lang::EventObject &rEvent) override
virtual void SAL_CALL setPredicateExpression(::sal_Int32 Component,::sal_Int32 Term, const OUString &PredicateExpression) override
virtual void SAL_CALL activateLast() override
::std::set< sal_Int16 > m_aInvalidFeatures