LibreOffice Module extensions (master) 1
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
pcr::XSDValidationHelper Class Reference

#include <xsdvalidationhelper.hxx>

Inheritance diagram for pcr::XSDValidationHelper:
[legend]
Collaboration diagram for pcr::XSDValidationHelper:
[legend]

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< XSDDataTypegetDataTypeByName (const OUString &_rName) const
 retrieves a particular data type given by name More...
 
::rtl::Reference< XSDDataTypegetValidatingDataType () 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::XPropertySetgetCurrentBinding () 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::XPropertySetgetOrCreateBindingForModel (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::XPropertySetgetModelElementFromUIName (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::XPropertySetm_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
 

Detailed Description

Definition at line 38 of file xsdvalidationhelper.hxx.

Constructor & Destructor Documentation

◆ XSDValidationHelper()

pcr::XSDValidationHelper::XSDValidationHelper ( ::osl::Mutex &  _rMutex,
const css::uno::Reference< css::beans::XPropertySet > &  _rxIntrospectee,
const css::uno::Reference< css::frame::XModel > &  _rxContextDocument 
)

Member Function Documentation

◆ cloneDataType()

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.

◆ copyDataType()

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.

◆ findDefaultFormatForIntrospectee()

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.

◆ getAvailableDataTypeNames()

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.

◆ getBasicTypeNameForClass() [1/2]

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().

◆ getBasicTypeNameForClass() [2/2]

static OUString pcr::XSDValidationHelper::getBasicTypeNameForClass ( sal_Int16  _nClass,
const css::uno::Reference< css::xforms::XDataTypeRepository > &  _rxRepository 
)
staticprivate

retrieves the name of the basic data type which has the given class, in the given repository

◆ getDataType()

Reference< XDataType > pcr::XSDValidationHelper::getDataType ( const OUString &  _rName) const
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().

◆ getDataTypeByName()

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().

◆ getDataTypeRepository() [1/2]

Reference< XDataTypeRepository > pcr::XSDValidationHelper::getDataTypeRepository ( ) const
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().

◆ getDataTypeRepository() [2/2]

Reference< XDataTypeRepository > pcr::XSDValidationHelper::getDataTypeRepository ( const OUString &  _rModelName) const
private

retrieves the data type repository associated with any model

Definition at line 113 of file xsdvalidationhelper.cxx.

References pcr::EFormsHelper::getFormModelByName(), and xModel.

◆ getValidatingDataType()

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().

◆ getValidatingDataTypeName()

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().

◆ isInspectingFormattedField()

bool pcr::XSDValidationHelper::isInspectingFormattedField ( ) const
inline

Definition at line 43 of file xsdvalidationhelper.hxx.

References m_bInspectingFormattedField.

◆ removeDataTypeFromRepository()

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.

◆ setValidatingDataTypeByName()

void pcr::XSDValidationHelper::setValidatingDataTypeByName ( const OUString &  _rName) const

Member Data Documentation

◆ m_bInspectingFormattedField

bool pcr::XSDValidationHelper::m_bInspectingFormattedField
private

Definition at line 41 of file xsdvalidationhelper.hxx.

Referenced by isInspectingFormattedField(), and XSDValidationHelper().


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