LibreOffice Module extensions (master) 1
|
#include <eformshelper.hxx>
Public Types | |
enum | ModelElementType { Submission , Binding } |
types of sub-elements of a model More... | |
Public Member Functions | |
EFormsHelper (::osl::Mutex &_rMutex, const css::uno::Reference< css::beans::XPropertySet > &_rxControlModel, const css::uno::Reference< css::frame::XModel > &_rxContextDocument) | |
void | registerBindingListener (const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxBindingListener) |
registers a listener to be notified when any aspect of the binding changes. More... | |
void | revokeBindingListener (const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxBindingListener) |
revokes the binding listener which has previously been registered More... | |
bool | canBindToDataType (sal_Int32 _nDataType=-1) const |
checks whether it's possible to bind the control model to a given XSD data type More... | |
bool | canBindToAnyDataType () const |
checks whether the control model can be bound to any XSD data type More... | |
bool | isListEntrySink () const |
checks whether the control model is a source for list entries, as supplied by XML data bindings More... | |
void | getFormModelNames (std::vector< OUString > &_rModelNames) const |
retrieves the names of all XForms models in the document the control lives in More... | |
void | getBindingNames (const OUString &_rModelName, std::vector< OUString > &_rBindingNames) const |
retrieves the names of all bindings for a given model More... | |
css::uno::Reference< css::xforms::XModel > | getFormModelByName (const OUString &_rModelName) const |
retrieves the XForms model (within the control model's document) with the given name More... | |
css::uno::Reference< css::xforms::XModel > | getCurrentFormModel () const |
retrieves the model which the active binding of the control model belongs to More... | |
OUString | getCurrentFormModelName () const |
retrieves the name of the model which the active binding of the control model belongs to More... | |
css::uno::Reference< css::beans::XPropertySet > | getCurrentBinding () const |
retrieves the binding instance which is currently attached to the control model More... | |
OUString | getCurrentBindingName () const |
retrieves the name of the binding instance which is currently attached to the control model More... | |
void | setBinding (const css::uno::Reference< css::beans::XPropertySet > &_rxBinding) |
sets a new binding at the control model More... | |
css::uno::Reference< css::form::binding::XListEntrySource > | getCurrentListSourceBinding () const |
retrieves the binding instance which is currently used as list source for the control model More... | |
void | setListSourceBinding (const css::uno::Reference< css::form::binding::XListEntrySource > &_rxListSource) |
sets a new list source at the control model More... | |
css::uno::Reference< css::beans::XPropertySet > | getOrCreateBindingForModel (const OUString &_rTargetModel, const OUString &_rBindingName) const |
retrieves a given binding for a given model, or creates a new one More... | |
css::uno::Reference< css::beans::XPropertySet > | getModelElementFromUIName (const ModelElementType _eType, const OUString &_rUIName) const |
retrieves the submission object for an UI name More... | |
void | getAllElementUINames (const ModelElementType _eType, std::vector< OUString > &_rElementNames, bool _bPrepentEmptyEntry) |
retrieves the UI names of all elements of all models in our document More... | |
Static Public Member Functions | |
static bool | isEForm (const css::uno::Reference< css::frame::XModel > &_rxContextDocument) |
determines whether the given document is an eForm More... | |
static OUString | getModelElementUIName (const ModelElementType _eType, const css::uno::Reference< css::beans::XPropertySet > &_rxElement) |
retrieves the name of a model's sub-element, as to be shown in the UI More... | |
Protected Member Functions | |
void | firePropertyChanges (const css::uno::Reference< css::beans::XPropertySet > &_rxOldProps, const css::uno::Reference< css::beans::XPropertySet > &_rxNewProps, std::set< OUString > &_rFilter) const |
void | firePropertyChange (const OUString &_rName, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue) const |
fires a change in a single property, if the property value changed, and if we have a listener interested in property changes More... | |
Protected Attributes | |
css::uno::Reference< css::beans::XPropertySet > | m_xControlModel |
css::uno::Reference< css::form::binding::XBindableValue > | m_xBindableControl |
css::uno::Reference< css::xforms::XFormsSupplier > | m_xDocument |
PropertyChangeListeners | m_aPropertyListeners |
MapStringToPropertySet | m_aSubmissionUINames |
MapStringToPropertySet | m_aBindingUINames |
Private Member Functions | |
void | impl_switchBindingListening_throw (bool _bDoListening, const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener) |
css::uno::Reference< css::beans::XPropertySet > | implGetOrCreateBinding (const OUString &_rTargetModel, const OUString &_rBindingName) const |
implementation for both <member>getOrCreateBindingForModel</member> More... | |
void | impl_toggleBindingPropertyListening_throw (bool _bDoListen, const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxConcreteListenerOrNull) |
EFormsHelper (const EFormsHelper &)=delete | |
EFormsHelper & | operator= (const EFormsHelper &)=delete |
Definition at line 48 of file eformshelper.hxx.
types of sub-elements of a model
Enumerator | |
---|---|
Submission | |
Binding |
Definition at line 177 of file eformshelper.hxx.
pcr::EFormsHelper::EFormsHelper | ( | ::osl::Mutex & | _rMutex, |
const css::uno::Reference< css::beans::XPropertySet > & | _rxControlModel, | ||
const css::uno::Reference< css::frame::XModel > & | _rxContextDocument | ||
) |
|
privatedelete |
|
inline |
checks whether the control model can be bound to any XSD data type
Definition at line 110 of file eformshelper.hxx.
References canBindToDataType().
bool pcr::EFormsHelper::canBindToDataType | ( | sal_Int32 | _nDataType = -1 | ) | const |
checks whether it's possible to bind the control model to a given XSD data type
_nDataType | the data type which should be bound. If this is -1, <TRUE> is returned if the control model can be bound to any data type. |
Definition at line 102 of file eformshelper.cxx.
References Exception, PROPERTY_CLASSID, SERVICE_COMPONENT_FORMATTEDFIELD, and TOOLS_WARN_EXCEPTION.
Referenced by canBindToAnyDataType().
|
protected |
fires a change in a single property, if the property value changed, and if we have a listener interested in property changes
Definition at line 699 of file eformshelper.cxx.
References aEvent, Exception, and TOOLS_WARN_EXCEPTION.
Referenced by pcr::XSDValidationHelper::setValidatingDataTypeByName().
|
protected |
Definition at line 725 of file eformshelper.cxx.
References Any, aProperties, Exception, and TOOLS_WARN_EXCEPTION.
Referenced by pcr::XSDValidationHelper::setValidatingDataTypeByName().
void pcr::EFormsHelper::getAllElementUINames | ( | const ModelElementType | _eType, |
std::vector< OUString > & | _rElementNames, | ||
bool | _bPrepentEmptyEntry | ||
) |
retrieves the UI names of all elements of all models in our document
_eType | the type of elements for which the names should be retrieved |
_rElementNames | the array of element names |
Definition at line 635 of file eformshelper.cxx.
References Any, Exception, i, PROPERTY_MODEL, TOOLS_WARN_EXCEPTION, and xModel.
void pcr::EFormsHelper::getBindingNames | ( | const OUString & | _rModelName, |
std::vector< OUString > & | _rBindingNames | ||
) | const |
retrieves the names of all bindings for a given model
Definition at line 316 of file eformshelper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xModel.
Reference< XPropertySet > pcr::EFormsHelper::getCurrentBinding | ( | ) | const |
retrieves the binding instance which is currently attached to the control model
Definition at line 395 of file eformshelper.cxx.
References Exception, and TOOLS_WARN_EXCEPTION.
Referenced by pcr::XSDValidationHelper::getValidatingDataTypeName(), and pcr::XSDValidationHelper::setValidatingDataTypeByName().
OUString pcr::EFormsHelper::getCurrentBindingName | ( | ) | const |
retrieves the name of the binding instance which is currently attached to the control model
Definition at line 413 of file eformshelper.cxx.
References Exception, PROPERTY_BINDING_ID, and TOOLS_WARN_EXCEPTION.
Reference< xforms::XModel > pcr::EFormsHelper::getCurrentFormModel | ( | ) | const |
retrieves the model which the active binding of the control model belongs to
Definition at line 359 of file eformshelper.cxx.
References Exception, PROPERTY_MODEL, TOOLS_WARN_EXCEPTION, and xModel.
Referenced by pcr::XSDValidationHelper::getDataTypeRepository().
OUString pcr::EFormsHelper::getCurrentFormModelName | ( | ) | const |
retrieves the name of the model which the active binding of the control model belongs to
Definition at line 378 of file eformshelper.cxx.
References Exception, and TOOLS_WARN_EXCEPTION.
Reference< XListEntrySource > pcr::EFormsHelper::getCurrentListSourceBinding | ( | ) | const |
retrieves the binding instance which is currently used as list source for the control model
Definition at line 430 of file eformshelper.cxx.
References Exception, and TOOLS_WARN_EXCEPTION.
Reference< xforms::XModel > pcr::EFormsHelper::getFormModelByName | ( | const OUString & | _rModelName | ) | const |
retrieves the XForms model (within the control model's document) with the given name
Definition at line 341 of file eformshelper.cxx.
References Exception, m_xDocument, and TOOLS_WARN_EXCEPTION.
Referenced by pcr::XSDValidationHelper::getDataTypeRepository().
void pcr::EFormsHelper::getFormModelNames | ( | std::vector< OUString > & | _rModelNames | ) | const |
retrieves the names of all XForms models in the document the control lives in
Definition at line 291 of file eformshelper.cxx.
References Exception, m_xDocument, and TOOLS_WARN_EXCEPTION.
Reference< XPropertySet > pcr::EFormsHelper::getModelElementFromUIName | ( | const ModelElementType | _eType, |
const OUString & | _rUIName | ||
) | const |
retrieves the submission object for an UI name
Note that <member>getAllElementUINames</member> must have been called before, for the given element type
Definition at line 625 of file eformshelper.cxx.
References pos.
|
static |
retrieves the name of a model's sub-element, as to be shown in the UI
Definition at line 599 of file eformshelper.cxx.
References Exception, PROPERTY_MODEL, TOOLS_WARN_EXCEPTION, and xModel.
Referenced by pcr::EFormsPropertyHandler::convertToControlValue(), and pcr::SubmissionPropertyHandler::convertToControlValue().
Reference< XPropertySet > pcr::EFormsHelper::getOrCreateBindingForModel | ( | const OUString & | _rTargetModel, |
const OUString & | _rBindingName | ||
) | const |
retrieves a given binding for a given model, or creates a new one
_rTargetModel | the name of the model to create a binding for. Must not be empty |
_rBindingName | the name of the binding to retrieve. If the model denoted by <arg>_rTargetModel</arg> does not have a binding with this name, a new binding is created and returned. |
Definition at line 490 of file eformshelper.cxx.
|
private |
Definition at line 212 of file eformshelper.cxx.
|
private |
|
private |
implementation for both <member>getOrCreateBindingForModel</member>
Definition at line 497 of file eformshelper.cxx.
References Any, DBG_UNHANDLED_EXCEPTION, Exception, pcr::PcrRes(), PROPERTY_BINDING_ID, and xModel.
|
static |
determines whether the given document is an eForm
If this method returns <FALSE>, you cannot instantiate an EFormsHelper with this document, since none of its functionality will be available then.
Definition at line 84 of file eformshelper.cxx.
References Exception, and TOOLS_WARN_EXCEPTION.
Referenced by pcr::SubmissionHelper::canTriggerSubmissions(), pcr::EFormsPropertyHandler::onNewComponent(), and pcr::XSDValidationPropertyHandler::onNewComponent().
bool pcr::EFormsHelper::isListEntrySink | ( | ) | const |
checks whether the control model is a source for list entries, as supplied by XML data bindings
Definition at line 196 of file eformshelper.cxx.
References Exception, and TOOLS_WARN_EXCEPTION.
|
privatedelete |
void pcr::EFormsHelper::registerBindingListener | ( | const css::uno::Reference< css::beans::XPropertyChangeListener > & | _rxBindingListener | ) |
registers a listener to be notified when any aspect of the binding changes.
The listener will be registered at the current binding of the control model. If the binding changes (see <method>setBinding</method>), the listener will be revoked from the old binding, registered at the new binding, and for all properties which differ between both bindings, the listener will be notified.
Definition at line 231 of file eformshelper.cxx.
void pcr::EFormsHelper::revokeBindingListener | ( | const css::uno::Reference< css::beans::XPropertyChangeListener > & | _rxBindingListener | ) |
revokes the binding listener which has previously been registered
Definition at line 285 of file eformshelper.cxx.
void pcr::EFormsHelper::setBinding | ( | const css::uno::Reference< css::beans::XPropertySet > & | _rxBinding | ) |
sets a new binding at the control model
Definition at line 464 of file eformshelper.cxx.
References Exception, and TOOLS_WARN_EXCEPTION.
void pcr::EFormsHelper::setListSourceBinding | ( | const css::uno::Reference< css::form::binding::XListEntrySource > & | _rxListSource | ) |
sets a new list source at the control model
Definition at line 448 of file eformshelper.cxx.
References Exception, and TOOLS_WARN_EXCEPTION.
|
protected |
Definition at line 62 of file eformshelper.hxx.
|
protected |
Definition at line 58 of file eformshelper.hxx.
|
protected |
Definition at line 60 of file eformshelper.hxx.
|
protected |
Definition at line 54 of file eformshelper.hxx.
|
protected |
Definition at line 52 of file eformshelper.hxx.
Referenced by pcr::XSDValidationHelper::findDefaultFormatForIntrospectee(), and pcr::XSDValidationHelper::XSDValidationHelper().
|
protected |
Definition at line 56 of file eformshelper.hxx.