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 _SVX_FMSHIMP_HXX
20 #define _SVX_FMSHIMP_HXX
22 #include <com/sun/star/container/XNameContainer.hpp>
23 #include <com/sun/star/sdbc/XResultSet.hpp>
24 #include <com/sun/star/sdb/XSQLQueryComposer.hpp>
25 #include <com/sun/star/frame/XStatusListener.hpp>
26 #include <com/sun/star/container/ContainerEvent.hpp>
27 #include <com/sun/star/container/XContainerListener.hpp>
28 #include <com/sun/star/awt/XControl.hpp>
29 #include <com/sun/star/awt/XControlContainer.hpp>
30 #include <com/sun/star/util/XModifyListener.hpp>
31 #include <com/sun/star/form/XForm.hpp>
32 #include <com/sun/star/form/runtime/XFormController.hpp>
33 #include <com/sun/star/form/XFormComponent.hpp>
34 #include <com/sun/star/form/NavigationBarMode.hpp>
35 #include <com/sun/star/frame/XFrame.hpp>
36 #include <com/sun/star/view/XSelectionChangeListener.hpp>
37 #include <com/sun/star/beans/XPropertySet.hpp>
38 #include <com/sun/star/beans/XFastPropertySet.hpp>
39 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
40 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
41 #include <com/sun/star/form/runtime/FeatureState.hpp>
42 #include <vcl/timer.hxx>
43 #include <sfx2/app.hxx>
44 #include <svx/svdmark.hxx>
45 #include <svx/fmsearch.hxx>
46 #include <svx/svxids.hrc>
47 #include <svl/lstner.hxx>
49 #include <sfx2/mnuitem.hxx>
50 #include "svx/fmtools.hxx"
51 #include "svx/fmsrccfg.hxx"
52 #include <osl/mutex.hxx>
53 #include <cppuhelper/component.hxx>
54 #include <comphelper/stl_types.hxx>
55 #include <comphelper/container.hxx>
56 #include <cppuhelper/compbase4.hxx>
57 #include <cppuhelper/compbase6.hxx>
58 #include <unotools/configitem.hxx>
59 #include "svx/dbtoolsclient.hxx"
60 #include "formcontrolling.hxx"
61 #include "fmdocumentclassification.hxx"
66 #include <boost/ptr_container/ptr_vector.hpp>
68 typedef std::vector
<SdrObject
*> SdrObjArray
;
69 DECLARE_STL_VECTOR( ::com::sun::star::uno::Reference
< ::com::sun::star::form::XForm
> ,FmFormArray
);
71 // catch database exceptions if they occur
72 #define DO_SAFE(statement) try { statement; } catch( const Exception& ) { OSL_FAIL("unhandled exception (I tried to move a cursor (or something like that).)"); }
74 #define GA_DISABLE_SYNC 1
75 #define GA_FORCE_SYNC 2
76 #define GA_ENABLE_SYNC 3
77 #define GA_SYNC_MASK 3
78 #define GA_DISABLE_ROCTRLR 4
79 #define GA_ENABLE_ROCTRLR 8
82 // flags for controlling the behaviour when calling loadForms
83 #define FORMS_LOAD 0x0000 // default: simply load
84 #define FORMS_SYNC 0x0000 // default: do in synchronous
86 #define FORMS_UNLOAD 0x0001 // unload
87 #define FORMS_ASYNC 0x0002 // do this async
89 //==============================================================================
90 // a class iterating through all fields of a form which are bound to a field
91 // sub forms are ignored, grid columns (where the grid is a direct child of the form) are included
92 class SAL_DLLPRIVATE FmXBoundFormFieldIterator
: public ::comphelper::IndexAccessIterator
95 FmXBoundFormFieldIterator(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _rStartingPoint
) : ::comphelper::IndexAccessIterator(_rStartingPoint
) { }
98 virtual sal_Bool
ShouldHandleElement(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _rElement
);
99 virtual sal_Bool
ShouldStepInto(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _rContainer
) const;
103 //========================================================================
104 struct SAL_DLLPRIVATE FmLoadAction
110 FmLoadAction( ) : pPage( NULL
), nEventId( 0 ), nFlags( 0 ) { }
111 FmLoadAction( FmFormPage
* _pPage
, sal_uInt16 _nFlags
, sal_uLong _nEventId
)
112 :pPage( _pPage
), nEventId( _nEventId
), nFlags( _nFlags
)
117 //========================================================================
119 typedef ::cppu::WeakComponentImplHelper4
< ::com::sun::star::beans::XPropertyChangeListener
120 , ::com::sun::star::container::XContainerListener
121 , ::com::sun::star::view::XSelectionChangeListener
122 , ::com::sun::star::form::XFormControllerListener
123 > FmXFormShell_BD_BASE
;
125 //========================================================================
126 class SAL_DLLPRIVATE FmXFormShell_Base_Disambiguation
: public FmXFormShell_BD_BASE
128 using ::com::sun::star::beans::XPropertyChangeListener::disposing
;
130 FmXFormShell_Base_Disambiguation( ::osl::Mutex
& _rMutex
);
131 virtual void SAL_CALL
disposing();
134 //========================================================================
137 class FmTextControlShell
;
140 //========================================================================
141 typedef FmXFormShell_Base_Disambiguation FmXFormShell_BASE
;
142 typedef ::utl::ConfigItem FmXFormShell_CFGBASE
;
148 class SAL_DLLPRIVATE FmXFormShell
:public FmXFormShell_BASE
149 ,public FmXFormShell_CFGBASE
150 ,public ::svxform::OStaticDataAccessTools
151 ,public ::svx::IControllerFeatureInvalidation
153 friend class FmFormView
;
154 friend class FmXFormView
;
156 class SuspendPropertyTracking
;
157 friend class SuspendPropertyTracking
;
159 // Timer um verzoegerte Markierung vorzunehmen
161 SdrObjArray m_arrSearchedControls
;
162 // We enable a permanent cursor for the grid we found a searched text, it's disabled in the next "found" event.
163 FmFormArray m_aSearchForms
;
165 struct InvalidSlotInfo
{
168 inline InvalidSlotInfo(sal_uInt16 slotId
, sal_uInt8 flgs
) : id(slotId
), flags(flgs
) {};
170 std::vector
<InvalidSlotInfo
> m_arrInvalidSlots
;
171 // we explicitly switch off the propbrw before leaving the design mode
172 // this flag tells us if we have to switch it on again when reentering
174 ::osl::Mutex m_aAsyncSafety
;
175 // secure the access to our thread related members
176 ::osl::Mutex m_aInvalidationSafety
;
177 // secure the access to all our slot invalidation related members
179 ::com::sun::star::form::NavigationBarMode m_eNavigate
; // Art der Navigation
181 // da ich beim Suchen fuer die Behandlung des "gefunden" ein SdrObject markieren will, besorge ich mir vor dem
182 // Hochreissen des Suchen-Dialoges alle relevanten Objekte
183 // (das Array ist damit auch nur waehrend des Suchvorganges gueltig)
184 std::vector
<long> m_arrRelativeGridColumn
;
186 ::osl::Mutex m_aMutex
;
187 sal_uLong m_nInvalidationEvent
;
188 sal_uLong m_nActivationEvent
;
189 ::std::queue
< FmLoadAction
>
192 FmFormShell
* m_pShell
;
193 ::svx::FmTextControlShell
* m_pTextShell
;
195 ::svx::ControllerFeatures m_aActiveControllerFeatures
;
196 ::svx::ControllerFeatures m_aNavControllerFeatures
;
198 // aktuelle Form, Controller
199 // nur im alive mode verfuegbar
200 ::com::sun::star::uno::Reference
< ::com::sun::star::form::runtime::XFormController
> m_xActiveController
;
201 ::com::sun::star::uno::Reference
< ::com::sun::star::form::runtime::XFormController
> m_xNavigationController
;
202 ::com::sun::star::uno::Reference
< ::com::sun::star::form::XForm
> m_xActiveForm
;
204 // Aktueller container einer Page
205 // nur im designmode verfuegbar
206 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexAccess
> m_xForms
;
208 // the currently selected objects, as to be displayed in the property browser
209 InterfaceBag m_aCurrentSelection
;
210 /// the currently selected form, or the form which all currently selected controls belong to, or <NULL/>
211 ::com::sun::star::uno::Reference
< ::com::sun::star::form::XForm
> m_xCurrentForm
;
212 /// the last selection/marking of controls only. Necessary to implement the "Control properties" slot
213 InterfaceBag m_aLastKnownMarkedControls
;
216 // und das ist ebenfalls fuer's 'gefunden' : Beim Finden in GridControls brauche ich die Spalte, bekomme aber
217 // nur die Nummer des Feldes, die entspricht der Nummer der Spalte + <offset>, wobei der Offset von der Position
218 // des GridControls im Formular abhaengt. Also hier eine Umrechnung.
219 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlModel
> m_xLastGridFound
;
220 // the frame we live in
221 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> m_xAttachedFrame
;
222 // Administration of external form views (see the SID_FM_VIEW_AS_GRID-slot)
223 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XController
> m_xExternalViewController
; // the controller for the external form view
224 ::com::sun::star::uno::Reference
< ::com::sun::star::form::runtime::XFormController
> m_xExtViewTriggerController
; // the nav controller at the time the external display was triggered
225 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSet
> m_xExternalDisplayedForm
; // the form which the external view is based on
227 mutable ::svxform::DocumentType
228 m_eDocumentType
; /// the type of document we're living in
229 sal_Int16 m_nLockSlotInvalidation
;
230 sal_Bool m_bHadPropertyBrowserInDesignMode
: 1;
232 sal_Bool m_bTrackProperties
: 1;
233 // soll ich (bzw. der Owner diese Impl-Klasse) mich um die Aktualisierung des ::com::sun::star::beans::Property-Browsers kuemmern ?
235 sal_Bool m_bUseWizards
: 1;
237 sal_Bool m_bDatabaseBar
: 1; // Gibt es eine Datenbankleiste
238 sal_Bool m_bInActivate
: 1; // Wird ein Controller aktiviert
239 sal_Bool m_bSetFocus
: 1; // Darf der Focus umgesetzt werden
240 sal_Bool m_bFilterMode
: 1; // Wird gerade ein Filter auf die Controls angesetzt
241 sal_Bool m_bChangingDesignMode
:1; // sal_True within SetDesignMode
242 sal_Bool m_bPreparedClose
: 1; // for the current modification state of the current form
243 // PrepareClose had been called and the user denied to save changes
244 sal_Bool m_bFirstActivation
: 1; // has the shell ever been activated?
248 inline const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>&
249 getHostFrame() const { return m_xAttachedFrame
; }
250 inline const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSet
>&
251 getExternallyDisplayedForm() const { return m_xExternalDisplayedForm
; }
254 didPrepareClose() const { return m_bPreparedClose
; }
256 didPrepareClose( sal_Bool _bDid
) { m_bPreparedClose
= _bDid
; }
259 FmXFormShell(FmFormShell
& _rShell
, SfxViewFrame
* _pViewFrame
);
262 DECLARE_UNO3_DEFAULTS(FmXFormShell
, FmXFormShell_BASE
);
263 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& type
) throw ( ::com::sun::star::uno::RuntimeException
);
269 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw(::com::sun::star::uno::RuntimeException
);
270 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( ) throw(::com::sun::star::uno::RuntimeException
);
273 virtual void SAL_CALL
disposing(const ::com::sun::star::lang::EventObject
& Source
) throw( ::com::sun::star::uno::RuntimeException
);
275 // ::com::sun::star::container::XContainerListener
276 virtual void SAL_CALL
elementInserted(const ::com::sun::star::container::ContainerEvent
& rEvent
) throw( ::com::sun::star::uno::RuntimeException
);
277 virtual void SAL_CALL
elementReplaced(const ::com::sun::star::container::ContainerEvent
& rEvent
) throw( ::com::sun::star::uno::RuntimeException
);
278 virtual void SAL_CALL
elementRemoved(const ::com::sun::star::container::ContainerEvent
& rEvent
) throw( ::com::sun::star::uno::RuntimeException
);
280 // XSelectionChangeListener
281 virtual void SAL_CALL
selectionChanged(const ::com::sun::star::lang::EventObject
& rEvent
) throw( ::com::sun::star::uno::RuntimeException
);
283 // ::com::sun::star::beans::XPropertyChangeListener
284 virtual void SAL_CALL
propertyChange(const ::com::sun::star::beans::PropertyChangeEvent
& evt
) throw( ::com::sun::star::uno::RuntimeException
);
286 // ::com::sun::star::form::XFormControllerListener
287 virtual void SAL_CALL
formActivated(const ::com::sun::star::lang::EventObject
& rEvent
) throw( ::com::sun::star::uno::RuntimeException
);
288 virtual void SAL_CALL
formDeactivated(const ::com::sun::star::lang::EventObject
& rEvent
) throw( ::com::sun::star::uno::RuntimeException
);
291 virtual void SAL_CALL
disposing();
294 void EnableTrackProperties( sal_Bool bEnable
) { m_bTrackProperties
= bEnable
; }
295 sal_Bool
IsTrackPropertiesEnabled() {return m_bTrackProperties
;}
297 // activation handling
298 void viewActivated( FmFormView
& _rCurrentView
, sal_Bool _bSyncAction
= sal_False
);
299 void viewDeactivated( FmFormView
& _rCurrentView
, sal_Bool _bDeactivateController
= sal_True
);
301 // IControllerFeatureInvalidation
302 virtual void invalidateFeatures( const ::std::vector
< sal_Int32
>& _rFeatures
);
304 void ExecuteTabOrderDialog( // execute SID_FM_TAB_DIALOG
305 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XTabControllerModel
>& _rxForForm
309 void AddElement(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& Element
);
310 void RemoveElement(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& Element
);
312 /** updates m_xForms, to be either <NULL/>, if we're in alive mode, or our current page's forms collection,
315 void UpdateForms( sal_Bool _bInvalidate
);
317 void ExecuteSearch(); // execute SID_FM_SEARCH
318 void CreateExternalView(); // execute SID_FM_VIEW_AS_GRID
320 sal_Bool
GetY2KState(sal_uInt16
& n
);
321 void SetY2KState(sal_uInt16 n
);
324 // activation handling
325 inline sal_Bool
hasEverBeenActivated( ) const { return !m_bFirstActivation
; }
326 inline void setHasBeenActivated( ) { m_bFirstActivation
= sal_False
; }
329 /// load or unload the forms on a page
330 void loadForms( FmFormPage
* _pPage
, const sal_uInt16 _nBehaviour
= FORMS_LOAD
| FORMS_SYNC
);
331 void smartControlReset( const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexAccess
>& _rxModels
);
334 void startListening();
335 void stopListening();
337 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
>
339 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlModel
>& i_rxModel
,
340 const FmFormObj
& i_rKnownFormObj
343 // sammelt in strNames die Namen aller Formulare
344 static void impl_collectFormSearchContexts_nothrow(
345 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _rxStartingPoint
,
346 const OUString
& _rCurrentLevelPrefix
,
347 FmFormArray
& _out_rForms
,
348 ::std::vector
< OUString
>& _out_rNames
);
350 /** checks whether the instance is already disposed, if so, this is reported as assertion error (debug
351 builds only) and <TRUE/> is returned.
353 bool impl_checkDisposed() const;
356 // methode fuer nicht designmode (alive mode)
357 void setActiveController( const ::com::sun::star::uno::Reference
< ::com::sun::star::form::runtime::XFormController
>& _xController
, sal_Bool _bNoSaveOldContent
= sal_False
);
358 const ::com::sun::star::uno::Reference
< ::com::sun::star::form::runtime::XFormController
>& getActiveController() const {return m_xActiveController
;}
359 const ::com::sun::star::uno::Reference
< ::com::sun::star::form::runtime::XFormController
>& getActiveInternalController() const { return m_xActiveController
== m_xExternalViewController
? m_xExtViewTriggerController
: m_xActiveController
; }
360 const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XForm
>& getActiveForm() const {return m_xActiveForm
;}
361 const ::com::sun::star::uno::Reference
< ::com::sun::star::form::runtime::XFormController
>& getNavController() const {return m_xNavigationController
;}
363 inline const ::svx::ControllerFeatures
& getActiveControllerFeatures() const
364 { return m_aActiveControllerFeatures
; }
365 inline const ::svx::ControllerFeatures
& getNavControllerFeatures() const
366 { return m_aNavControllerFeatures
.isAssigned() ? m_aNavControllerFeatures
: m_aActiveControllerFeatures
; }
368 /** announces a new "current selection"
370 <TRUE/> if and only if the to-bet-set selection was different from the previous selection
372 bool setCurrentSelection( const InterfaceBag
& _rSelection
);
374 /** sets the new selection to the last known marked controls
376 bool selectLastMarkedControls();
378 /** retrieves the current selection
380 SVX_DLLPUBLIC
void getCurrentSelection( InterfaceBag
& /* [out] */ _rSelection
) const;
382 /** sets a new current selection as indicated by a mark list
384 <TRUE/> if and only if the to-bet-set selection was different from the previous selection
386 bool setCurrentSelectionFromMark(const SdrMarkList
& rMarkList
);
388 /// returns the currently selected form, or the form which all currently selected controls belong to, or <NULL/>
389 ::com::sun::star::uno::Reference
< ::com::sun::star::form::XForm
>
390 getCurrentForm() const { return m_xCurrentForm
; }
391 void forgetCurrentForm();
392 /// returns whether the last known marking contained only controls
393 sal_Bool
onlyControlsAreMarked() const { return !m_aLastKnownMarkedControls
.empty(); }
395 /// determines whether the current selection consists of exactly the given object
396 bool isSolelySelected(
397 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _rxObject
400 /// handles a MouseButtonDown event of the FmFormView
401 void handleMouseButtonDown( const SdrViewEvent
& _rViewEvent
);
402 /// handles the request for showing the "Properties"
403 void handleShowPropertiesRequest();
405 sal_Bool
hasForms() const {return m_xForms
.is() && m_xForms
->getCount() != 0;}
406 sal_Bool
hasDatabaseBar() const {return m_bDatabaseBar
;}
407 sal_Bool
canNavigate() const {return m_xNavigationController
.is();}
409 void ShowSelectionProperties( sal_Bool bShow
);
410 sal_Bool
IsPropBrwOpen() const;
412 void DetermineSelection(const SdrMarkList
& rMarkList
);
413 void SetSelection(const SdrMarkList
& rMarkList
);
414 void SetSelectionDelayed();
416 void SetDesignMode(sal_Bool bDesign
);
418 sal_Bool
GetWizardUsing() const { return m_bUseWizards
; }
419 void SetWizardUsing(sal_Bool _bUseThem
);
421 // Setzen des Filtermodus
422 sal_Bool
isInFilterMode() const {return m_bFilterMode
;}
423 void startFiltering();
424 void stopFiltering(sal_Bool bSave
);
426 static PopupMenu
* GetConversionMenu();
427 // ein Menue, das alle ControlConversion-Eintraege enthaelt
429 /// checks whethere a given control conversion slot can be applied to the current selection
430 bool canConvertCurrentSelectionToControl( sal_Int16 nConversionSlot
);
431 /// enables or disables all conversion slots in a menu, according to the current selection
432 void checkControlConversionSlotsForCurrentSelection( Menu
& rMenu
);
433 /// executes a control conversion slot for a given object
434 bool executeControlConversionSlot( const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XFormComponent
>& _rxObject
, sal_uInt16 _nSlotId
);
435 /** executes a control conversion slot for the current selection
436 @precond canConvertCurrentSelectionToControl( <arg>_nSlotId</arg> ) must return <TRUE/>
438 bool executeControlConversionSlot( sal_uInt16 _nSlotId
);
439 /// checks whether the given slot id denotes a control conversion slot
440 static bool isControlConversionSlot( sal_uInt16 _nSlotId
);
442 void ExecuteTextAttribute( SfxRequest
& _rReq
);
443 void GetTextAttributeState( SfxItemSet
& _rSet
);
444 bool IsActiveControl( bool _bCountRichTextOnly
= false ) const;
445 void ForgetActiveControl();
446 void SetControlActivationHandler( const Link
& _rHdl
);
448 /// classifies our host document
449 ::svxform::DocumentType
450 getDocumentType() const;
451 bool isEnhancedForm() const;
453 /// determines whether our host document is currently read-only
454 bool IsReadonlyDoc() const;
456 // das Setzen des curObject/selObject/curForm erfolgt verzoegert (SetSelectionDelayed), mit den folgenden
457 // Funktionen laesst sich das abfragen/erzwingen
458 inline sal_Bool
IsSelectionUpdatePending();
459 void ForceUpdateSelection(sal_Bool bLockInvalidation
);
461 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> getContextDocument() const;
462 ::com::sun::star::uno::Reference
< ::com::sun::star::form::XForm
> getInternalForm(const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XForm
>& _xForm
) const;
463 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSet
> getInternalForm(const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XResultSet
>& _xForm
) const;
464 // if the form belongs to the controller (extern) displaying a grid, the according internal form will
465 // be displayed, _xForm else
467 // check if the current control of the active controler has the focus
468 bool HasControlFocus() const;
471 DECL_LINK(OnFoundData
, FmFoundRecordInformation
*);
472 DECL_LINK(OnCanceledNotFound
, FmFoundRecordInformation
*);
473 DECL_LINK(OnSearchContextRequest
, FmSearchContext
*);
474 DECL_LINK(OnTimeOut
, void*);
475 DECL_LINK(OnFirstTimeActivation
, void*);
476 DECL_LINK(OnFormsCreated
, FmFormPage
*);
478 void LoopGrids(sal_Int16 nWhat
);
480 // Invalidierung von Slots
481 void InvalidateSlot( sal_Int16 nId
, sal_Bool bWithId
);
482 void UpdateSlot( sal_Int16 nId
);
483 // Locking der Invalidierung - wenn der interne Locking-Counter auf 0 geht, werden alle aufgelaufenen Slots
484 // (asynchron) invalidiert
485 void LockSlotInvalidation(sal_Bool bLock
);
487 DECL_LINK(OnInvalidateSlots
, void*);
489 void CloseExternalFormViewer();
490 // closes the task-local beamer displaying a grid view for a form
492 // ConfigItem related stuff
493 virtual void Notify( const com::sun::star::uno::Sequence
< OUString
>& _rPropertyNames
);
494 virtual void Commit();
495 void implAdjustConfigCache();
497 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlContainer
>
498 getControlContainerForView();
500 /** finds and sets a default for m_xCurrentForm, if it is currently NULL
502 void impl_defaultCurrentForm_nothrow();
504 /** sets m_xCurrentForm to the provided form, and udpates everything which
505 depends on the current form
507 void impl_updateCurrentForm( const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XForm
>& _rxNewCurForm
);
509 /** adds or removes ourself as XEventListener at m_xActiveController
511 void impl_switchActiveControllerListening( const bool _bListen
);
515 void impl_AddElement_nothrow(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& Element
);
517 /** remove an element
519 void impl_RemoveElement_nothrow(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& Element
);
521 // ---------------------------------------------------
522 // asyncronous cursor actions/navigation slot handling
525 /** execute the given form slot
526 <p>Warning. Only a small set of slots implemented currently.</p>
530 void ExecuteFormSlot( sal_Int32 _nSlot
);
532 /** determines whether the current form slot is currently enabled
534 bool IsFormSlotEnabled( sal_Int32 _nSlot
, ::com::sun::star::form::runtime::FeatureState
* _pCompleteState
= NULL
);
537 DECL_LINK( OnLoadForms
, FmFormPage
* );
540 //------------------------------------------------------------------------------
541 inline sal_Bool
FmXFormShell::IsSelectionUpdatePending()
543 return m_aMarkTimer
.IsActive();
546 // ========================================================================
547 // = ein Iterator, der ausgehend von einem Interface ein Objekt sucht, dessen
548 // = ::com::sun::star::beans::Property-Set eine ControlSource- sowie eine BoundField-Eigenschaft hat,
549 // = wobei letztere einen Wert ungleich NULL haben muss.
550 // = Wenn das Interface selber diese Bedingung nicht erfuellt, wird getestet,
551 // = ob es ein Container ist (also ueber eine ::com::sun::star::container::XIndexAccess verfuegt), dann
552 // = wird dort abgestiegen und fuer jedes Element des Containers das selbe
553 // = versucht (wiederum eventuell mit Abstieg).
554 // = Wenn irgendein Objekt dabei die geforderte Eigenschaft hat, entfaellt
555 // = der Teil mit dem Container-Test fuer dieses Objekt.
558 class SAL_DLLPRIVATE SearchableControlIterator
: public ::comphelper::IndexAccessIterator
560 OUString m_sCurrentValue
;
561 // der aktuelle Wert der ControlSource-::com::sun::star::beans::Property
564 OUString
getCurrentValue() const { return m_sCurrentValue
; }
567 SearchableControlIterator(::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> xStartingPoint
);
569 virtual sal_Bool
ShouldHandleElement(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& rElement
);
570 virtual sal_Bool
ShouldStepInto(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& xContainer
) const;
571 virtual void Invalidate() { IndexAccessIterator::Invalidate(); m_sCurrentValue
= OUString(); }
574 // ========================================================================
575 typedef boost::ptr_vector
<SfxStatusForwarder
> StatusForwarderArray
;
576 class SVX_DLLPUBLIC ControlConversionMenuController
: public SfxMenuControl
579 StatusForwarderArray m_aStatusForwarders
;
581 PopupMenu
* m_pConversionMenu
;
584 SVX_DLLPRIVATE
ControlConversionMenuController(sal_uInt16 nId
, Menu
& rMenu
, SfxBindings
& rBindings
);
585 SVX_DLLPRIVATE
virtual ~ControlConversionMenuController();
586 SFX_DECL_MENU_CONTROL();
588 SVX_DLLPRIVATE
virtual void StateChanged(sal_uInt16 nSID
, SfxItemState eState
, const SfxPoolItem
* pState
);
591 #endif // _SVX_FMSHIMP_HXX
593 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */