LibreOffice Module forms (master) 1
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
frm::OBoundControlModel Class Referenceabstract

#include <FormComponent.hxx>

Inheritance diagram for frm::OBoundControlModel:
[legend]
Collaboration diagram for frm::OBoundControlModel:
[legend]

Public Member Functions

const css::uno::Reference< css::beans::XPropertySet > & getField () const
 
virtual css::uno::Any SAL_CALL queryAggregation (const css::uno::Type &_rType) override
 
virtual void SAL_CALL disposing () override
 
virtual void SAL_CALL reset () override
 
virtual void SAL_CALL addResetListener (const css::uno::Reference< css::form::XResetListener > &aListener) override
 
virtual void SAL_CALL removeResetListener (const css::uno::Reference< css::form::XResetListener > &aListener) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual void SAL_CALL setParent (const css::uno::Reference< css::uno::XInterface > &Parent) override
 
virtual void SAL_CALL write (const css::uno::Reference< css::io::XObjectOutputStream > &OutStream) override
 
virtual void SAL_CALL read (const css::uno::Reference< css::io::XObjectInputStream > &InStream) override
 
virtual sal_Bool SAL_CALL commit () override
 
virtual void SAL_CALL addUpdateListener (const css::uno::Reference< css::form::XUpdateListener > &aListener) override
 
virtual void SAL_CALL removeUpdateListener (const css::uno::Reference< css::form::XUpdateListener > &aListener) override
 
virtual void SAL_CALL getFastPropertyValue (css::uno::Any &rValue, sal_Int32 nHandle) const override
 
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 setFastPropertyValue_NoBroadcast (sal_Int32 nHandle, const css::uno::Any &rValue) override
 
virtual css::uno::Any getPropertyDefaultByHandle (sal_Int32 nHandle) const override
 
virtual void SAL_CALL disposing (const css::lang::EventObject &Source) override
 
virtual void SAL_CALL propertyChange (const css::beans::PropertyChangeEvent &evt) override
 
virtual void SAL_CALL onRowSetChanged (const css::lang::EventObject &i_Event) override
 
virtual void SAL_CALL loaded (const css::lang::EventObject &aEvent) override
 
virtual void SAL_CALL unloading (const css::lang::EventObject &aEvent) override
 
virtual void SAL_CALL unloaded (const css::lang::EventObject &aEvent) override
 
virtual void SAL_CALL reloading (const css::lang::EventObject &aEvent) override
 
virtual void SAL_CALL reloaded (const css::lang::EventObject &aEvent) override
 
- Public Member Functions inherited from frm::OControlModel
virtual css::uno::Any SAL_CALL queryAggregation (const css::uno::Type &_rType) override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () override
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () override
 
virtual void SAL_CALL disposing () override
 
virtual OUString SAL_CALL getName () override
 
virtual void SAL_CALL setName (const OUString &aName) override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual OUString SAL_CALL getImplementationName () override=0
 
virtual OUString SAL_CALL getServiceName () override=0
 
virtual void SAL_CALL write (const css::uno::Reference< css::io::XObjectOutputStream > &_rxOutStream) override
 
virtual void SAL_CALL read (const css::uno::Reference< css::io::XObjectInputStream > &_rxInStream) override
 
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent () override
 
virtual void SAL_CALL setParent (const css::uno::Reference< css::uno::XInterface > &Parent) override
 
virtual void SAL_CALL disposing (const css::lang::EventObject &Source) override
 
virtual void SAL_CALL getFastPropertyValue (css::uno::Any &rValue, sal_Int32 nHandle) const override
 
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 setFastPropertyValue_NoBroadcast (sal_Int32 nHandle, const css::uno::Any &rValue) override
 
virtual css::beans::PropertyState getPropertyStateByHandle (sal_Int32 nHandle) override
 
virtual void setPropertyToDefaultByHandle (sal_Int32 nHandle) override
 
virtual css::uno::Any getPropertyDefaultByHandle (sal_Int32 nHandle) const override
 
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone () override=0
 
virtual void SAL_CALL addProperty (const OUString &Name, ::sal_Int16 Attributes, const css::uno::Any &DefaultValue) override
 
virtual void SAL_CALL removeProperty (const OUString &Name) override
 
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPropertyValues () override
 
virtual void SAL_CALL setPropertyValues (const css::uno::Sequence< css::beans::PropertyValue > &aProps) override
 
void lockInstance (LockAccess)
 
oslInterlockedCount unlockInstance (LockAccess)
 
void firePropertyChanges (const std::vector< sal_Int32 > &_rHandles, const std::vector< css::uno::Any > &_rOldValues, const std::vector< css::uno::Any > &_rNewValues, LockAccess)
 
::osl::Mutex & getInstanceMutex ()
 
- Public Member Functions inherited from cppu::OComponentHelper
 OComponentHelper (::osl::Mutex &rMutex)
 
virtual ~OComponentHelper () SAL_OVERRIDE
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) SAL_OVERRIDE
 
virtual css::uno::Any SAL_CALL queryAggregation (css::uno::Type const &rType) SAL_OVERRIDE
 
virtual void SAL_CALL acquire () SAL_NOEXCEPT SAL_OVERRIDE
 
virtual void SAL_CALL release () SAL_NOEXCEPT SAL_OVERRIDE
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () SAL_OVERRIDE=0
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () SAL_OVERRIDE
 
virtual void SAL_CALL dispose () SAL_OVERRIDE
 
virtual void SAL_CALL addEventListener (const css::uno::Reference< css::lang::XEventListener > &aListener) SAL_OVERRIDE
 
virtual void SAL_CALL removeEventListener (const css::uno::Reference< css::lang::XEventListener > &aListener) SAL_OVERRIDE
 
- Public Member Functions inherited from cppu::OWeakAggObject
 OWeakAggObject ()
 
virtual void SAL_CALL acquire () SAL_NOEXCEPT SAL_OVERRIDE
 
virtual void SAL_CALL release () SAL_NOEXCEPT SAL_OVERRIDE
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &rType) SAL_OVERRIDE
 
virtual void SAL_CALL setDelegator (const css::uno::Reference< css::uno::XInterface > &Delegator) SAL_OVERRIDE
 
virtual css::uno::Any SAL_CALL queryAggregation (const css::uno::Type &rType) SAL_OVERRIDE
 
- Public Member Functions inherited from cppu::OWeakObject
 OWeakObject ()
 
 OWeakObject (const OWeakObject &)
 
OWeakObject &SAL_CALL operator= (const OWeakObject &)
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &rType) SAL_OVERRIDE
 
virtual void SAL_CALL acquire () SAL_NOEXCEPT SAL_OVERRIDE
 
virtual void SAL_CALL release () SAL_NOEXCEPT SAL_OVERRIDE
 
virtual css::uno::Reference< css::uno::XAdapter > SAL_CALL queryAdapter () SAL_OVERRIDE
 
SAL_CALL operator css::uno::Reference< css::uno::XInterface > ()
 
- Public Member Functions inherited from cppu::ImplHelper7< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) SAL_OVERRIDE
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () SAL_OVERRIDE
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () SAL_OVERRIDE
 
virtual ::osl::Mutex & getMutex ()=0
 
virtual void describeFixedAndAggregateProperties (css::uno::Sequence< css::beans::Property > &_out_rFixedProperties, css::uno::Sequence< css::beans::Property > &_out_rAggregateProperties) const =0
 
virtual css::uno::Reference< css::beans::XMultiPropertySet > getPropertiesInterface ()=0
 
- Public Member Functions inherited from cppu::ImplHelper4< class Ifc1, class Ifc2, class Ifc3, class Ifc4 >
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) SAL_OVERRIDE
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () SAL_OVERRIDE
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () SAL_OVERRIDE
 
- Public Member Functions inherited from cppu::ImplHelper1< class Ifc1 >
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) SAL_OVERRIDE
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () SAL_OVERRIDE
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () SAL_OVERRIDE
 
- Public Member Functions inherited from cppu::ImplHelper2< class Ifc1, class Ifc2 >
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) SAL_OVERRIDE
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () SAL_OVERRIDE
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () SAL_OVERRIDE
 
- Public Member Functions inherited from comphelper::OPropertyChangeListener
 OPropertyChangeListener (::osl::Mutex &_rMutex)
 
virtual ~OPropertyChangeListener ()
 
virtual void _propertyChanged (const css::beans::PropertyChangeEvent &_rEvent)=0
 
virtual void _disposing (const css::lang::EventObject &_rSource)
 

Static Public Member Functions

static css::uno::Sequence< OUString > getSupportedServiceNames_Static ()
 
- Static Public Member Functions inherited from frm::OControlModel
static css::uno::Sequence< OUString > getSupportedServiceNames_Static ()
 

Protected Types

enum  ValueChangeInstigator {
  eDbColumnBinding ,
  eExternalBinding ,
  eOther
}
 

Protected Member Functions

sal_Int32 getValuePropertyAggHandle () const
 
const OUString & getControlSource () const
 
bool isRequired () const
 
bool isLoaded () const
 
 OBoundControlModel (const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const OUString &_rUnoControlModelTypeName, const OUString &_rDefault, const bool _bCommitable, const bool _bSupportExternalBinding, const bool _bSupportsValidation)
 
 OBoundControlModel (const OBoundControlModel *_pOriginal, const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
 
virtual ~OBoundControlModel () override
 
virtual void clonedFrom (const OControlModel *_pOriginal) override
 late ctor after cloning More...
 
void initValueProperty (const OUString &_rValuePropertyName, sal_Int32 _nValuePropertyExternalHandle)
 initializes the part of the class which is related to the control value. More...
 
void initOwnValueProperty (const OUString &i_rValuePropertyName)
 initializes the part of the class which is related to the control value. More...
 
void suspendValueListening ()
 suspends listening at the value property More...
 
void resumeValueListening ()
 resumes listening at the value property More...
 
void onValuePropertyChange (ControlModelLock &i_rControLock)
 (to be) called when the value property changed More...
 
void startAggregatePropertyListening (const OUString &_rPropertyName)
 starts listening at the aggregate, for changes in the given property More...
 
virtual css::uno::Any getDefaultForReset () const
 returns the default which should be used when resetting the control More...
 
virtual css::uno::Any translateDbColumnToControlValue ()=0
 translates a db column value into a control value. More...
 
virtual css::uno::Sequence< css::uno::Type > getSupportedBindingTypes ()
 returns the data types which the control could use to exchange data with an external value binding More...
 
virtual css::uno::Any translateExternalValueToControlValue (const css::uno::Any &_rExternalValue) const
 translates the given value, which was obtained from the current external value binding, to a value which can be used in setControlValue More...
 
virtual css::uno::Any translateControlValueToExternalValue () const
 commits the current control value to our external value binding More...
 
virtual bool commitControlValueToDbColumn (bool _bPostReset)=0
 commits the current control value to the database column we're bound to @precond we're properly bound to a database column, especially <member>m_xColumnUpdate</member> is not <NULL> More...
 
void setControlValue (const css::uno::Any &_rValue, ValueChangeInstigator _eInstigator)
 sets the given value as new current value for the control More...
 
virtual void doSetControlValue (const css::uno::Any &_rValue)
 
virtual css::uno::Any getControlValue () const
 retrieves the current value of the control More...
 
virtual void onConnectedDbColumn (const css::uno::Reference< css::uno::XInterface > &_rxForm)
 called whenever a connection to a database column has been established More...
 
virtual void onDisconnectedDbColumn ()
 called whenever a connection to a database column has been suspended More...
 
virtual void onConnectedExternalValue ()
 called whenever a connection to an external supplier of values (XValueBinding) has been established More...
 
void onConnectedValidator ()
 called whenever an external validator has been registered More...
 
void onDisconnectedValidator ()
 called whenever an external validator has been revoked More...
 
virtual bool approveDbColumnType (sal_Int32 _nColumnType)
 nFieldType is the type of the field, on which the model will be linked. More...
 
virtual css::uno::Any translateControlValueToValidatableValue () const
 retrieves the current value of the control, in a shape which can be used with our external validator. More...
 
virtual css::uno::Any getCurrentFormComponentValue () const
 retrieves the current value of the form component More...
 
void writeCommonProperties (const css::uno::Reference< css::io::XObjectOutputStream > &_rxOutStream)
 We can't write (new) common properties in this base class, as the file format doesn't allow this (unfortunately). More...
 
void readCommonProperties (const css::uno::Reference< css::io::XObjectInputStream > &_rxInStream)
 
void defaultCommonProperties ()
 
virtual void resetNoBroadcast ()
 called to reset the control to some kind of default. More...
 
virtual css::uno::Sequence< css::uno::Type > _getTypes () override
 
void impl_setField_noNotify (const css::uno::Reference< css::beans::XPropertySet > &_rxField)
 sets m_xField to the given new value, without notifying our listeners More...
 
bool hasField () const
 
sal_Int32 getFieldType () const
 
virtual void describeFixedProperties (css::uno::Sequence< css::beans::Property > &_rProps) const override
 describes the properties provided by this class, or its respective derived class More...
 
virtual void SAL_CALL setValueBinding (const css::uno::Reference< css::form::binding::XValueBinding > &_rxBinding) override
 
virtual css::uno::Reference< css::form::binding::XValueBinding > SAL_CALL getValueBinding () override
 
virtual void SAL_CALL modified (const css::lang::EventObject &_rEvent) override
 
virtual void SAL_CALL setValidator (const css::uno::Reference< css::form::validation::XValidator > &Validator) override
 
virtual css::uno::Reference< css::form::validation::XValidator > SAL_CALL getValidator () override
 
virtual void SAL_CALL validityConstraintChanged (const css::lang::EventObject &Source) override
 
virtual sal_Bool SAL_CALL isValid () override
 
virtual css::uno::Any SAL_CALL getCurrentValue () override
 
virtual void SAL_CALL addFormComponentValidityListener (const css::uno::Reference< css::form::validation::XFormComponentValidityListener > &Listener) override
 
virtual void SAL_CALL removeFormComponentValidityListener (const css::uno::Reference< css::form::validation::XFormComponentValidityListener > &Listener) override
 
virtual void _propertyChanged (const css::beans::PropertyChangeEvent &_rEvt) override
 
bool hasExternalValueBinding () const
 checks whether we currently have an external value binding in place More...
 
bool hasValidator () const
 
void transferDbValueToControl ()
 transfers the very current value of the db column we're bound to the control @precond our own mutex is locked @precond we don't have an external binding in place More...
 
void transferExternalValueToControl (ControlModelLock &_rInstanceLock)
 transfers the current value of the active external binding to the control @precond we do have an active external binding in place More...
 
void transferControlValueToExternal (ControlModelLock &_rInstanceLock)
 transfers the control value to the external binding @precond our own mutex is locked, and _rInstanceLock is the guard locking it @precond we do have an active external binding in place More...
 
void calculateExternalValueType ()
 calculates the type which is to be used to communicate with the current external binding, and stores it in m_aExternalValueType More...
 
const css::uno::Type & getExternalValueType () const
 returns the type which should be used to exchange data with our external value binding More...
 
void initFromField (const css::uno::Reference< css::sdbc::XRowSet > &_rxForm)
 initializes the control from m_xField More...
 
- Protected Member Functions inherited from frm::OControlModel
const css::uno::Reference< css::uno::XComponentContext > & getContext () const
 
 OControlModel (const css::uno::Reference< css::uno::XComponentContext > &_rFactory, const OUString &_rUnoControlModelTypeName, const OUString &rDefault=OUString(), const bool _bSetDelegator=true)
 
 OControlModel (const OControlModel *_pOriginal, const css::uno::Reference< css::uno::XComponentContext > &_rFactory, const bool _bCloneAggregate=true, const bool _bSetDelegator=true)
 
virtual ~OControlModel () override
 
virtual void clonedFrom (const OControlModel *_pOriginal)
 to be called after an OBoundControlModel (a derivee, respectively) has been cloned More...
 
virtual css::uno::Sequence< css::uno::Type > _getTypes ()
 
void readHelpTextCompatibly (const css::uno::Reference< css::io::XObjectInputStream > &_rxInStream)
 
void writeHelpTextCompatibly (const css::uno::Reference< css::io::XObjectOutputStream > &_rxOutStream)
 
void doSetDelegator ()
 
void doResetDelegator ()
 
css::uno::Sequence< OUString > getAggregateServiceNames () const
 
virtual void writeAggregate (const css::uno::Reference< css::io::XObjectOutputStream > &_rxOutStream) const
 
virtual void readAggregate (const css::uno::Reference< css::io::XObjectInputStream > &_rxInStream)
 
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo () override
 
virtual cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper () override
 
virtual void describeFixedProperties (css::uno::Sequence< css::beans::Property > &_rProps) const
 describes the properties provided by this class, or its respective derived class More...
 
virtual ::osl::Mutex & getMutex () override
 
virtual void describeFixedAndAggregateProperties (css::uno::Sequence< css::beans::Property > &_out_rFixedProperties, css::uno::Sequence< css::beans::Property > &_out_rAggregateProperties) const override
 
virtual css::uno::Reference< css::beans::XMultiPropertySet > getPropertiesInterface () override
 
virtual void describeAggregateProperties (css::uno::Sequence< css::beans::Property > &_rAggregateProps) const
 describes the properties of our aggregate More...
 
virtual void SAL_CALL disposing ()
 
- Protected Member Functions inherited from cppu::OWeakAggObject
virtual ~OWeakAggObject () SAL_OVERRIDE
 
- Protected Member Functions inherited from cppu::OWeakObject
virtual ~OWeakObject () COVERITY_NOEXCEPT_FALSE
 
void disposeWeakConnectionPoint ()
 
- Protected Member Functions inherited from cppu::ImplHelper7< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
 ~ImplHelper7 () SAL_NOEXCEPT
 
- Protected Member Functions inherited from frm::IPropertyBagHelperContext
 ~IPropertyBagHelperContext ()
 
- Protected Member Functions inherited from cppu::ImplHelper4< class Ifc1, class Ifc2, class Ifc3, class Ifc4 >
 ~ImplHelper4 () SAL_NOEXCEPT
 
- Protected Member Functions inherited from cppu::ImplHelper1< class Ifc1 >
 ~ImplHelper1 () SAL_NOEXCEPT
 
- Protected Member Functions inherited from cppu::ImplHelper2< class Ifc1, class Ifc2 >
 ~ImplHelper2 () SAL_NOEXCEPT
 
- Protected Member Functions inherited from comphelper::OPropertyChangeListener
void disposeAdapter ()
 

Protected Attributes

OUString m_aLabelServiceName
 
css::uno::Reference< css::sdbc::XRowSet > m_xCursor
 
css::uno::Reference< css::sdb::XColumnUpdate > m_xColumnUpdate
 
css::uno::Reference< css::sdb::XColumn > m_xColumn
 
- Protected Attributes inherited from frm::OControlModel
css::uno::Reference< css::uno::XComponentContext > m_xContext
 
::osl::Mutex m_aMutex
 
oslInterlockedCount m_lockCount
 
css::uno::Reference< css::uno::XInterface > m_xParent
 
PropertyBagHelper m_aPropertyBagHelper
 
OUString m_aName
 
OUString m_aTag
 
sal_Int16 m_nTabIndex
 
sal_Int16 m_nClassId
 
bool m_bNativeLook
 
bool m_bStandardTheme
 
bool m_bGenerateVbEvents
 
sal_Int16 m_nControlTypeinMSO
 
sal_uInt16 m_nObjIDinMSO
 
- Protected Attributes inherited from cppu::OWeakAggObject
css::uno::WeakReferenceHelper xDelegator
 
- Protected Attributes inherited from cppu::OWeakObject
oslInterlockedCount m_refCount
 
- Protected Attributes inherited from frm::OCloneableAggregation
css::uno::Reference< css::uno::XAggregation > m_xAggregate
 

Private Member Functions

void connectToField (const css::uno::Reference< css::sdbc::XRowSet > &_rxForm)
 
void resetField ()
 
void recheckValidity (bool _bForceNotification)
 does a new validation of the control value More...
 
void implInitAggMultiplexer ()
 initializes m_pAggPropMultiplexer More...
 
void implInitValuePropertyListening () const
 initializes listening at the value property More...
 
void doFormListening (const bool _bStart)
 adds or removes the component as load listener to/from our form, and (if necessary) as RowSetChange listener at our parent. More...
 
bool isFormListening () const
 
void impl_determineAmbientForm_nothrow ()
 determines the new value of m_xAmbientForm More...
 
void impl_connectDatabaseColumn_noNotify (bool _bFromReload)
 connects to a value supplier which is a database column. More...
 
void impl_disconnectDatabaseColumn_noNotify ()
 disconnects from a value supplier which is a database column More...
 
void connectExternalValueBinding (const css::uno::Reference< css::form::binding::XValueBinding > &_rxBinding, ControlModelLock &_rInstanceLock)
 connects to an external value binding More...
 
void disconnectExternalValueBinding ()
 disconnects from an external value binding More...
 
void connectValidator (const css::uno::Reference< css::form::validation::XValidator > &_rxValidator)
 connects the component to an external validator More...
 
void disconnectValidator ()
 disconnects the component from its current an external validator More...
 
bool impl_approveValueBinding_nolock (const css::uno::Reference< css::form::binding::XValueBinding > &_rxBinding)
 called from within <member scope="css:::form::binding">XBindableValue::setValueBinding</member> to approve the new binding More...
 

Private Attributes

css::uno::Reference< css::beans::XPropertySetm_xField
 
css::uno::Reference< css::form::XLoadable > m_xAmbientForm
 
OUString m_sValuePropertyName
 
sal_Int32 m_nValuePropertyAggregateHandle
 
sal_Int32 m_nFieldType
 
css::uno::Type m_aValuePropertyType
 
bool m_bValuePropertyMayBeVoid
 
ResetHelper m_aResetHelper
 
::comphelper::OInterfaceContainerHelper3< css::form::XUpdateListener > m_aUpdateListeners
 
::comphelper::OInterfaceContainerHelper3< css::form::validation::XFormComponentValidityListener > m_aFormComponentListeners
 
css::uno::Reference< css::form::binding::XValueBinding > m_xExternalBinding
 
css::uno::Reference< css::form::validation::XValidator > m_xValidator
 
css::uno::Type m_aExternalValueType
 
OUString m_aControlSource
 
css::uno::Reference< css::beans::XPropertySetm_xLabelControl
 
bool m_bInputRequired
 
rtl::Reference<::comphelper::OPropertyChangeMultiplexerm_pAggPropMultiplexer
 
bool m_bFormListening: 1
 
bool m_bLoaded: 1
 
bool m_bRequired: 1
 
const bool m_bCommitable: 1
 
const bool m_bSupportsExternalBinding: 1
 
const bool m_bSupportsValidation: 1
 
bool m_bForwardValueChanges: 1
 
bool m_bTransferringValue: 1
 
bool m_bIsCurrentValueValid: 1
 
bool m_bBindingControlsRO: 1
 
bool m_bBindingControlsEnable: 1
 
ValueChangeInstigator m_eControlValueChangeInstigator
 

Additional Inherited Members

- Static Protected Member Functions inherited from frm::OCloneableAggregation
static css::uno::Reference< css::uno::XAggregation > createAggregateClone (const OCloneableAggregation *_pOriginal)
 

Detailed Description

Definition at line 512 of file FormComponent.hxx.

Member Enumeration Documentation

◆ ValueChangeInstigator

Enumerator
eDbColumnBinding 
eExternalBinding 
eOther 

Definition at line 520 of file FormComponent.hxx.

Constructor & Destructor Documentation

◆ OBoundControlModel() [1/2]

frm::OBoundControlModel::OBoundControlModel ( const css::uno::Reference< css::uno::XComponentContext > &  _rxContext,
const OUString &  _rUnoControlModelTypeName,
const OUString &  _rDefault,
const bool  _bCommitable,
const bool  _bSupportExternalBinding,
const bool  _bSupportsValidation 
)
protected

◆ OBoundControlModel() [2/2]

frm::OBoundControlModel::OBoundControlModel ( const OBoundControlModel _pOriginal,
const css::uno::Reference< css::uno::XComponentContext > &  _rxContext 
)
protected

◆ ~OBoundControlModel()

frm::OBoundControlModel::~OBoundControlModel ( )
overrideprotectedvirtual

Member Function Documentation

◆ _getTypes()

Sequence< Type > frm::OBoundControlModel::_getTypes ( )
overrideprotectedvirtual

◆ _propertyChanged()

void frm::OBoundControlModel::_propertyChanged ( const css::beans::PropertyChangeEvent &  _rEvt)
overrideprotectedvirtual

◆ addFormComponentValidityListener()

void SAL_CALL frm::OBoundControlModel::addFormComponentValidityListener ( const css::uno::Reference< css::form::validation::XFormComponentValidityListener > &  Listener)
overrideprotectedvirtual

◆ addResetListener()

void frm::OBoundControlModel::addResetListener ( const css::uno::Reference< css::form::XResetListener > &  aListener)
overridevirtual

Definition at line 2227 of file FormComponent.cxx.

References frm::ResetHelper::addResetListener(), and m_aResetHelper.

◆ addUpdateListener()

void SAL_CALL frm::OBoundControlModel::addUpdateListener ( const css::uno::Reference< css::form::XUpdateListener > &  aListener)
overridevirtual

◆ approveDbColumnType()

bool frm::OBoundControlModel::approveDbColumnType ( sal_Int32  _nColumnType)
protectedvirtual

nFieldType is the type of the field, on which the model will be linked.

The linking happens when sal_True is returned. The default-implementation allows everything but the three binary types and FieldType_OTHER.

Reimplemented in frm::OEditModel, and frm::OImageControlModel.

Definition at line 2008 of file FormComponent.cxx.

References hasExternalValueBinding().

Referenced by connectToField().

◆ calculateExternalValueType()

void frm::OBoundControlModel::calculateExternalValueType ( )
protected

calculates the type which is to be used to communicate with the current external binding, and stores it in m_aExternalValueType

The method checks the possible type candidates as returned by getSupportedBindingTypes, and the types supported by the current external binding, if any.

Definition at line 2592 of file FormComponent.cxx.

References getSupportedBindingTypes(), m_aExternalValueType, and m_xExternalBinding.

Referenced by frm::OFormattedModel::_propertyChanged(), and onConnectedExternalValue().

◆ clonedFrom()

void frm::OBoundControlModel::clonedFrom ( const OControlModel _pOriginal)
overrideprotectedvirtual

late ctor after cloning

Reimplemented from frm::OControlModel.

Definition at line 1233 of file FormComponent.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, m_xExternalBinding, and setValueBinding().

◆ commit()

sal_Bool SAL_CALL frm::OBoundControlModel::commit ( )
overridevirtual

◆ commitControlValueToDbColumn()

virtual bool frm::OBoundControlModel::commitControlValueToDbColumn ( bool  _bPostReset)
protectedpure virtual

commits the current control value to the database column we're bound to @precond we're properly bound to a database column, especially <member>m_xColumnUpdate</member> is not <NULL>

Parameters
_bPostReset<TRUE> if and only if the current control value results from a reset (<member>getDefaultForReset</member>)

Implemented in frm::OCheckBoxModel, frm::OComboBoxModel, frm::OCurrencyModel, frm::ODateModel, frm::OEditModel, frm::OFormattedModel, frm::OImageControlModel, frm::OListBoxModel, frm::ONumericModel, frm::OPatternModel, frm::ORadioButtonModel, frm::OScrollBarModel, frm::OSpinButtonModel, and frm::OTimeModel.

Referenced by commit(), onValuePropertyChange(), and reset().

◆ connectExternalValueBinding()

void frm::OBoundControlModel::connectExternalValueBinding ( const css::uno::Reference< css::form::binding::XValueBinding > &  _rxBinding,
ControlModelLock _rInstanceLock 
)
private

connects to an external value binding

Note that by definition, external data bindings supersede the SQL data binding which is defined by our RowSet-column-related properties. This means that in case we're currently connected to a database column when this is called, this connection is suspended.

@precond the new external binding has already been approved (see <member>impl_approveValueBinding_nolock</member>) @precond there currently is no external binding in place

Definition at line 2379 of file FormComponent.cxx.

References DBG_UNHANDLED_EXCEPTION, doFormListening(), Exception, hasExternalValueBinding(), hasField(), impl_disconnectDatabaseColumn_noNotify(), isFormListening(), m_bBindingControlsEnable, m_bBindingControlsRO, m_bSupportsValidation, m_xExternalBinding, onConnectedExternalValue(), PROPERTY_READONLY, PROPERTY_RELEVANT, setValidator(), and transferExternalValueToControl().

Referenced by setValueBinding().

◆ connectToField()

void frm::OBoundControlModel::connectToField ( const css::uno::Reference< css::sdbc::XRowSet > &  _rxForm)
private

◆ connectValidator()

void frm::OBoundControlModel::connectValidator ( const css::uno::Reference< css::form::validation::XValidator > &  _rxValidator)
private

connects the component to an external validator

@precond there currently is no active validator @precond our mutex is currently locked exactly once

Definition at line 2654 of file FormComponent.cxx.

References hasValidator(), m_xValidator, and onConnectedValidator().

Referenced by setValidator().

◆ convertFastPropertyValue()

sal_Bool frm::OBoundControlModel::convertFastPropertyValue ( css::uno::Any &  _rConvertedValue,
css::uno::Any &  _rOldValue,
sal_Int32  _nHandle,
const css::uno::Any &  _rValue 
)
overridevirtual

◆ defaultCommonProperties()

void frm::OBoundControlModel::defaultCommonProperties ( )
protected

◆ describeFixedProperties()

void frm::OBoundControlModel::describeFixedProperties ( css::uno::Sequence< css::beans::Property > &  _rProps) const
overrideprotectedvirtual

◆ disconnectExternalValueBinding()

void frm::OBoundControlModel::disconnectExternalValueBinding ( )
private

disconnects from an external value binding

@precond there currently is an external binding in place

Definition at line 2448 of file FormComponent.cxx.

References disconnectValidator(), doFormListening(), Exception, impl_connectDatabaseColumn_noNotify(), m_bBindingControlsEnable, m_bBindingControlsRO, m_xAmbientForm, m_xExternalBinding, m_xValidator, PROPERTY_READONLY, PROPERTY_RELEVANT, and TOOLS_WARN_EXCEPTION.

Referenced by disposing(), and setValueBinding().

◆ disconnectValidator()

void frm::OBoundControlModel::disconnectValidator ( )
private

disconnects the component from its current an external validator

@precond there currently is an active validator @precond our mutex is currently locked exactly once

Definition at line 2675 of file FormComponent.cxx.

References hasValidator(), m_xValidator, and onDisconnectedValidator().

Referenced by disconnectExternalValueBinding(), disposing(), and setValidator().

◆ disposing() [1/2]

void frm::OBoundControlModel::disposing ( )
overridevirtual

◆ disposing() [2/2]

void SAL_CALL frm::OBoundControlModel::disposing ( const css::lang::EventObject &  Source)
overridevirtual

◆ doFormListening()

void frm::OBoundControlModel::doFormListening ( const bool  _bStart)
private

adds or removes the component as load listener to/from our form, and (if necessary) as RowSetChange listener at our parent.

@precond there must no external value binding be in place

Definition at line 1434 of file FormComponent.cxx.

References frm::OControlModel::getParent(), hasExternalValueBinding(), isFormListening(), m_bFormListening, and m_xAmbientForm.

Referenced by connectExternalValueBinding(), disconnectExternalValueBinding(), onRowSetChanged(), and setParent().

◆ doSetControlValue()

void frm::OBoundControlModel::doSetControlValue ( const css::uno::Any &  _rValue)
protectedvirtual

The default implementation will forward the given value to the aggregate, using m_nValuePropertyAggregateHandle and/or m_sValuePropertyName.

@precond Our own mutex is locked.

Parameters
_rValueThe value to set. This value is guaranteed to be created by <member>translateDbColumnToControlValue</member> or <member>translateExternalValueToControlValue</member>

Reimplemented in frm::OImageControlModel.

Definition at line 2130 of file FormComponent.cxx.

References Exception, frm::OControlModel::m_aMutex, m_nValuePropertyAggregateHandle, m_sValuePropertyName, and TOOLS_WARN_EXCEPTION.

Referenced by setControlValue().

◆ getControlSource()

const OUString & frm::OBoundControlModel::getControlSource ( ) const
inlineprotected

◆ getControlValue()

Any frm::OBoundControlModel::getControlValue ( ) const
protectedvirtual

◆ getCurrentFormComponentValue()

css::uno::Any frm::OBoundControlModel::getCurrentFormComponentValue ( ) const
protectedvirtual

retrieves the current value of the form component

This is the implementation method for XValidatableFormComponent::getCurrentValue. The default implementation calls translateControlValueToValidatableValue if a validator is present, otherwise getControlValue.

@precond our mutex is locked when this method is called

Reimplemented in frm::OListBoxModel.

Definition at line 2748 of file FormComponent.cxx.

References getControlValue(), hasValidator(), and translateControlValueToValidatableValue().

Referenced by getCurrentValue().

◆ getCurrentValue()

Any SAL_CALL frm::OBoundControlModel::getCurrentValue ( )
overrideprotectedvirtual

◆ getDefaultForReset()

Any frm::OBoundControlModel::getDefaultForReset ( ) const
protectedvirtual

returns the default which should be used when resetting the control

The default implementation returns an empty Any.

See also
resetNoBroadcast

Reimplemented in frm::OComboBoxModel, frm::OCurrencyModel, frm::ODateModel, frm::OEditModel, frm::OFormattedModel, frm::OListBoxModel, frm::ONumericModel, frm::OPatternModel, frm::OReferenceValueComponent, frm::OScrollBarModel, frm::OSpinButtonModel, and frm::OTimeModel.

Definition at line 2217 of file FormComponent.cxx.

References Any.

Referenced by resetNoBroadcast().

◆ getExternalValueType()

const css::uno::Type & frm::OBoundControlModel::getExternalValueType ( ) const
inlineprotected

◆ getFastPropertyValue()

void frm::OBoundControlModel::getFastPropertyValue ( css::uno::Any &  rValue,
sal_Int32  nHandle 
) const
overridevirtual

◆ getField()

const css::uno::Reference< css::beans::XPropertySet > & frm::OBoundControlModel::getField ( ) const
inline

◆ getFieldType()

sal_Int32 frm::OBoundControlModel::getFieldType ( ) const
inlineprotected

◆ getPropertyDefaultByHandle()

Any frm::OBoundControlModel::getPropertyDefaultByHandle ( sal_Int32  nHandle) const
overridevirtual

◆ getSupportedBindingTypes()

Sequence< Type > frm::OBoundControlModel::getSupportedBindingTypes ( )
protectedvirtual

returns the data types which the control could use to exchange data with an external value binding

The types returned here are completely independent from the concrete value binding, they're just candidates which depend on the control type, and possible the concrete state of the control (i.e. some property value).

If a control implementation supports multiple types, the ordering in the returned sequence indicates preference: Preferred types are mentioned first.

The default implementation returns the type of our value property.

Reimplemented in frm::ODateModel, frm::OFormattedModel, frm::OListBoxModel, frm::OReferenceValueComponent, frm::OScrollBarModel, frm::OSpinButtonModel, and frm::OTimeModel.

Definition at line 2587 of file FormComponent.cxx.

References m_aValuePropertyType.

Referenced by calculateExternalValueType(), and impl_approveValueBinding_nolock().

◆ getSupportedServiceNames()

css::uno::Sequence< OUString > SAL_CALL frm::OBoundControlModel::getSupportedServiceNames ( )
overridevirtual

◆ getSupportedServiceNames_Static()

Sequence< OUString > frm::OBoundControlModel::getSupportedServiceNames_Static ( )
static
Exceptions
css::uno::RuntimeException

Definition at line 1523 of file FormComponent.cxx.

References frm::OControlModel::getSupportedServiceNames_Static().

Referenced by getSupportedServiceNames().

◆ getValidator()

Reference< XValidator > SAL_CALL frm::OBoundControlModel::getValidator ( )
overrideprotectedvirtual

◆ getValueBinding()

Reference< XValueBinding > SAL_CALL frm::OBoundControlModel::getValueBinding ( )
overrideprotectedvirtual

◆ getValuePropertyAggHandle()

sal_Int32 frm::OBoundControlModel::getValuePropertyAggHandle ( ) const
inlineprotected

◆ hasExternalValueBinding()

bool frm::OBoundControlModel::hasExternalValueBinding ( ) const
inlineprotected

◆ hasField()

bool frm::OBoundControlModel::hasField ( ) const
inlineprotected

◆ hasValidator()

bool frm::OBoundControlModel::hasValidator ( ) const
inlineprotected

◆ impl_approveValueBinding_nolock()

bool frm::OBoundControlModel::impl_approveValueBinding_nolock ( const css::uno::Reference< css::form::binding::XValueBinding > &  _rxBinding)
private

called from within <member scope="css:::form::binding">XBindableValue::setValueBinding</member> to approve the new binding

The default implementation approves the binding if and only if it is not <NULL>, and supports the type returned by getExternalValueType.

Parameters
_rxBindingthe binding which applies for being responsible for our value, Must not be <NULL>
Returns
<TRUE> if and only if the given binding can supply values in the proper type

@seealso getExternalValueType

Definition at line 2359 of file FormComponent.cxx.

References getSupportedBindingTypes(), frm::OControlModel::m_aMutex, and type.

Referenced by setValueBinding().

◆ impl_connectDatabaseColumn_noNotify()

void frm::OBoundControlModel::impl_connectDatabaseColumn_noNotify ( bool  _bFromReload)
private

connects to a value supplier which is a database column.

The column is taken from our parent, which must be a database form respectively row set.

@precond The control does not have an external value supplier

Parameters
_bFromReloadDetermines whether the connection is made after the row set has been loaded (<FALSE>) or reloaded (<TRUE>)
See also
impl_disconnectDatabaseColumn_noNotify

Definition at line 2033 of file FormComponent.cxx.

References connectToField(), DBG_ASSERT, hasExternalValueBinding(), hasField(), initFromField(), m_bForwardValueChanges, m_bLoaded, m_xAmbientForm, and onConnectedDbColumn().

Referenced by disconnectExternalValueBinding(), loaded(), onRowSetChanged(), reloaded(), and setParent().

◆ impl_determineAmbientForm_nothrow()

void frm::OBoundControlModel::impl_determineAmbientForm_nothrow ( )
private

determines the new value of m_xAmbientForm

Definition at line 2021 of file FormComponent.cxx.

References frm::OControlModel::getParent(), and m_xAmbientForm.

Referenced by onRowSetChanged(), and setParent().

◆ impl_disconnectDatabaseColumn_noNotify()

void frm::OBoundControlModel::impl_disconnectDatabaseColumn_noNotify ( )
private

disconnects from a value supplier which is a database column

@precond The control does not have an external value supplier

See also
impl_connectDatabaseColumn_noNotify

Definition at line 2061 of file FormComponent.cxx.

References getField(), hasExternalValueBinding(), hasField(), m_bLoaded, m_xCursor, onDisconnectedDbColumn(), PROPERTY_VALUE, and resetField().

Referenced by connectExternalValueBinding(), onRowSetChanged(), setParent(), and unloading().

◆ impl_setField_noNotify()

void frm::OBoundControlModel::impl_setField_noNotify ( const css::uno::Reference< css::beans::XPropertySet > &  _rxField)
protected

sets m_xField to the given new value, without notifying our listeners

Definition at line 2353 of file FormComponent.cxx.

References DBG_ASSERT, hasExternalValueBinding(), and m_xField.

Referenced by connectToField().

◆ implInitAggMultiplexer()

void frm::OBoundControlModel::implInitAggMultiplexer ( )
private

◆ implInitValuePropertyListening()

void frm::OBoundControlModel::implInitValuePropertyListening ( ) const
private

initializes listening at the value property

Definition at line 1264 of file FormComponent.cxx.

References m_bCommitable, m_bSupportsExternalBinding, m_bSupportsValidation, m_pAggPropMultiplexer, and m_sValuePropertyName.

Referenced by initValueProperty().

◆ initFromField()

void frm::OBoundControlModel::initFromField ( const css::uno::Reference< css::sdbc::XRowSet > &  _rxForm)
protected

initializes the control from m_xField

Basically, this method calls transferDbValueToControl - but only if our cursor is positioned on a valid row. Otherwise, the control is reset.

@precond m_xField is not <NULL>

Definition at line 1984 of file FormComponent.cxx.

References hasField(), resetNoBroadcast(), and transferDbValueToControl().

Referenced by impl_connectDatabaseColumn_noNotify(), and frm::OListBoxModel::refreshInternalEntryList().

◆ initOwnValueProperty()

void frm::OBoundControlModel::initOwnValueProperty ( const OUString &  i_rValuePropertyName)
protected

initializes the part of the class which is related to the control value.

In opposite to ->initValueProperty, this method is to be used for value properties which are not implemented by our aggregate, but by ourselves.

Certain functionality is not available when using own value properties. This includes binding to an external value and external validation. (This is not a conceptual limit, but simply missing implementation.)

Definition at line 1282 of file FormComponent.cxx.

References m_nValuePropertyAggregateHandle, and m_sValuePropertyName.

◆ initValueProperty()

void frm::OBoundControlModel::initValueProperty ( const OUString &  _rValuePropertyName,
sal_Int32  _nValuePropertyExternalHandle 
)
protected

initializes the part of the class which is related to the control value.

Kind of late ctor, to be called for derivees which have a dedicated value property.
The value property is the property which's value is synced with either the database column the object is bound to, or with the external value binding, if present.
E.g. for a text control model, this property will most probably be "Text".

Derived classes are strongly recommended to call this method - at least the "DataFieldProperty" (exposed in getFastPropertyValue) relies on the information given herein, and needs to be supplied otherwise else.

If this method has been called properly, then <member>setControlValue</member> does not need to be overridden - it will simply set the property value at the aggregate then.

@precond The method has not be called before during the life time of the object.

Parameters
_rValuePropertyNamethe name of the value property
_nValuePropertyExternalHandlethe handle of the property, as exposed to external components.
Normally, this information can be obtained dynamically (e.g. from describeFixedProperties), but since this method is to be called from within the constructor of derived classes, we prefer to be on the really safe side here...
See also
setControlValue
suspendValueListening
resumeValueListening
describeFixedProperties

Definition at line 1290 of file FormComponent.cxx.

References implInitValuePropertyListening(), m_aValuePropertyType, m_bValuePropertyMayBeVoid, m_nValuePropertyAggregateHandle, m_sValuePropertyName, and Property.

◆ isFormListening()

bool frm::OBoundControlModel::isFormListening ( ) const
inlineprivate

◆ isLoaded()

bool frm::OBoundControlModel::isLoaded ( ) const
inlineprotected

Definition at line 595 of file FormComponent.hxx.

References m_bLoaded.

Referenced by frm::OFormattedModel::write().

◆ isRequired()

bool frm::OBoundControlModel::isRequired ( ) const
inlineprotected

◆ isValid()

sal_Bool SAL_CALL frm::OBoundControlModel::isValid ( )
overrideprotectedvirtual

Definition at line 2743 of file FormComponent.cxx.

References m_bIsCurrentValueValid.

◆ loaded()

void SAL_CALL frm::OBoundControlModel::loaded ( const css::lang::EventObject &  aEvent)
overridevirtual

◆ modified()

void SAL_CALL frm::OBoundControlModel::modified ( const css::lang::EventObject &  _rEvent)
overrideprotectedvirtual

◆ onConnectedDbColumn()

void frm::OBoundControlModel::onConnectedDbColumn ( const css::uno::Reference< css::uno::XInterface > &  _rxForm)
protectedvirtual

◆ onConnectedExternalValue()

void frm::OBoundControlModel::onConnectedExternalValue ( )
protectedvirtual

called whenever a connection to an external supplier of values (XValueBinding) has been established

See also
m_xExternalBinding

Reimplemented in frm::OFormattedModel.

Definition at line 2201 of file FormComponent.cxx.

References calculateExternalValueType().

Referenced by connectExternalValueBinding(), and frm::OFormattedModel::onConnectedExternalValue().

◆ onConnectedValidator()

void frm::OBoundControlModel::onConnectedValidator ( )
protected

called whenever an external validator has been registered

Definition at line 2160 of file FormComponent.cxx.

References Any, Exception, PROPERTY_ENFORCE_FORMAT, recheckValidity(), and TOOLS_WARN_EXCEPTION.

Referenced by connectValidator().

◆ onDisconnectedDbColumn()

void frm::OBoundControlModel::onDisconnectedDbColumn ( )
protectedvirtual

◆ onDisconnectedValidator()

void frm::OBoundControlModel::onDisconnectedValidator ( )
protected

called whenever an external validator has been revoked

Definition at line 2182 of file FormComponent.cxx.

References Any, Exception, PROPERTY_ENFORCE_FORMAT, recheckValidity(), and TOOLS_WARN_EXCEPTION.

Referenced by disconnectValidator().

◆ onRowSetChanged()

void SAL_CALL frm::OBoundControlModel::onRowSetChanged ( const css::lang::EventObject &  i_Event)
overridevirtual

◆ onValuePropertyChange()

void frm::OBoundControlModel::onValuePropertyChange ( ControlModelLock i_rControLock)
protected

(to be) called when the value property changed

Normally, this is done automatically, since the value property is a property of our aggregate, and we're a listener at this property. However, in some cases the value property might not be an aggregate property, but a property of the delegator instance. In this case, you'll need to call onValuePropertyChange whenever this property changes.

Definition at line 1386 of file FormComponent.cxx.

References commitControlValueToDbColumn(), eDbColumnBinding, eExternalBinding, hasExternalValueBinding(), m_bCommitable, m_bSupportsValidation, m_eControlValueChangeInstigator, m_xColumnUpdate, recheckValidity(), and transferControlValueToExternal().

Referenced by _propertyChanged(), and frm::OImageControlModel::setFastPropertyValue_NoBroadcast().

◆ propertyChange()

void SAL_CALL frm::OBoundControlModel::propertyChange ( const css::beans::PropertyChangeEvent &  evt)
overridevirtual

◆ queryAggregation()

Any SAL_CALL frm::OBoundControlModel::queryAggregation ( const css::uno::Type &  _rType)
overridevirtual

◆ read()

void SAL_CALL frm::OBoundControlModel::read ( const css::uno::Reference< css::io::XObjectInputStream > &  InStream)
overridevirtual

◆ readCommonProperties()

void frm::OBoundControlModel::readCommonProperties ( const css::uno::Reference< css::io::XObjectInputStream > &  _rxInStream)
protected

◆ recheckValidity()

void frm::OBoundControlModel::recheckValidity ( bool  _bForceNotification)
private

does a new validation of the control value

If necessary, our <member>m_bIsCurrentValueValid</member> member will be adjusted, and changes will be notified.

Note that it's not necessary that we're connected to a validator. If we are not, it's assumed that our value is valid, and this is handled appropriately.

Use this method if there is a potential that only the validity flag changed. If any of the other aspects (our current value, or our current text) changed, then pass <TRUE> for <member>_bForceNotification</member>.

Parameters
_bForceNotificationif <TRUE>, then the validity listeners will be notified, not matter whether the validity changed.

Definition at line 2773 of file FormComponent.cxx.

References Exception, hasValidator(), m_aFormComponentListeners, frm::OControlModel::m_aMutex, m_bIsCurrentValueValid, m_xValidator, comphelper::OInterfaceContainerHelper3< class ListenerT >::notifyEach(), TOOLS_WARN_EXCEPTION, and translateControlValueToValidatableValue().

Referenced by onConnectedValidator(), onDisconnectedValidator(), onValuePropertyChange(), reset(), and validityConstraintChanged().

◆ reloaded()

void SAL_CALL frm::OBoundControlModel::reloaded ( const css::lang::EventObject &  aEvent)
overridevirtual

◆ reloading()

void SAL_CALL frm::OBoundControlModel::reloading ( const css::lang::EventObject &  aEvent)
overridevirtual

◆ removeFormComponentValidityListener()

void SAL_CALL frm::OBoundControlModel::removeFormComponentValidityListener ( const css::uno::Reference< css::form::validation::XFormComponentValidityListener > &  Listener)
overrideprotectedvirtual

◆ removeResetListener()

void frm::OBoundControlModel::removeResetListener ( const css::uno::Reference< css::form::XResetListener > &  aListener)
overridevirtual

Definition at line 2232 of file FormComponent.cxx.

References m_aResetHelper, and frm::ResetHelper::removeResetListener().

◆ removeUpdateListener()

void SAL_CALL frm::OBoundControlModel::removeUpdateListener ( const css::uno::Reference< css::form::XUpdateListener > &  aListener)
overridevirtual

◆ reset()

void frm::OBoundControlModel::reset ( )
overridevirtual

◆ resetField()

void frm::OBoundControlModel::resetField ( )
private

◆ resetNoBroadcast()

void frm::OBoundControlModel::resetNoBroadcast ( )
protectedvirtual

called to reset the control to some kind of default.

The semantics of "default" is finally defined by the derived class (in particular, by <member>getDefaultForReset</member>).

No listener notification needs to be done in the derived class.

Normally, you won't override this method, but <member>getDefaultForReset</member> instead.

See also
getDefaultForReset

Reimplemented in frm::OComboBoxModel, frm::OCurrencyModel, frm::ODateModel, frm::OFormattedModel, frm::OImageControlModel, frm::OListBoxModel, frm::ONumericModel, frm::OPatternModel, and frm::OTimeModel.

Definition at line 2222 of file FormComponent.cxx.

References eOther, getDefaultForReset(), and setControlValue().

Referenced by initFromField(), frm::OCheckBoxModel::read(), frm::ORadioButtonModel::read(), reset(), frm::OComboBoxModel::resetNoBroadcast(), frm::OCurrencyModel::resetNoBroadcast(), frm::ODateModel::resetNoBroadcast(), frm::OFormattedModel::resetNoBroadcast(), frm::OImageControlModel::resetNoBroadcast(), frm::OListBoxModel::resetNoBroadcast(), frm::ONumericModel::resetNoBroadcast(), frm::OPatternModel::resetNoBroadcast(), and frm::OTimeModel::resetNoBroadcast().

◆ resumeValueListening()

void frm::OBoundControlModel::resumeValueListening ( )
protected

resumes listening at the value property

As long as this listening is suspended, changes in the value property will not be recognized and not be handled.

@precond listening at the value property is currently suspended

See also
initValueProperty
resumeValueListening

Definition at line 1322 of file FormComponent.cxx.

References m_pAggPropMultiplexer, and m_sValuePropertyName.

Referenced by frm::OListBoxModel::stringItemListChanged().

◆ setControlValue()

void frm::OBoundControlModel::setControlValue ( const css::uno::Any &  _rValue,
ValueChangeInstigator  _eInstigator 
)
protected

sets the given value as new current value for the control

Besides some administrative work (such as caring for <member>m_eControlValueChangeInstigator</member>), this method simply calls <member>doSetControlValue</member>.

@precond Our own mutex is locked.

Parameters
_rValueThe value to set. This value is guaranteed to be created by <member>translateDbColumnToControlValue</member> or <member>translateExternalValueToControlValue</member>
_eInstigatorthe instigator of the value change

Definition at line 2123 of file FormComponent.cxx.

References doSetControlValue(), eOther, and m_eControlValueChangeInstigator.

Referenced by frm::OFormattedModel::_propertyChanged(), frm::OImageControlModel::impl_handleNewImageURL_lck(), frm::OImageControlModel::impl_updateStreamForURL_lck(), resetNoBroadcast(), frm::OListBoxModel::setFastPropertyValue_NoBroadcast(), frm::OListBoxModel::stringItemListChanged(), transferDbValueToControl(), and transferExternalValueToControl().

◆ setFastPropertyValue_NoBroadcast()

void frm::OBoundControlModel::setFastPropertyValue_NoBroadcast ( sal_Int32  nHandle,
const css::uno::Any &  rValue 
)
overridevirtual

◆ setParent()

void SAL_CALL frm::OBoundControlModel::setParent ( const css::uno::Reference< css::uno::XInterface > &  Parent)
overridevirtual

◆ setValidator()

void SAL_CALL frm::OBoundControlModel::setValidator ( const css::uno::Reference< css::form::validation::XValidator > &  Validator)
overrideprotectedvirtual

◆ setValueBinding()

void SAL_CALL frm::OBoundControlModel::setValueBinding ( const css::uno::Reference< css::form::binding::XValueBinding > &  _rxBinding)
overrideprotectedvirtual

◆ startAggregatePropertyListening()

void frm::OBoundControlModel::startAggregatePropertyListening ( const OUString &  _rPropertyName)
protected

starts listening at the aggregate, for changes in the given property

The OBoundControlModel automatically registers a multiplexer which listens for changes in the aggregate property values. By default, only the control value property is observed. You may add additional properties to be observed with this method.

See also
initValueProperty
_propertyChanged

Definition at line 1424 of file FormComponent.cxx.

References m_pAggPropMultiplexer.

Referenced by frm::OFormattedModel::implConstruct(), and frm::OListBoxModel::init().

◆ suspendValueListening()

void frm::OBoundControlModel::suspendValueListening ( )
protected

suspends listening at the value property

As long as this listening is suspended, changes in the value property will not be recognized and not be handled.

See also
initValueProperty
resumeValueListening

Definition at line 1313 of file FormComponent.cxx.

References m_pAggPropMultiplexer, and m_sValuePropertyName.

Referenced by frm::OListBoxModel::stringItemListChanged().

◆ transferControlValueToExternal()

void frm::OBoundControlModel::transferControlValueToExternal ( ControlModelLock _rInstanceLock)
protected

transfers the control value to the external binding @precond our own mutex is locked, and _rInstanceLock is the guard locking it @precond we do have an active external binding in place

Definition at line 2561 of file FormComponent.cxx.

References frm::ControlModelLock::acquire(), Any, DBG_UNHANDLED_EXCEPTION, Exception, hasExternalValueBinding(), m_bSupportsExternalBinding, m_bTransferringValue, m_xExternalBinding, frm::ControlModelLock::release(), and translateControlValueToExternalValue().

Referenced by commit(), onValuePropertyChange(), and reset().

◆ transferDbValueToControl()

void frm::OBoundControlModel::transferDbValueToControl ( )
protected

transfers the very current value of the db column we're bound to the control @precond our own mutex is locked @precond we don't have an external binding in place

Definition at line 2527 of file FormComponent.cxx.

References DBG_UNHANDLED_EXCEPTION, eDbColumnBinding, Exception, setControlValue(), and translateDbColumnToControlValue().

Referenced by initFromField(), propertyChange(), and reset().

◆ transferExternalValueToControl()

void frm::OBoundControlModel::transferExternalValueToControl ( ControlModelLock _rInstanceLock)
protected

transfers the current value of the active external binding to the control @precond we do have an active external binding in place

Definition at line 2540 of file FormComponent.cxx.

References frm::ControlModelLock::acquire(), Any, DBG_UNHANDLED_EXCEPTION, eExternalBinding, Exception, getExternalValueType(), m_xExternalBinding, frm::ControlModelLock::release(), setControlValue(), and translateExternalValueToControlValue().

Referenced by connectExternalValueBinding(), modified(), and frm::OListBoxModel::stringItemListChanged().

◆ translateControlValueToExternalValue()

Any frm::OBoundControlModel::translateControlValueToExternalValue ( ) const
protectedvirtual

commits the current control value to our external value binding

The default implementation simply calls getControlValue.

See also
hasExternalValueBinding
initValueProperty

Reimplemented in frm::ODateModel, frm::OFormattedModel, frm::OListBoxModel, frm::OReferenceValueComponent, frm::OScrollBarModel, frm::OSpinButtonModel, and frm::OTimeModel.

Definition at line 2621 of file FormComponent.cxx.

References Any, and getControlValue().

Referenced by transferControlValueToExternal(), and translateControlValueToValidatableValue().

◆ translateControlValueToValidatableValue()

Any frm::OBoundControlModel::translateControlValueToValidatableValue ( ) const
protectedvirtual

retrieves the current value of the control, in a shape which can be used with our external validator.

The default implementation simply calls <member>>translateControlValueToExternalValue</member>.

@precond Our own mutex is locked.

Reimplemented in frm::ODateModel, frm::OListBoxModel, frm::OReferenceValueComponent, and frm::OTimeModel.

Definition at line 2626 of file FormComponent.cxx.

References Any, getControlValue(), m_xExternalBinding, m_xValidator, and translateControlValueToExternalValue().

Referenced by getCurrentFormComponentValue(), and recheckValidity().

◆ translateDbColumnToControlValue()

virtual css::uno::Any frm::OBoundControlModel::translateDbColumnToControlValue ( )
protectedpure virtual

translates a db column value into a control value.

Must transform the very current value of the database column we're bound to (<member>m_xColumn</member>) into a value which can be used as current value for the control.

See also
setControlValue

Implemented in frm::OCheckBoxModel, frm::OComboBoxModel, frm::OCurrencyModel, frm::ODateModel, frm::OEditModel, frm::OFormattedModel, frm::OImageControlModel, frm::OListBoxModel, frm::ONumericModel, frm::OPatternModel, frm::ORadioButtonModel, frm::OScrollBarModel, frm::OSpinButtonModel, and frm::OTimeModel.

Referenced by transferDbValueToControl().

◆ translateExternalValueToControlValue()

Any frm::OBoundControlModel::translateExternalValueToControlValue ( const css::uno::Any &  _rExternalValue) const
protectedvirtual

translates the given value, which was obtained from the current external value binding, to a value which can be used in setControlValue

The default implementation returns the value itself, exception when it is VOID, and our value property is not allowed to be void - in this case, the returned value is a default-constructed value of the type required by our value property.

See also
hasExternalValueBinding
getExternalValueType

Reimplemented in frm::ODateModel, frm::OFormattedModel, frm::OListBoxModel, frm::ORadioButtonModel, frm::OReferenceValueComponent, frm::OScrollBarModel, frm::OSpinButtonModel, and frm::OTimeModel.

Definition at line 2608 of file FormComponent.cxx.

References Any, hasExternalValueBinding(), m_aValuePropertyType, m_bSupportsExternalBinding, and m_bValuePropertyMayBeVoid.

Referenced by transferExternalValueToControl().

◆ unloaded()

void SAL_CALL frm::OBoundControlModel::unloaded ( const css::lang::EventObject &  aEvent)
overridevirtual

Definition at line 2088 of file FormComponent.cxx.

References hasExternalValueBinding().

◆ unloading()

void SAL_CALL frm::OBoundControlModel::unloading ( const css::lang::EventObject &  aEvent)
overridevirtual

◆ validityConstraintChanged()

void SAL_CALL frm::OBoundControlModel::validityConstraintChanged ( const css::lang::EventObject &  Source)
overrideprotectedvirtual

◆ write()

void SAL_CALL frm::OBoundControlModel::write ( const css::uno::Reference< css::io::XObjectOutputStream > &  OutStream)
overridevirtual

◆ writeCommonProperties()

void frm::OBoundControlModel::writeCommonProperties ( const css::uno::Reference< css::io::XObjectOutputStream > &  _rxOutStream)
protected

We can't write (new) common properties in this base class, as the file format doesn't allow this (unfortunately).

So derived classes may use the following two methods. They secure the written data with marks, so any new common properties in newer versions will be skipped by older ones.

Definition at line 1581 of file FormComponent.cxx.

References DBG_ASSERT, and m_xLabelControl.

Referenced by frm::OCheckBoxModel::write(), frm::OComboBoxModel::write(), frm::OImageControlModel::write(), frm::OListBoxModel::write(), and frm::ORadioButtonModel::write().

Member Data Documentation

◆ m_aControlSource

OUString frm::OBoundControlModel::m_aControlSource
private

◆ m_aExternalValueType

css::uno::Type frm::OBoundControlModel::m_aExternalValueType
private

Definition at line 550 of file FormComponent.hxx.

Referenced by calculateExternalValueType(), and getExternalValueType().

◆ m_aFormComponentListeners

::comphelper::OInterfaceContainerHelper3<css::form::validation::XFormComponentValidityListener> frm::OBoundControlModel::m_aFormComponentListeners
private

◆ m_aLabelServiceName

OUString frm::OBoundControlModel::m_aLabelServiceName
protected

Definition at line 577 of file FormComponent.hxx.

Referenced by setFastPropertyValue_NoBroadcast().

◆ m_aResetHelper

ResetHelper frm::OBoundControlModel::m_aResetHelper
private

Definition at line 540 of file FormComponent.hxx.

Referenced by addResetListener(), disposing(), removeResetListener(), and reset().

◆ m_aUpdateListeners

::comphelper::OInterfaceContainerHelper3<css::form::XUpdateListener> frm::OBoundControlModel::m_aUpdateListeners
private

Definition at line 542 of file FormComponent.hxx.

Referenced by addUpdateListener(), commit(), disposing(), and removeUpdateListener().

◆ m_aValuePropertyType

css::uno::Type frm::OBoundControlModel::m_aValuePropertyType
private

◆ m_bBindingControlsEnable

bool frm::OBoundControlModel::m_bBindingControlsEnable
private

◆ m_bBindingControlsRO

bool frm::OBoundControlModel::m_bBindingControlsRO
private

◆ m_bCommitable

const bool frm::OBoundControlModel::m_bCommitable
private

◆ m_bFormListening

bool frm::OBoundControlModel::m_bFormListening
private

Definition at line 562 of file FormComponent.hxx.

Referenced by doFormListening(), and isFormListening().

◆ m_bForwardValueChanges

bool frm::OBoundControlModel::m_bForwardValueChanges
private

◆ m_bInputRequired

bool frm::OBoundControlModel::m_bInputRequired
private

◆ m_bIsCurrentValueValid

bool frm::OBoundControlModel::m_bIsCurrentValueValid
private

Definition at line 570 of file FormComponent.hxx.

Referenced by isValid(), and recheckValidity().

◆ m_bLoaded

bool frm::OBoundControlModel::m_bLoaded
private

◆ m_bRequired

bool frm::OBoundControlModel::m_bRequired
private

Definition at line 564 of file FormComponent.hxx.

Referenced by connectToField(), and isRequired().

◆ m_bSupportsExternalBinding

const bool frm::OBoundControlModel::m_bSupportsExternalBinding
private

◆ m_bSupportsValidation

const bool frm::OBoundControlModel::m_bSupportsValidation
private

◆ m_bTransferringValue

bool frm::OBoundControlModel::m_bTransferringValue
private

Definition at line 569 of file FormComponent.hxx.

Referenced by modified(), and transferControlValueToExternal().

◆ m_bValuePropertyMayBeVoid

bool frm::OBoundControlModel::m_bValuePropertyMayBeVoid
private

Definition at line 538 of file FormComponent.hxx.

Referenced by initValueProperty(), and translateExternalValueToControlValue().

◆ m_eControlValueChangeInstigator

ValueChangeInstigator frm::OBoundControlModel::m_eControlValueChangeInstigator
private

Definition at line 574 of file FormComponent.hxx.

Referenced by onValuePropertyChange(), and setControlValue().

◆ m_nFieldType

sal_Int32 frm::OBoundControlModel::m_nFieldType
private

Definition at line 536 of file FormComponent.hxx.

Referenced by connectToField(), getFieldType(), and resetField().

◆ m_nValuePropertyAggregateHandle

sal_Int32 frm::OBoundControlModel::m_nValuePropertyAggregateHandle
private

◆ m_pAggPropMultiplexer

rtl::Reference<::comphelper::OPropertyChangeMultiplexer> frm::OBoundControlModel::m_pAggPropMultiplexer
private

◆ m_sValuePropertyName

OUString frm::OBoundControlModel::m_sValuePropertyName
private

◆ m_xAmbientForm

css::uno::Reference< css::form::XLoadable > frm::OBoundControlModel::m_xAmbientForm
private

◆ m_xColumn

css::uno::Reference< css::sdb::XColumn > frm::OBoundControlModel::m_xColumn
protected

◆ m_xColumnUpdate

css::uno::Reference< css::sdb::XColumnUpdate > frm::OBoundControlModel::m_xColumnUpdate
protected

◆ m_xCursor

css::uno::Reference< css::sdbc::XRowSet > frm::OBoundControlModel::m_xCursor
protected

◆ m_xExternalBinding

css::uno::Reference< css::form::binding::XValueBinding > frm::OBoundControlModel::m_xExternalBinding
private

◆ m_xField

css::uno::Reference< css::beans::XPropertySet > frm::OBoundControlModel::m_xField
private

◆ m_xLabelControl

css::uno::Reference< css::beans::XPropertySet > frm::OBoundControlModel::m_xLabelControl
private

◆ m_xValidator

css::uno::Reference< css::form::validation::XValidator > frm::OBoundControlModel::m_xValidator
private

The documentation for this class was generated from the following files: