/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ #ifndef INCLUDED_SVX_SOURCE_INC_FMSHIMP_HXX #define INCLUDED_SVX_SOURCE_INC_FMSHIMP_HXX
// flags for controlling the behaviour when calling loadForms enumclass LoadFormsFlags {
Load = 0x0000, // default: simply load
Sync = 0x0000, // default: do in synchronous
Unload = 0x0001, // unload
Async = 0x0002 // do this async
}; namespace o3tl { template<> struct typed_flags<LoadFormsFlags> : is_typed_flags<LoadFormsFlags, 0x0003> {};
}
namespace weld { class Menu;
}
// a class iterating through all fields of a form which are bound to a field // sub forms are ignored, grid columns (where the grid is a direct child of the form) are included class FmXBoundFormFieldIterator final : public ::comphelper::IndexAccessIterator
{ public:
FmXBoundFormFieldIterator(const css::uno::Reference< css::uno::XInterface>& _rStartingPoint) : ::comphelper::IndexAccessIterator(_rStartingPoint) { }
class FmXFormShell_Base_Disambiguation : public FmXFormShell_BD_BASE
{ using css::beans::XPropertyChangeListener::disposing; protected:
FmXFormShell_Base_Disambiguation( ::osl::Mutex& _rMutex ); using WeakComponentImplHelperBase::disposing;
};
struct SdrViewEvent; class FmFormShell; class FmFormView; class FmFormObj; class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) FmXFormShell final : private cppu::BaseMutex
,public FmXFormShell_BASE
,public FmXFormShell_CFGBASE
,public svx::IControllerFeatureInvalidation
{ friendclass FmFormView; friendclass FmXFormView;
class SuspendPropertyTracking; friendclass SuspendPropertyTracking;
// timer for delayed mark
Timer m_aMarkTimer;
std::vector<SdrObject*> m_arrSearchedControls; // We enable a permanent cursor for the grid we found a searched text, it's disabled in the next "found" event.
FmFormArray m_aSearchForms;
struct SAL_DLLPRIVATE InvalidSlotInfo {
sal_uInt16 id;
sal_uInt8 flags;
InvalidSlotInfo(sal_uInt16 slotId, sal_uInt8 flgs) : id(slotId), flags(flgs) {};
};
std::vector<InvalidSlotInfo> m_arrInvalidSlots; // we explicitly switch off the propbrw before leaving the design mode // this flag tells us if we have to switch it on again when reentering
css::form::NavigationBarMode m_eNavigate; // kind of navigation
// since I want to mark an SdrObject when searching for the treatment of the "found", // I get all relevant objects before yanking up of the search dialog // (the array is thus only valid during the search process)
std::vector<sal_Int16> m_arrRelativeGridColumn;
// current form, controller // only available in the alive mode
css::uno::Reference< css::form::runtime::XFormController > m_xActiveController;
css::uno::Reference< css::form::runtime::XFormController > m_xNavigationController;
css::uno::Reference< css::form::XForm > m_xActiveForm;
// current container of a page // only available in the design mode
css::uno::Reference< css::container::XIndexAccess> m_xForms;
// the currently selected objects, as to be displayed in the property browser
InterfaceBag m_aCurrentSelection; /// the currently selected form, or the form which all currently selected controls belong to, or <NULL/>
css::uno::Reference< css::form::XForm > m_xCurrentForm; /// the last selection/marking of controls only. Necessary to implement the "Control properties" slot
InterfaceBag m_aLastKnownMarkedControls;
// And this is also for the 'found': When I find in GridControls, I need the column, // but only get the number of the field corresponding to the number of the // column + <offset>, where the offset depends on the position of the GridControl // in the form. So here is a conversion.
css::uno::Reference< css::awt::XControlModel> m_xLastGridFound; // the frame we live in
css::uno::Reference< css::frame::XFrame> m_xAttachedFrame; // Administration of external form views (see the SID_FM_VIEW_AS_GRID-slot)
css::uno::Reference< css::frame::XController > m_xExternalViewController; // the controller for the external form view
css::uno::Reference< css::form::runtime::XFormController > m_xExtViewTriggerController; // the nav controller at the time the external display was triggered
css::uno::Reference< css::sdbc::XResultSet > m_xExternalDisplayedForm; // the form which the external view is based on
mutable ::svxform::DocumentType
m_eDocumentType; /// the type of document we're living in
sal_Int16 m_nLockSlotInvalidation; bool m_bHadPropertyBrowserInDesignMode : 1;
bool m_bTrackProperties : 1; // should I (or the owner of this impl class) take car of the update of the css::beans::Property-Browser?
bool m_bUseWizards : 1;
bool m_bDatabaseBar : 1; // is there a database bar bool m_bInActivate : 1; // is a controller activated bool m_bSetFocus : 1; // may the focus be changed over bool m_bFilterMode : 1; // is a filter currently set to the controls bool m_bChangingDesignMode:1; // sal_True within SetDesignMode bool m_bPreparedClose : 1; // for the current modification state of the current form // PrepareClose had been called and the user denied to save changes bool m_bFirstActivation : 1; // has the shell ever been activated?
/** updates m_xForms, to be either <NULL/>, if we're in alive mode, or our current page's forms collection, if in design mode
*/
SAL_DLLPRIVATE void UpdateForms_Lock(bool bInvalidate);
// collects in strNames the names of all forms
SAL_DLLPRIVATE staticvoid impl_collectFormSearchContexts_nothrow_Lock( const css::uno::Reference< css::uno::XInterface>& _rxStartingPoint,
std::u16string_view _rCurrentLevelPrefix,
FmFormArray& _out_rForms,
::std::vector< OUString >& _out_rNames );
/** checks whenever the instance is already disposed, if so, this is reported as assertion error (debug builds only) and <TRUE/> is returned.
*/
SAL_DLLPRIVATE bool impl_checkDisposed_Lock() const;
/** announces a new "current selection" @return <TRUE/> if and only if the to-bet-set selection was different from the previous selection
*/
SAL_DLLPRIVATE bool setCurrentSelection_Lock(InterfaceBag&& rSelection);
/** sets the new selection to the last known marked controls
*/
SAL_DLLPRIVATE bool selectLastMarkedControls_Lock();
/** retrieves the current selection
*/ void getCurrentSelection_Lock(InterfaceBag& /* [out] */ _rSelection) const;
/** sets a new current selection as indicated by a mark list @return <TRUE/> if and only if the to-bet-set selection was different from the previous selection
*/
SAL_DLLPRIVATE bool setCurrentSelectionFromMark_Lock(const SdrMarkList& rMarkList);
/// returns the currently selected form, or the form which all currently selected controls belong to, or <NULL/>
SAL_DLLPRIVATE const css::uno::Reference< css::form::XForm >&
getCurrentForm_Lock() const { return m_xCurrentForm; }
SAL_DLLPRIVATE void forgetCurrentForm_Lock(); /// returns whether the last known marking contained only controls
SAL_DLLPRIVATE bool onlyControlsAreMarked_Lock() const { return !m_aLastKnownMarkedControls.empty(); }
/// determines whether the current selection consists of exactly the given object
SAL_DLLPRIVATE bool isSolelySelected_Lock( const css::uno::Reference< css::uno::XInterface >& _rxObject
);
/// handles a MouseButtonDown event of the FmFormView
SAL_DLLPRIVATE void handleMouseButtonDown_Lock( const SdrViewEvent& _rViewEvent ); /// handles the request for showing the "Properties"
SAL_DLLPRIVATE void handleShowPropertiesRequest_Lock();
// fills rMenu to be a menu that contains all ControlConversion entries
SAL_DLLPRIVATE staticvoid GetConversionMenu_Lock(weld::Menu& rMenu);
/// checks whether a given control conversion slot can be applied to the current selection
SAL_DLLPRIVATE bool canConvertCurrentSelectionToControl_Lock(std::u16string_view rIdent); /// enables or disables all conversion slots in a menu, according to the current selection
SAL_DLLPRIVATE void checkControlConversionSlotsForCurrentSelection_Lock(weld::Menu& rMenu); /// executes a control conversion slot for a given object
SAL_DLLPRIVATE bool executeControlConversionSlot_Lock(const css::uno::Reference< css::form::XFormComponent >& _rxObject, std::u16string_view rIdent); /** executes a control conversion slot for the current selection @precond canConvertCurrentSelectionToControl( <arg>_nSlotId</arg> ) must return <TRUE/>
*/
SAL_DLLPRIVATE void executeControlConversionSlot_Lock(std::u16string_view rIdent); /// checks whether the given slot id denotes a control conversion slot
SAL_DLLPRIVATE staticbool isControlConversionSlot(std::u16string_view rIdent);
/// determines whether our host document is currently read-only
SAL_DLLPRIVATE bool IsReadonlyDoc_Lock() const;
// Setting the curObject/selObject/curForm is delayed (SetSelectionDelayed). With the // following functions this can be inquired/enforced.
SAL_DLLPRIVATE inlinebool IsSelectionUpdatePending_Lock() const;
SAL_DLLPRIVATE void ForceUpdateSelection_Lock();
SAL_DLLPRIVATE css::uno::Reference< css::frame::XModel> getContextDocument_Lock() const;
SAL_DLLPRIVATE css::uno::Reference< css::form::XForm> getInternalForm_Lock(const css::uno::Reference< css::form::XForm>& _xForm) const;
SAL_DLLPRIVATE css::uno::Reference< css::sdbc::XResultSet> getInternalForm_Lock(constcss::uno::Reference< css::sdbc::XResultSet>& _xForm) const; // if the form belongs to the controller (extern) displaying a grid, the according internal form will // be displayed, _xForm else
// check if the current control of the active controller has the focus
SAL_DLLPRIVATE bool HasControlFocus_Lock() const;
/** finds and sets a default for m_xCurrentForm, if it is currently NULL
*/
SAL_DLLPRIVATE void impl_defaultCurrentForm_nothrow_Lock();
/** sets m_xCurrentForm to the provided form, and updates everything which depends on the current form
*/
SAL_DLLPRIVATE void impl_updateCurrentForm_Lock( const css::uno::Reference< css::form::XForm >& _rxNewCurForm );
/** adds or removes ourself as XEventListener at m_xActiveController
*/
SAL_DLLPRIVATE void impl_switchActiveControllerListening_Lock(constbool _bListen);
/** add an element
*/
SAL_DLLPRIVATE void impl_AddElement_nothrow(const css::uno::Reference< css::uno::XInterface>& Element);
/** remove an element
*/
SAL_DLLPRIVATE void impl_RemoveElement_nothrow_Lock(const css::uno::Reference< css::uno::XInterface>& Element);
public: /** execute the given form slot <p>Warning. Only a small set of slots implemented currently.</p> @param _nSlot the slot to execute
*/
SAL_DLLPRIVATE void ExecuteFormSlot_Lock(sal_Int32 _nSlot);
/** determines whether the current form slot is currently enabled
*/
SAL_DLLPRIVATE bool IsFormSlotEnabled( sal_Int32 _nSlot, css::form::runtime::FeatureState* _pCompleteState ) const;
// = An iterator that, emanating from an interface, looks for an object whose // = css::beans::Property-Set has a ControlSource and a BoundField property, the // = latter having a non-NULL value. If the interface itself does not meet this // = condition, it is tested whether it is a container (that is, has a // = css::container::XIndexAccess), then it is descended there and the same tried // = for each element of the container (again possibly with descent). If any // = object thereby has the required property, the part with the container test // = for that object is omitted. // =
class SearchableControlIterator final : public ::comphelper::IndexAccessIterator
{
OUString m_sCurrentValue; // the current value of the ControlSource css::beans::Property
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.