/src/libreoffice/svx/source/inc/fmshimp.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_SOURCE_INC_FMSHIMP_HXX |
20 | | #define INCLUDED_SVX_SOURCE_INC_FMSHIMP_HXX |
21 | | |
22 | | #include <config_options.h> |
23 | | #include <com/sun/star/sdbc/XResultSet.hpp> |
24 | | #include <com/sun/star/container/ContainerEvent.hpp> |
25 | | #include <com/sun/star/container/XContainerListener.hpp> |
26 | | #include <com/sun/star/awt/XControl.hpp> |
27 | | #include <com/sun/star/awt/XControlContainer.hpp> |
28 | | #include <com/sun/star/form/XForm.hpp> |
29 | | #include <com/sun/star/form/runtime/XFormController.hpp> |
30 | | #include <com/sun/star/form/XFormComponent.hpp> |
31 | | #include <com/sun/star/form/NavigationBarMode.hpp> |
32 | | #include <com/sun/star/frame/XFrame.hpp> |
33 | | #include <com/sun/star/view/XSelectionChangeListener.hpp> |
34 | | #include <com/sun/star/beans/XPropertyChangeListener.hpp> |
35 | | #include <com/sun/star/beans/PropertyChangeEvent.hpp> |
36 | | #include <com/sun/star/form/runtime/FeatureState.hpp> |
37 | | #include <comphelper/diagnose_ex.hxx> |
38 | | #include <vcl/timer.hxx> |
39 | | #include <sfx2/shell.hxx> |
40 | | #include <svx/svdmark.hxx> |
41 | | #include <svx/fmsearch.hxx> |
42 | | |
43 | | #include <svx/fmtools.hxx> |
44 | | #include <osl/mutex.hxx> |
45 | | #include <comphelper/container.hxx> |
46 | | #include <cppuhelper/basemutex.hxx> |
47 | | #include <cppuhelper/compbase.hxx> |
48 | | #include <unotools/configitem.hxx> |
49 | | #include "formcontrolling.hxx" |
50 | | #include "fmdocumentclassification.hxx" |
51 | | #include <o3tl/typed_flags_set.hxx> |
52 | | |
53 | | #include <queue> |
54 | | #include <string_view> |
55 | | #include <vector> |
56 | | #include <memory> |
57 | | |
58 | | struct ImplSVEvent; |
59 | | |
60 | | typedef std::vector< css::uno::Reference< css::form::XForm > > FmFormArray; |
61 | | |
62 | | // catch database exceptions if they occur |
63 | 0 | #define DO_SAFE(statement) try { statement; } catch( const Exception& ) { TOOLS_WARN_EXCEPTION("svx", "unhandled exception (I tried to move a cursor (or something like that).)"); } |
64 | | |
65 | | enum class LoopGridsSync { |
66 | | DISABLE_SYNC = 1, |
67 | | FORCE_SYNC = 2, |
68 | | ENABLE_SYNC = 3 |
69 | | }; |
70 | | enum class LoopGridsFlags |
71 | | { |
72 | | NONE = 0, |
73 | | DISABLE_ROCTRLR = 4 |
74 | | }; |
75 | | namespace o3tl |
76 | | { |
77 | | template<> struct typed_flags<LoopGridsFlags> : is_typed_flags<LoopGridsFlags, 0x04> {}; |
78 | | } |
79 | | |
80 | | |
81 | | // flags for controlling the behaviour when calling loadForms |
82 | | enum class LoadFormsFlags { |
83 | | Load = 0x0000, // default: simply load |
84 | | Sync = 0x0000, // default: do in synchronous |
85 | | Unload = 0x0001, // unload |
86 | | Async = 0x0002 // do this async |
87 | | }; |
88 | | namespace o3tl { |
89 | | template<> struct typed_flags<LoadFormsFlags> : is_typed_flags<LoadFormsFlags, 0x0003> {}; |
90 | | } |
91 | | |
92 | | namespace weld { |
93 | | class Menu; |
94 | | } |
95 | | |
96 | | // a class iterating through all fields of a form which are bound to a field |
97 | | // sub forms are ignored, grid columns (where the grid is a direct child of the form) are included |
98 | | class FmXBoundFormFieldIterator final : public ::comphelper::IndexAccessIterator |
99 | | { |
100 | | public: |
101 | 0 | FmXBoundFormFieldIterator(const css::uno::Reference< css::uno::XInterface>& _rStartingPoint) : ::comphelper::IndexAccessIterator(_rStartingPoint) { } |
102 | | |
103 | | private: |
104 | | virtual bool ShouldHandleElement(const css::uno::Reference< css::uno::XInterface>& _rElement) override; |
105 | | virtual bool ShouldStepInto(const css::uno::Reference< css::uno::XInterface>& _rContainer) const override; |
106 | | }; |
107 | | |
108 | | class FmFormPage; |
109 | | class FmFormPageImpl; |
110 | | |
111 | | struct FmLoadAction |
112 | | { |
113 | | FmFormPage* pPage; |
114 | | ImplSVEvent * nEventId; |
115 | | LoadFormsFlags nFlags; |
116 | | |
117 | | FmLoadAction( FmFormPage* _pPage, LoadFormsFlags _nFlags, ImplSVEvent * _nEventId ) |
118 | 13 | :pPage( _pPage ), nEventId( _nEventId ), nFlags( _nFlags ) |
119 | 13 | { |
120 | 13 | } |
121 | | }; |
122 | | |
123 | | |
124 | | class SfxViewFrame; |
125 | | typedef ::cppu::WeakComponentImplHelper< css::beans::XPropertyChangeListener |
126 | | , css::container::XContainerListener |
127 | | , css::view::XSelectionChangeListener |
128 | | , css::form::XFormControllerListener |
129 | | > FmXFormShell_BD_BASE; |
130 | | |
131 | | |
132 | | class FmXFormShell_Base_Disambiguation : public FmXFormShell_BD_BASE |
133 | | { |
134 | | using css::beans::XPropertyChangeListener::disposing; |
135 | | protected: |
136 | | FmXFormShell_Base_Disambiguation( ::osl::Mutex& _rMutex ); |
137 | | using WeakComponentImplHelperBase::disposing; |
138 | | }; |
139 | | |
140 | | |
141 | | namespace svx |
142 | | { |
143 | | class FmTextControlShell; |
144 | | } |
145 | | |
146 | | |
147 | | typedef FmXFormShell_Base_Disambiguation FmXFormShell_BASE; |
148 | | typedef ::utl::ConfigItem FmXFormShell_CFGBASE; |
149 | | |
150 | | struct SdrViewEvent; |
151 | | class FmFormShell; |
152 | | class FmFormView; |
153 | | class FmFormObj; |
154 | | class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) FmXFormShell final : private cppu::BaseMutex |
155 | | ,public FmXFormShell_BASE |
156 | | ,public FmXFormShell_CFGBASE |
157 | | ,public svx::IControllerFeatureInvalidation |
158 | | { |
159 | | friend class FmFormView; |
160 | | friend class FmXFormView; |
161 | | |
162 | | class SuspendPropertyTracking; |
163 | | friend class SuspendPropertyTracking; |
164 | | |
165 | | // timer for delayed mark |
166 | | Timer m_aMarkTimer; |
167 | | std::vector<SdrObject*> m_arrSearchedControls; |
168 | | // We enable a permanent cursor for the grid we found a searched text, it's disabled in the next "found" event. |
169 | | FmFormArray m_aSearchForms; |
170 | | |
171 | | struct SAL_DLLPRIVATE InvalidSlotInfo { |
172 | | sal_uInt16 id; |
173 | | sal_uInt8 flags; |
174 | 0 | InvalidSlotInfo(sal_uInt16 slotId, sal_uInt8 flgs) : id(slotId), flags(flgs) {}; |
175 | | }; |
176 | | std::vector<InvalidSlotInfo> m_arrInvalidSlots; |
177 | | // we explicitly switch off the propbrw before leaving the design mode |
178 | | // this flag tells us if we have to switch it on again when reentering |
179 | | |
180 | | css::form::NavigationBarMode m_eNavigate; // kind of navigation |
181 | | |
182 | | // since I want to mark an SdrObject when searching for the treatment of the "found", |
183 | | // I get all relevant objects before yanking up of the search dialog |
184 | | // (the array is thus only valid during the search process) |
185 | | std::vector<sal_Int16> m_arrRelativeGridColumn; |
186 | | |
187 | | ImplSVEvent * m_nInvalidationEvent; |
188 | | ImplSVEvent * m_nActivationEvent; |
189 | | ::std::queue< FmLoadAction > |
190 | | m_aLoadingPages; |
191 | | |
192 | | FmFormShell* m_pShell; |
193 | | std::unique_ptr<svx::FmTextControlShell> m_pTextShell; |
194 | | |
195 | | svx::ControllerFeatures m_aActiveControllerFeatures; |
196 | | svx::ControllerFeatures m_aNavControllerFeatures; |
197 | | |
198 | | // current form, controller |
199 | | // only available in the alive mode |
200 | | css::uno::Reference< css::form::runtime::XFormController > m_xActiveController; |
201 | | css::uno::Reference< css::form::runtime::XFormController > m_xNavigationController; |
202 | | css::uno::Reference< css::form::XForm > m_xActiveForm; |
203 | | |
204 | | // current container of a page |
205 | | // only available in the design mode |
206 | | css::uno::Reference< css::container::XIndexAccess> m_xForms; |
207 | | |
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 | | css::uno::Reference< css::form::XForm > m_xCurrentForm; |
212 | | /// the last selection/marking of controls only. Necessary to implement the "Control properties" slot |
213 | | InterfaceBag m_aLastKnownMarkedControls; |
214 | | |
215 | | |
216 | | // And this is also for the 'found': When I find in GridControls, I need the column, |
217 | | // but only get the number of the field corresponding to the number of the |
218 | | // column + <offset>, where the offset depends on the position of the GridControl |
219 | | // in the form. So here is a conversion. |
220 | | css::uno::Reference< css::awt::XControlModel> m_xLastGridFound; |
221 | | // the frame we live in |
222 | | css::uno::Reference< css::frame::XFrame> m_xAttachedFrame; |
223 | | // Administration of external form views (see the SID_FM_VIEW_AS_GRID-slot) |
224 | | css::uno::Reference< css::frame::XController > m_xExternalViewController; // the controller for the external form view |
225 | | css::uno::Reference< css::form::runtime::XFormController > m_xExtViewTriggerController; // the nav controller at the time the external display was triggered |
226 | | css::uno::Reference< css::sdbc::XResultSet > m_xExternalDisplayedForm; // the form which the external view is based on |
227 | | |
228 | | mutable ::svxform::DocumentType |
229 | | m_eDocumentType; /// the type of document we're living in |
230 | | sal_Int16 m_nLockSlotInvalidation; |
231 | | bool m_bHadPropertyBrowserInDesignMode : 1; |
232 | | |
233 | | bool m_bTrackProperties : 1; |
234 | | // should I (or the owner of this impl class) take car of the update of the css::beans::Property-Browser? |
235 | | |
236 | | bool m_bUseWizards : 1; |
237 | | |
238 | | bool m_bDatabaseBar : 1; // is there a database bar |
239 | | bool m_bInActivate : 1; // is a controller activated |
240 | | bool m_bSetFocus : 1; // may the focus be changed over |
241 | | bool m_bFilterMode : 1; // is a filter currently set to the controls |
242 | | bool m_bChangingDesignMode:1; // sal_True within SetDesignMode |
243 | | bool m_bPreparedClose : 1; // for the current modification state of the current form |
244 | | // PrepareClose had been called and the user denied to save changes |
245 | | bool m_bFirstActivation : 1; // has the shell ever been activated? |
246 | | |
247 | | public: |
248 | | // attribute access |
249 | | SAL_DLLPRIVATE const css::uno::Reference< css::frame::XFrame >& |
250 | 0 | getHostFrame_Lock() const { return m_xAttachedFrame; } |
251 | | SAL_DLLPRIVATE const css::uno::Reference< css::sdbc::XResultSet >& |
252 | 0 | getExternallyDisplayedForm_Lock() const { return m_xExternalDisplayedForm; } |
253 | | |
254 | | SAL_DLLPRIVATE bool |
255 | 9.15k | didPrepareClose_Lock() const { return m_bPreparedClose; } |
256 | | SAL_DLLPRIVATE void |
257 | 0 | didPrepareClose_Lock(bool bDid) { m_bPreparedClose = bDid; } |
258 | | |
259 | | SAL_DLLPRIVATE FmXFormShell(FmFormShell& _rShell, SfxViewFrame* _pViewFrame); |
260 | | |
261 | | private: |
262 | | SAL_DLLPRIVATE virtual ~FmXFormShell() override; |
263 | | |
264 | | // EventListener |
265 | | SAL_DLLPRIVATE virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override; |
266 | | |
267 | | // css::container::XContainerListener |
268 | | SAL_DLLPRIVATE virtual void SAL_CALL elementInserted(const css::container::ContainerEvent& rEvent) override; |
269 | | SAL_DLLPRIVATE virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent& rEvent) override; |
270 | | SAL_DLLPRIVATE virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent& rEvent) override; |
271 | | |
272 | | // XSelectionChangeListener |
273 | | SAL_DLLPRIVATE virtual void SAL_CALL selectionChanged(const css::lang::EventObject& rEvent) override; |
274 | | |
275 | | // css::beans::XPropertyChangeListener |
276 | | SAL_DLLPRIVATE virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent& evt) override; |
277 | | |
278 | | // css::form::XFormControllerListener |
279 | | SAL_DLLPRIVATE virtual void SAL_CALL formActivated(const css::lang::EventObject& rEvent) override; |
280 | | SAL_DLLPRIVATE virtual void SAL_CALL formDeactivated(const css::lang::EventObject& rEvent) override; |
281 | | |
282 | | // OComponentHelper |
283 | | SAL_DLLPRIVATE virtual void SAL_CALL disposing() override; |
284 | | |
285 | | public: |
286 | 9.15k | SAL_DLLPRIVATE void EnableTrackProperties_Lock(bool bEnable) { m_bTrackProperties = bEnable; } |
287 | 4.60k | SAL_DLLPRIVATE bool IsTrackPropertiesEnabled_Lock() const { return m_bTrackProperties; } |
288 | | |
289 | | // activation handling |
290 | | SAL_DLLPRIVATE void viewActivated_Lock(FmFormView& _rCurrentView, bool _bSyncAction = false); |
291 | | SAL_DLLPRIVATE void viewDeactivated_Lock(FmFormView& _rCurrentView, bool _bDeactivateController = true); |
292 | | |
293 | | // IControllerFeatureInvalidation |
294 | | SAL_DLLPRIVATE virtual void invalidateFeatures/*_NoLock*/( const ::std::vector< sal_Int32 >& _rFeatures ) override; |
295 | | |
296 | | SAL_DLLPRIVATE void ExecuteTabOrderDialog_Lock( // execute SID_FM_TAB_DIALOG |
297 | | const css::uno::Reference< css::awt::XTabControllerModel >& _rxForForm |
298 | | ); |
299 | | |
300 | | // stuff |
301 | | SAL_DLLPRIVATE void AddElement_Lock(const css::uno::Reference< css::uno::XInterface>& Element); |
302 | | SAL_DLLPRIVATE void RemoveElement_Lock(const css::uno::Reference< css::uno::XInterface>& Element); |
303 | | |
304 | | /** updates m_xForms, to be either <NULL/>, if we're in alive mode, or our current page's forms collection, |
305 | | if in design mode |
306 | | */ |
307 | | SAL_DLLPRIVATE void UpdateForms_Lock(bool bInvalidate); |
308 | | |
309 | | SAL_DLLPRIVATE void ExecuteSearch_Lock(); // execute SID_FM_SEARCH |
310 | | SAL_DLLPRIVATE void CreateExternalView_Lock(); // execute SID_FM_VIEW_AS_GRID |
311 | | |
312 | | SAL_DLLPRIVATE bool GetY2KState_Lock(sal_uInt16 & n); |
313 | | SAL_DLLPRIVATE void SetY2KState_Lock(sal_uInt16 n); |
314 | | |
315 | | private: |
316 | | // form handling |
317 | | /// load or unload the forms on a page |
318 | | SAL_DLLPRIVATE void loadForms_Lock( FmFormPage* _pPage, const LoadFormsFlags _nBehaviour ); |
319 | | SAL_DLLPRIVATE void smartControlReset( const css::uno::Reference< css::container::XIndexAccess >& _rxModels ); |
320 | | |
321 | | |
322 | | SAL_DLLPRIVATE void startListening_Lock(); |
323 | | SAL_DLLPRIVATE void stopListening_Lock(); |
324 | | |
325 | | SAL_DLLPRIVATE css::uno::Reference< css::awt::XControl > |
326 | | impl_getControl_Lock( |
327 | | const css::uno::Reference< css::awt::XControlModel>& i_rxModel, |
328 | | const FmFormObj& i_rKnownFormObj |
329 | | ); |
330 | | |
331 | | // collects in strNames the names of all forms |
332 | | SAL_DLLPRIVATE static void impl_collectFormSearchContexts_nothrow_Lock( |
333 | | const css::uno::Reference< css::uno::XInterface>& _rxStartingPoint, |
334 | | std::u16string_view _rCurrentLevelPrefix, |
335 | | FmFormArray& _out_rForms, |
336 | | ::std::vector< OUString >& _out_rNames ); |
337 | | |
338 | | /** checks whenever the instance is already disposed, if so, this is reported as assertion error (debug |
339 | | builds only) and <TRUE/> is returned. |
340 | | */ |
341 | | SAL_DLLPRIVATE bool impl_checkDisposed_Lock() const; |
342 | | |
343 | | public: |
344 | | // method for non design mode (alive mode) |
345 | | SAL_DLLPRIVATE void setActiveController_Lock(const css::uno::Reference< css::form::runtime::XFormController>& _xController, bool _bNoSaveOldContent = false); |
346 | 0 | SAL_DLLPRIVATE const css::uno::Reference< css::form::runtime::XFormController>& getActiveController_Lock() const { return m_xActiveController; } |
347 | 0 | SAL_DLLPRIVATE const css::uno::Reference< css::form::runtime::XFormController>& getActiveInternalController_Lock() const { return m_xActiveController == m_xExternalViewController ? m_xExtViewTriggerController : m_xActiveController; } |
348 | 0 | SAL_DLLPRIVATE const css::uno::Reference< css::form::XForm>& getActiveForm_Lock() const { return m_xActiveForm; } |
349 | 0 | SAL_DLLPRIVATE const css::uno::Reference< css::form::runtime::XFormController>& getNavController_Lock() const { return m_xNavigationController; } |
350 | | |
351 | | SAL_DLLPRIVATE const svx::ControllerFeatures& getActiveControllerFeatures_Lock() const |
352 | 0 | { return m_aActiveControllerFeatures; } |
353 | | SAL_DLLPRIVATE const svx::ControllerFeatures& getNavControllerFeatures_Lock() const |
354 | 0 | { return m_aNavControllerFeatures.isAssigned() ? m_aNavControllerFeatures : m_aActiveControllerFeatures; } |
355 | | |
356 | | /** announces a new "current selection" |
357 | | @return |
358 | | <TRUE/> if and only if the to-bet-set selection was different from the previous selection |
359 | | */ |
360 | | SAL_DLLPRIVATE bool setCurrentSelection_Lock(InterfaceBag&& rSelection); |
361 | | |
362 | | /** sets the new selection to the last known marked controls |
363 | | */ |
364 | | SAL_DLLPRIVATE bool selectLastMarkedControls_Lock(); |
365 | | |
366 | | /** retrieves the current selection |
367 | | */ |
368 | | void getCurrentSelection_Lock(InterfaceBag& /* [out] */ _rSelection) const; |
369 | | |
370 | | /** sets a new current selection as indicated by a mark list |
371 | | @return |
372 | | <TRUE/> if and only if the to-bet-set selection was different from the previous selection |
373 | | */ |
374 | | SAL_DLLPRIVATE bool setCurrentSelectionFromMark_Lock(const SdrMarkList& rMarkList); |
375 | | |
376 | | /// returns the currently selected form, or the form which all currently selected controls belong to, or <NULL/> |
377 | | SAL_DLLPRIVATE const css::uno::Reference< css::form::XForm >& |
378 | 0 | getCurrentForm_Lock() const { return m_xCurrentForm; } |
379 | | SAL_DLLPRIVATE void forgetCurrentForm_Lock(); |
380 | | /// returns whether the last known marking contained only controls |
381 | 0 | SAL_DLLPRIVATE bool onlyControlsAreMarked_Lock() const { return !m_aLastKnownMarkedControls.empty(); } |
382 | | |
383 | | /// determines whether the current selection consists of exactly the given object |
384 | | SAL_DLLPRIVATE bool isSolelySelected_Lock( |
385 | | const css::uno::Reference< css::uno::XInterface >& _rxObject |
386 | | ); |
387 | | |
388 | | /// handles a MouseButtonDown event of the FmFormView |
389 | | SAL_DLLPRIVATE void handleMouseButtonDown_Lock( const SdrViewEvent& _rViewEvent ); |
390 | | /// handles the request for showing the "Properties" |
391 | | SAL_DLLPRIVATE void handleShowPropertiesRequest_Lock(); |
392 | | |
393 | 13.7k | SAL_DLLPRIVATE bool hasForms_Lock() const { return m_xForms.is() && m_xForms->getCount() != 0; } |
394 | 39 | SAL_DLLPRIVATE bool hasDatabaseBar_Lock() const { return m_bDatabaseBar; } |
395 | | |
396 | | SAL_DLLPRIVATE void ShowSelectionProperties_Lock(bool bShow); |
397 | | SAL_DLLPRIVATE bool IsPropBrwOpen_Lock() const; |
398 | | |
399 | | SAL_DLLPRIVATE void DetermineSelection_Lock(const SdrMarkList& rMarkList); |
400 | | SAL_DLLPRIVATE void SetSelection_Lock(const SdrMarkList& rMarkList); |
401 | | SAL_DLLPRIVATE void SetSelectionDelayed_Lock(); |
402 | | |
403 | | SAL_DLLPRIVATE void SetDesignMode_Lock(bool bDesign); |
404 | | |
405 | 0 | SAL_DLLPRIVATE bool GetWizardUsing_Lock() const { return m_bUseWizards; } |
406 | | SAL_DLLPRIVATE void SetWizardUsing_Lock(bool _bUseThem); |
407 | | |
408 | | // setting the filter mode |
409 | 26 | SAL_DLLPRIVATE bool isInFilterMode_Lock() const { return m_bFilterMode; } |
410 | | SAL_DLLPRIVATE void startFiltering_Lock(); |
411 | | SAL_DLLPRIVATE void stopFiltering_Lock(bool bSave); |
412 | | |
413 | | // fills rMenu to be a menu that contains all ControlConversion entries |
414 | | SAL_DLLPRIVATE static void GetConversionMenu_Lock(weld::Menu& rMenu); |
415 | | |
416 | | /// checks whether a given control conversion slot can be applied to the current selection |
417 | | SAL_DLLPRIVATE bool canConvertCurrentSelectionToControl_Lock(std::u16string_view rIdent); |
418 | | /// enables or disables all conversion slots in a menu, according to the current selection |
419 | | SAL_DLLPRIVATE void checkControlConversionSlotsForCurrentSelection_Lock(weld::Menu& rMenu); |
420 | | /// executes a control conversion slot for a given object |
421 | | SAL_DLLPRIVATE bool executeControlConversionSlot_Lock(const css::uno::Reference< css::form::XFormComponent >& _rxObject, std::u16string_view rIdent); |
422 | | /** executes a control conversion slot for the current selection |
423 | | @precond canConvertCurrentSelectionToControl( <arg>_nSlotId</arg> ) must return <TRUE/> |
424 | | */ |
425 | | SAL_DLLPRIVATE void executeControlConversionSlot_Lock(std::u16string_view rIdent); |
426 | | /// checks whether the given slot id denotes a control conversion slot |
427 | | SAL_DLLPRIVATE static bool isControlConversionSlot(std::u16string_view rIdent); |
428 | | |
429 | | SAL_DLLPRIVATE void ExecuteTextAttribute_Lock(SfxRequest& _rReq); |
430 | | SAL_DLLPRIVATE void GetTextAttributeState_Lock(SfxItemSet& _rSet); |
431 | | SAL_DLLPRIVATE bool IsActiveControl_Lock(bool _bCountRichTextOnly) const; |
432 | | SAL_DLLPRIVATE void ForgetActiveControl_Lock(); |
433 | | SAL_DLLPRIVATE void SetControlActivationHandler_Lock(const Link<LinkParamNone*,void>& _rHdl); |
434 | | |
435 | | /// classifies our host document |
436 | | SAL_DLLPRIVATE ::svxform::DocumentType getDocumentType_Lock() const; |
437 | | SAL_DLLPRIVATE bool isEnhancedForm_Lock() const; |
438 | | |
439 | | /// determines whether our host document is currently read-only |
440 | | SAL_DLLPRIVATE bool IsReadonlyDoc_Lock() const; |
441 | | |
442 | | // Setting the curObject/selObject/curForm is delayed (SetSelectionDelayed). With the |
443 | | // following functions this can be inquired/enforced. |
444 | | SAL_DLLPRIVATE inline bool IsSelectionUpdatePending_Lock() const; |
445 | | SAL_DLLPRIVATE void ForceUpdateSelection_Lock(); |
446 | | |
447 | | SAL_DLLPRIVATE css::uno::Reference< css::frame::XModel> getContextDocument_Lock() const; |
448 | | SAL_DLLPRIVATE css::uno::Reference< css::form::XForm> getInternalForm_Lock(const css::uno::Reference< css::form::XForm>& _xForm) const; |
449 | | SAL_DLLPRIVATE css::uno::Reference< css::sdbc::XResultSet> getInternalForm_Lock(const css::uno::Reference< css::sdbc::XResultSet>& _xForm) const; |
450 | | // if the form belongs to the controller (extern) displaying a grid, the according internal form will |
451 | | // be displayed, _xForm else |
452 | | |
453 | | // check if the current control of the active controller has the focus |
454 | | SAL_DLLPRIVATE bool HasControlFocus_Lock() const; |
455 | | |
456 | | private: |
457 | | DECL_DLLPRIVATE_LINK(OnFoundData_Lock, FmFoundRecordInformation&, void); |
458 | | DECL_DLLPRIVATE_LINK(OnCanceledNotFound_Lock, FmFoundRecordInformation&, void); |
459 | | DECL_DLLPRIVATE_LINK(OnSearchContextRequest_Lock, FmSearchContext&, sal_uInt32); |
460 | | DECL_DLLPRIVATE_LINK(OnTimeOut_Lock, Timer*, void); |
461 | | DECL_DLLPRIVATE_LINK(OnFirstTimeActivation_Lock, void*, void); |
462 | | DECL_DLLPRIVATE_LINK(OnFormsCreated_Lock, FmFormPageImpl&, void); |
463 | | |
464 | | SAL_DLLPRIVATE void LoopGrids_Lock(LoopGridsSync nSync, LoopGridsFlags nWhat = LoopGridsFlags::NONE); |
465 | | |
466 | | // invalidation of slots |
467 | | SAL_DLLPRIVATE void InvalidateSlot_Lock(sal_Int16 nId, bool bWithId); |
468 | | SAL_DLLPRIVATE void UpdateSlot_Lock(sal_Int16 nId); |
469 | | // locking the invalidation - if the internal locking counter goes to 0, all accumulated slots |
470 | | // are invalidated (asynchronously) |
471 | | SAL_DLLPRIVATE void LockSlotInvalidation_Lock(bool bLock); |
472 | | |
473 | | DECL_DLLPRIVATE_LINK(OnInvalidateSlots_Lock, void*, void); |
474 | | |
475 | | SAL_DLLPRIVATE void CloseExternalFormViewer_Lock(); |
476 | | // closes the task-local beamer displaying a grid view for a form |
477 | | |
478 | | // ConfigItem related stuff |
479 | | SAL_DLLPRIVATE virtual void Notify( const css::uno::Sequence< OUString >& _rPropertyNames) override; |
480 | | SAL_DLLPRIVATE void implAdjustConfigCache_Lock(); |
481 | | |
482 | | SAL_DLLPRIVATE css::uno::Reference< css::awt::XControlContainer > |
483 | | getControlContainerForView_Lock() const; |
484 | | |
485 | | /** finds and sets a default for m_xCurrentForm, if it is currently NULL |
486 | | */ |
487 | | SAL_DLLPRIVATE void impl_defaultCurrentForm_nothrow_Lock(); |
488 | | |
489 | | /** sets m_xCurrentForm to the provided form, and updates everything which |
490 | | depends on the current form |
491 | | */ |
492 | | SAL_DLLPRIVATE void impl_updateCurrentForm_Lock( const css::uno::Reference< css::form::XForm >& _rxNewCurForm ); |
493 | | |
494 | | /** adds or removes ourself as XEventListener at m_xActiveController |
495 | | */ |
496 | | SAL_DLLPRIVATE void impl_switchActiveControllerListening_Lock(const bool _bListen); |
497 | | |
498 | | /** add an element |
499 | | */ |
500 | | SAL_DLLPRIVATE void impl_AddElement_nothrow(const css::uno::Reference< css::uno::XInterface>& Element); |
501 | | |
502 | | /** remove an element |
503 | | */ |
504 | | SAL_DLLPRIVATE void impl_RemoveElement_nothrow_Lock(const css::uno::Reference< css::uno::XInterface>& Element); |
505 | | |
506 | | SAL_DLLPRIVATE virtual void ImplCommit() override; |
507 | | |
508 | | // asynchronous cursor actions/navigation slot handling |
509 | | |
510 | | public: |
511 | | /** execute the given form slot |
512 | | <p>Warning. Only a small set of slots implemented currently.</p> |
513 | | @param _nSlot |
514 | | the slot to execute |
515 | | */ |
516 | | SAL_DLLPRIVATE void ExecuteFormSlot_Lock(sal_Int32 _nSlot); |
517 | | |
518 | | /** determines whether the current form slot is currently enabled |
519 | | */ |
520 | | SAL_DLLPRIVATE bool IsFormSlotEnabled( sal_Int32 _nSlot, css::form::runtime::FeatureState* _pCompleteState ) const; |
521 | | |
522 | | SAL_DLLPRIVATE static OUString SlotToIdent(sal_uInt16 nSlot); |
523 | | |
524 | | private: |
525 | | DECL_DLLPRIVATE_LINK( OnLoadForms_Lock, void*, void ); |
526 | | }; |
527 | | |
528 | | |
529 | | inline bool FmXFormShell::IsSelectionUpdatePending_Lock() const |
530 | 0 | { |
531 | 0 | return m_aMarkTimer.IsActive(); |
532 | 0 | } |
533 | | |
534 | | |
535 | | // = An iterator that, emanating from an interface, looks for an object whose |
536 | | // = css::beans::Property-Set has a ControlSource and a BoundField property, the |
537 | | // = latter having a non-NULL value. If the interface itself does not meet this |
538 | | // = condition, it is tested whether it is a container (that is, has a |
539 | | // = css::container::XIndexAccess), then it is descended there and the same tried |
540 | | // = for each element of the container (again possibly with descent). If any |
541 | | // = object thereby has the required property, the part with the container test |
542 | | // = for that object is omitted. |
543 | | // = |
544 | | |
545 | | class SearchableControlIterator final : public ::comphelper::IndexAccessIterator |
546 | | { |
547 | | OUString m_sCurrentValue; |
548 | | // the current value of the ControlSource css::beans::Property |
549 | | |
550 | | public: |
551 | 0 | const OUString& getCurrentValue() const { return m_sCurrentValue; } |
552 | | |
553 | | SearchableControlIterator(css::uno::Reference< css::uno::XInterface> const & xStartingPoint); |
554 | | |
555 | | virtual bool ShouldHandleElement(const css::uno::Reference< css::uno::XInterface>& rElement) override; |
556 | | virtual bool ShouldStepInto(const css::uno::Reference< css::uno::XInterface>& xContainer) const override; |
557 | 0 | virtual void Invalidate() override { IndexAccessIterator::Invalidate(); m_sCurrentValue.clear(); } |
558 | | }; |
559 | | |
560 | | #endif // INCLUDED_SVX_SOURCE_INC_FMSHIMP_HXX |
561 | | |
562 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |