LibreOffice Module extensions (master) 1
|
#include <xsdvalidationhelper.hxx>
Public Member Functions | |
bool | isInspectingFormattedField () const |
XSDValidationHelper (::osl::Mutex &_rMutex, const css::uno::Reference< css::beans::XPropertySet > &_rxIntrospectee, const css::uno::Reference< css::frame::XModel > &_rxContextDocument) | |
void | getAvailableDataTypeNames (std::vector< OUString > &_rNames) const |
retrieves the names of all XForms models in the document the control lives in More... | |
::rtl::Reference< XSDDataType > | getDataTypeByName (const OUString &_rName) const |
retrieves a particular data type given by name More... | |
::rtl::Reference< XSDDataType > | getValidatingDataType () const |
retrieves the DataType instance which the control model is currently validated against More... | |
OUString | getValidatingDataTypeName () const |
retrieves the name of the data type which the control model is currently validated against More... | |
void | setValidatingDataTypeByName (const OUString &_rName) const |
binds the validator to a new data type More... | |
bool | removeDataTypeFromRepository (const OUString &_rName) const |
removes the data type given by name from the data type repository More... | |
bool | cloneDataType (const ::rtl::Reference< XSDDataType > &_pDataType, const OUString &_rNewName) const |
creates a new data type, which is a clone of an existing data type More... | |
OUString | getBasicTypeNameForClass (sal_Int16 _eClass) const |
retrieves the name of the basic data type which has the given class More... | |
void | copyDataType (const OUString &_rFromModel, const OUString &_rToModel, const OUString &_rDataTypeName) const |
copy a data type from one model to another More... | |
void | findDefaultFormatForIntrospectee () |
finds (and sets) a default format for the formatted field we're inspecting, according to the current data type the control value is evaluated against More... | |
Public Member Functions inherited from pcr::EFormsHelper | |
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... | |
Private Member Functions | |
css::uno::Reference< css::xforms::XDataTypeRepository > | getDataTypeRepository () const |
retrieves the data type repository associated with the current model More... | |
css::uno::Reference< css::xforms::XDataTypeRepository > | getDataTypeRepository (const OUString &_rModelName) const |
retrieves the data type repository associated with any model More... | |
css::uno::Reference< css::xsd::XDataType > | getDataType (const OUString &_rName) const |
retrieves the data type object for the given name More... | |
Static Private Member Functions | |
static OUString | getBasicTypeNameForClass (sal_Int16 _nClass, const css::uno::Reference< css::xforms::XDataTypeRepository > &_rxRepository) |
retrieves the name of the basic data type which has the given class, in the given repository More... | |
Private Attributes | |
bool | m_bInspectingFormattedField |
Additional Inherited Members | |
Public Types inherited from pcr::EFormsHelper | |
enum | ModelElementType { Submission , Binding } |
types of sub-elements of a model More... | |
Static Public Member Functions inherited from pcr::EFormsHelper | |
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 inherited from pcr::EFormsHelper | |
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 inherited from pcr::EFormsHelper | |
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 |
Definition at line 38 of file xsdvalidationhelper.hxx.
pcr::XSDValidationHelper::XSDValidationHelper | ( | ::osl::Mutex & | _rMutex, |
const css::uno::Reference< css::beans::XPropertySet > & | _rxIntrospectee, | ||
const css::uno::Reference< css::frame::XModel > & | _rxContextDocument | ||
) |
Definition at line 53 of file xsdvalidationhelper.cxx.
References Exception, m_bInspectingFormattedField, pcr::EFormsHelper::m_xControlModel, PROPERTY_FORMATKEY, PROPERTY_FORMATSSUPPLIER, SERVICE_COMPONENT_FORMATTEDFIELD, and TOOLS_WARN_EXCEPTION.
bool pcr::XSDValidationHelper::cloneDataType | ( | const ::rtl::Reference< XSDDataType > & | _pDataType, |
const OUString & | _rNewName | ||
) | const |
creates a new data type, which is a clone of an existing data type
Definition at line 188 of file xsdvalidationhelper.cxx.
References Exception, getDataTypeRepository(), and TOOLS_WARN_EXCEPTION.
void pcr::XSDValidationHelper::copyDataType | ( | const OUString & | _rFromModel, |
const OUString & | _rToModel, | ||
const OUString & | _rDataTypeName | ||
) | const |
copy a data type from one model to another
If a data type with the given name already exists in the target model, then nothing happens. In particular, the facets of the data type are not copied.
Definition at line 282 of file xsdvalidationhelper.cxx.
References Exception, getBasicTypeNameForClass(), getDataTypeRepository(), and TOOLS_WARN_EXCEPTION.
void pcr::XSDValidationHelper::findDefaultFormatForIntrospectee | ( | ) |
finds (and sets) a default format for the formatted field we're inspecting, according to the current data type the control value is evaluated against
Definition at line 322 of file xsdvalidationhelper.cxx.
References Any, Exception, getLocale(), getValidatingDataType(), pcr::EFormsHelper::m_xControlModel, PROPERTY_FORMATKEY, PROPERTY_FORMATSSUPPLIER, and TOOLS_WARN_EXCEPTION.
void pcr::XSDValidationHelper::getAvailableDataTypeNames | ( | std::vector< OUString > & | _rNames | ) | const |
retrieves the names of all XForms models in the document the control lives in
Definition at line 79 of file xsdvalidationhelper.cxx.
References Exception, getDataTypeRepository(), and TOOLS_WARN_EXCEPTION.
OUString pcr::XSDValidationHelper::getBasicTypeNameForClass | ( | sal_Int16 | _eClass | ) | const |
retrieves the name of the basic data type which has the given class
Definition at line 374 of file xsdvalidationhelper.cxx.
References getBasicTypeNameForClass(), and getDataTypeRepository().
Referenced by copyDataType(), and getBasicTypeNameForClass().
|
staticprivate |
retrieves the name of the basic data type which has the given class, in the given repository
|
private |
retrieves the data type object for the given name
Definition at line 125 of file xsdvalidationhelper.cxx.
References getDataTypeRepository().
Referenced by getDataTypeByName(), and setValidatingDataTypeByName().
rtl::Reference< XSDDataType > pcr::XSDValidationHelper::getDataTypeByName | ( | const OUString & | _rName | ) | const |
retrieves a particular data type given by name
Definition at line 159 of file xsdvalidationhelper.cxx.
References Exception, getDataType(), and TOOLS_WARN_EXCEPTION.
Referenced by getValidatingDataType().
|
private |
retrieves the data type repository associated with the current model
Definition at line 101 of file xsdvalidationhelper.cxx.
References pcr::EFormsHelper::getCurrentFormModel(), and xModel.
Referenced by cloneDataType(), copyDataType(), getAvailableDataTypeNames(), getBasicTypeNameForClass(), getDataType(), and removeDataTypeFromRepository().
|
private |
retrieves the data type repository associated with any model
Definition at line 113 of file xsdvalidationhelper.cxx.
References pcr::EFormsHelper::getFormModelByName(), and xModel.
rtl::Reference< XSDDataType > pcr::XSDValidationHelper::getValidatingDataType | ( | ) | const |
retrieves the DataType instance which the control model is currently validated against
If there is a binding set at our control model, which at the same time acts as validator, and if this validator is bound to an XDataType, then this data type is retrieved here.
Definition at line 182 of file xsdvalidationhelper.cxx.
References getDataTypeByName(), and getValidatingDataTypeName().
Referenced by findDefaultFormatForIntrospectee().
OUString pcr::XSDValidationHelper::getValidatingDataTypeName | ( | ) | const |
retrieves the name of the data type which the control model is currently validated against
@seealso getValidatingDataType
Definition at line 139 of file xsdvalidationhelper.cxx.
References Exception, pcr::EFormsHelper::getCurrentBinding(), PROPERTY_XSD_DATA_TYPE, and TOOLS_WARN_EXCEPTION.
Referenced by getValidatingDataType().
|
inline |
Definition at line 43 of file xsdvalidationhelper.hxx.
References m_bInspectingFormattedField.
bool pcr::XSDValidationHelper::removeDataTypeFromRepository | ( | const OUString & | _rName | ) | const |
removes the data type given by name from the data type repository
Definition at line 216 of file xsdvalidationhelper.cxx.
References Exception, getDataTypeRepository(), and TOOLS_WARN_EXCEPTION.
void pcr::XSDValidationHelper::setValidatingDataTypeByName | ( | const OUString & | _rName | ) | const |
binds the validator to a new data type
To be called with an active binding only.
Definition at line 242 of file xsdvalidationhelper.cxx.
References Any, DBG_UNHANDLED_EXCEPTION, Exception, pcr::EFormsHelper::firePropertyChange(), pcr::EFormsHelper::firePropertyChanges(), pcr::EFormsHelper::getCurrentBinding(), getDataType(), PROPERTY_NAME, and PROPERTY_XSD_DATA_TYPE.
|
private |
Definition at line 41 of file xsdvalidationhelper.hxx.
Referenced by isInspectingFormattedField(), and XSDValidationHelper().