LibreOffice Module xmloff (master) 1
|
helper class for importing the description of a single control More...
#include <elementimport.hxx>
Public Member Functions | |
OControlImport (OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType) | |
virtual void SAL_CALL | startFastElement (sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override |
virtual void SAL_CALL | endFastElement (sal_Int32 nElement) override |
endFastElement is called before a context will be destructed, but after an elements context has been parsed. More... | |
virtual bool | handleAttribute (sal_Int32 nElement, const OUString &_rValue) override |
handle one single attribute. More... | |
void | addOuterAttributes (const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxOuterAttribs) |
Public Member Functions inherited from xmloff::OElementImport | |
OElementImport (OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer) | |
ctor More... | |
virtual | ~OElementImport () override |
Public Member Functions inherited from xmloff::OPropertyImport | |
OPropertyImport (OFormLayerXMLImport_Impl &_rImport) | |
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL | createFastChildContext (sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override |
virtual void SAL_CALL | startFastElement (sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttrList) override |
virtual void SAL_CALL | characters (const OUString &_rChars) override |
This method is called for all characters that are contained in the current element. More... | |
Public Member Functions inherited from SvXMLImportContext | |
SvXMLImportContext (SvXMLImport &rImport) | |
A contexts constructor does anything that is required if an element starts. More... | |
virtual | ~SvXMLImportContext () |
A contexts destructor does anything that is required if an element ends. More... | |
virtual void SAL_CALL | startFastElement (sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override |
virtual void SAL_CALL | startUnknownElement (const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override |
virtual void SAL_CALL | endFastElement (sal_Int32 Element) override |
endFastElement is called before a context will be destructed, but after an elements context has been parsed. More... | |
virtual void SAL_CALL | endUnknownElement (const OUString &Namespace, const OUString &Name) override |
virtual css::uno::Reference< XFastContextHandler > SAL_CALL | createFastChildContext (sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override |
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL | createUnknownChildContext (const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override |
virtual void SAL_CALL | characters (const OUString &aChars) override |
This method is called for all characters that are contained in the current element. More... | |
virtual css::uno::Any SAL_CALL | queryInterface (const css::uno::Type &aType) final override |
virtual void SAL_CALL | acquire () noexcept final override |
virtual void SAL_CALL | release () noexcept final override |
virtual css::uno::Sequence< css::uno::Type > SAL_CALL | getTypes () final override |
virtual css::uno::Sequence< sal_Int8 > SAL_CALL | getImplementationId () final override |
virtual void | registerEvents (const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rEvents)=0 |
Protected Member Functions | |
OControlImport (OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer) | |
void | setElementType (OControlElement::ElementType _eType) |
virtual OUString | determineDefaultServiceName () const override |
virtual void | doRegisterCellValueBinding (const OUString &_rBoundCellAddress) |
registers the given cell address as value binding address for our element More... | |
void | doRegisterXFormsValueBinding (const OUString &) |
register the given XForms binding More... | |
void | doRegisterXFormsListBinding (const OUString &) |
register the given XForms list binding More... | |
void | doRegisterXFormsSubmission (const OUString &) |
register the given XForms submission More... | |
virtual css::uno::Reference< css::beans::XPropertySet > | createElement () override |
create the (uninitialized) element which is to represent the read data More... | |
Protected Member Functions inherited from xmloff::OElementImport | |
virtual void SAL_CALL | startFastElement (sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override |
virtual void SAL_CALL | endFastElement (sal_Int32 nElement) override |
endFastElement is called before a context will be destructed, but after an elements context has been parsed. More... | |
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL | createFastChildContext (sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override |
virtual bool | handleAttribute (sal_Int32 nElement, const OUString &_rValue) override |
handle one single attribute. More... | |
virtual void | registerEvents (const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rEvents) override |
virtual css::uno::Reference< css::beans::XPropertySet > | createElement () |
create the (uninitialized) element which is to represent the read data More... | |
void | simulateDefaultedAttribute (sal_Int32 nElement, const OUString &_rPropertyName, const char *_pAttributeDefault) |
can be used to handle properties where the attribute default and the property default differ. More... | |
bool | tryGenericAttribute (sal_Int32 nElement, const OUString &_rValue) |
to be called from within handleAttribute, checks whether the given attribute is covered by our generic attribute handler mechanisms More... | |
void | disableImplicitGenericAttributeHandling () |
controls whether |handleAttribute| implicitly calls |tryGenericAttribute|, or whether the derived class must do this explicitly at a suitable place in its own |handleAttribute| More... | |
Protected Member Functions inherited from xmloff::OPropertyImport | |
virtual bool | handleAttribute (sal_Int32 nElement, const OUString &_rValue) |
handle one single attribute. More... | |
bool | encounteredAttribute (sal_Int32 nElement) const |
determine if the element imported by the object had a given attribute. More... | |
void | enableTrackAttributes () |
enables the tracking of the encountered attributes More... | |
void | implPushBackPropertyValue (const css::beans::PropertyValue &_rProp) |
void | implPushBackPropertyValue (const OUString &_rName, const css::uno::Any &_rValue) |
void | implPushBackGenericPropertyValue (const css::beans::PropertyValue &_rProp) |
Protected Member Functions inherited from SvXMLImportContext | |
SvXMLImport & | GetImport () |
const SvXMLImport & | GetImport () const |
Protected Member Functions inherited from xmloff::IEventAttacher | |
~IEventAttacher () | |
Protected Member Functions inherited from xmloff::OValuePropertiesMetaData | |
OValuePropertiesMetaData () | |
Static Protected Member Functions | |
static void | implTranslateValueProperty (const css::uno::Reference< css::beans::XPropertySetInfo > &_rxPropInfo, css::beans::PropertyValue &_rPropValue) |
Protected Attributes | |
OUString | m_sControlId |
OControlElement::ElementType | m_eElementType |
PropertyValueArray | m_aValueProperties |
css::uno::Reference< css::xml::sax::XFastAttributeList > | m_xOuterAttributes |
OUString | m_sBoundCellAddress |
the address of the calc cell which the control model should be bound to, if applicable More... | |
OUString | m_sBindingID |
name of a value binding (xforms:bind attribute) More... | |
OUString | m_sListBindingID |
name of a list binding (form:xforms-list-source attribute) More... | |
OUString | m_sSubmissionID |
name of a submission (xforms:submission attribute) More... | |
Protected Attributes inherited from xmloff::OElementImport | |
OUString | m_sServiceName |
OUString | m_sName |
OFormLayerXMLImport_Impl & | m_rFormImport |
IEventAttacherManager & | m_rEventManager |
const XMLTextStyleContext * | m_pStyleElement |
css::uno::Reference< css::container::XNameContainer > | m_xParentContainer |
the parent container to insert the new element into More... | |
css::uno::Reference< css::beans::XPropertySet > | m_xElement |
the element we're creating. Valid after StartElement More... | |
css::uno::Reference< css::beans::XPropertySetInfo > | m_xInfo |
bool | m_bImplicitGenericAttributeHandling |
Protected Attributes inherited from xmloff::OPropertyImport | |
PropertyValueArray | m_aValues |
PropertyValueArray | m_aGenericValues |
o3tl::sorted_vector< sal_Int32 > | m_aEncounteredAttributes |
OFormLayerXMLImport_Impl & | m_rContext |
bool | m_bTrackAttributes |
Additional Inherited Members | |
Static Public Member Functions inherited from xmloff::OValuePropertiesMetaData | |
static void | getValuePropertyNames (OControlElement::ElementType _eType, sal_Int16 _nFormComponentType, OUString &_rpCurrentValuePropertyName, OUString &_rpValuePropertyName) |
calculate the property names for the current-value and the value attribute. More... | |
static void | getValueLimitPropertyNames (sal_Int16 _nFormComponentType, OUString &_rpMinValuePropertyName, OUString &_rpMaxValuePropertyName) |
calculate the property names for the min-value and the max-value attribute. More... | |
static void | getRuntimeValuePropertyNames (OControlElement::ElementType _eType, sal_Int16 _nFormComponentType, OUString &_rpValuePropertyName, OUString &_rpDefaultValuePropertyName) |
calculate the names of the properties which, at runtime, are used for value and default value. More... | |
Protected Types inherited from xmloff::OPropertyImport | |
typedef ::std::vector< css::beans::PropertyValue > | PropertyValueArray |
helper class for importing the description of a single control
Definition at line 164 of file elementimport.hxx.
|
protected |
xmloff::OControlImport::OControlImport | ( | OFormLayerXMLImport_Impl & | _rImport, |
IEventAttacherManager & | _rEventManager, | ||
const css::uno::Reference< css::container::XNameContainer > & | _rxParentContainer, | ||
OControlElement::ElementType | _eType | ||
) |
void xmloff::OControlImport::addOuterAttributes | ( | const css::uno::Reference< css::xml::sax::XFastAttributeList > & | _rxOuterAttribs | ) |
Definition at line 642 of file elementimport.cxx.
References m_xOuterAttributes.
Referenced by xmloff::OColumnWrapperImport::createFastChildContext().
|
overrideprotectedvirtual |
create the (uninitialized) element which is to represent the read data
The default implementation uses <member>m_xORB</member> to create an object with <member>m_sServiceName</member>.
Reimplemented from xmloff::OElementImport.
Reimplemented in xmloff::OGridImport.
Definition at line 1036 of file elementimport.cxx.
References Any, xmloff::OElementImport::createElement(), xmloff::OElementImport::m_xInfo, and xmloff::PROPERTY_ALIGN.
Referenced by xmloff::OGridImport::createElement().
|
overrideprotectedvirtual |
Reimplemented from xmloff::OElementImport.
Definition at line 611 of file elementimport.cxx.
References xmloff::OControlElement::BUTTON, xmloff::OControlElement::CHECKBOX, xmloff::OControlElement::COMBOBOX, xmloff::OControlElement::DATE, xmloff::OControlElement::FILE, xmloff::OControlElement::FIXED_TEXT, xmloff::OControlElement::FORMATTED_TEXT, xmloff::OControlElement::FRAME, xmloff::OControlElement::GRID, xmloff::OControlElement::HIDDEN, xmloff::OControlElement::IMAGE, xmloff::OControlElement::IMAGE_FRAME, xmloff::OControlElement::LISTBOX, m_eElementType, xmloff::OControlElement::PASSWORD, xmloff::OControlElement::RADIO, xmloff::OControlElement::TEXT, xmloff::OControlElement::TEXT_AREA, xmloff::OControlElement::TIME, and xmloff::OControlElement::VALUERANGE.
|
protectedvirtual |
registers the given cell address as value binding address for our element
The default implementation simply calls registerCellValueBinding at our import context, but you may want to override this behaviour.
_rBoundCellAddress | the cell address to register for our element. Must not be <NULL>. @precond we have a valid element (m_xElement) |
Reimplemented in xmloff::OListAndComboImport.
Definition at line 1003 of file elementimport.cxx.
References xmloff::OPropertyImport::m_rContext, xmloff::OElementImport::m_xElement, and xmloff::OFormLayerXMLImport_Impl::registerCellValueBinding().
Referenced by xmloff::OListAndComboImport::doRegisterCellValueBinding(), and endFastElement().
|
protected |
register the given XForms list binding
Definition at line 1020 of file elementimport.cxx.
References xmloff::OPropertyImport::m_rContext, xmloff::OElementImport::m_xElement, and xmloff::OFormLayerXMLImport_Impl::registerXFormsListBinding().
Referenced by endFastElement().
|
protected |
register the given XForms submission
Definition at line 1028 of file elementimport.cxx.
References xmloff::OPropertyImport::m_rContext, xmloff::OElementImport::m_xElement, and xmloff::OFormLayerXMLImport_Impl::registerXFormsSubmission().
Referenced by endFastElement().
|
protected |
register the given XForms binding
Definition at line 1012 of file elementimport.cxx.
References xmloff::OPropertyImport::m_rContext, xmloff::OElementImport::m_xElement, and xmloff::OFormLayerXMLImport_Impl::registerXFormsValueBinding().
Referenced by endFastElement().
|
overridevirtual |
endFastElement is called before a context will be destructed, but after an elements context has been parsed.
It may be used for actions that require virtual methods. The default is to do nothing.
Reimplemented from xmloff::OElementImport.
Reimplemented in xmloff::OTextLikeImport, xmloff::OListAndComboImport, and xmloff::OGridImport.
Definition at line 898 of file elementimport.cxx.
References Any, doRegisterCellValueBinding(), doRegisterXFormsListBinding(), doRegisterXFormsSubmission(), doRegisterXFormsValueBinding(), xmloff::OElementImport::endFastElement(), Exception, xmloff::OValuePropertiesMetaData::getRuntimeValuePropertyNames(), xmloff::OPropertyImport::m_aValues, m_eElementType, xmloff::OElementImport::m_rFormImport, m_sBindingID, m_sBoundCellAddress, m_sControlId, m_sListBindingID, m_sSubmissionID, xmloff::OElementImport::m_xElement, xmloff::PROPERTY_CLASSID, xmloff::OFormLayerXMLImport_Impl::registerControlId(), and TOOLS_WARN_EXCEPTION.
Referenced by xmloff::OTextLikeImport::endFastElement(), xmloff::OListAndComboImport::endFastElement(), and xmloff::OGridImport::endFastElement().
|
overridevirtual |
handle one single attribute.
This is called for every attribute of the element. This class' implementation checks if the attribute describes a property, if so, it is added to <member>m_aValues</member>.
All non-property attributes should be handled in derived classes.
_nNamespaceKey | key of the namespace used in the attribute |
_rLocalName | local (relative to the namespace) attribute name |
_rValue | attribute value |
Reimplemented from xmloff::OElementImport.
Reimplemented in xmloff::OImagePositionImport, xmloff::OReferredControlImport, xmloff::OPasswordImport, xmloff::ORadioImport, xmloff::OURLReferenceImport, xmloff::OValueRangeImport, and xmloff::OListAndComboImport.
Definition at line 648 of file elementimport.cxx.
References sax::Converter::convertDuration(), CurrentValue, FORM, xmloff::OAttributeMetaData::getBindingAttributeToken(), xmloff::OAttributeMetaData::getCommonControlAttributeToken(), xmloff::OAttributeMetaData::getSpecialAttributeToken(), xmloff::OElementImport::handleAttribute(), xmloff::OPropertyImport::implPushBackPropertyValue(), IsTokenInNamespace(), LinkedCell, m_aValueProperties, m_sBindingID, m_sBoundCellAddress, m_sControlId, m_sListBindingID, m_sSubmissionID, MaxValue, MinValue, nHandle, xmloff::PROPERTY_REPEAT_DELAY, PROPID_CURRENT_VALUE, PROPID_MAX_VALUE, PROPID_MIN_VALUE, PROPID_VALUE, RepeatDelay, TOKEN_MASK, xmloff::OElementImport::tryGenericAttribute(), Value, XFORMS, xmloff::token::XML_BIND, XML_ELEMENT, xmloff::token::XML_ID, XML_NAMESPACE_FORM, XML_NAMESPACE_XML, xmloff::token::XML_SUBMISSION, xmloff::token::XML_XFORMS_LIST_SOURCE, and xmloff::token::XML_XFORMS_SUBMISSION.
Referenced by xmloff::OImagePositionImport::handleAttribute(), xmloff::OReferredControlImport::handleAttribute(), xmloff::OPasswordImport::handleAttribute(), xmloff::OValueRangeImport::handleAttribute(), and xmloff::OListAndComboImport::handleAttribute().
|
staticprotected |
Definition at line 865 of file elementimport.cxx.
References sax::Converter::convertDouble(), xmloff::PropertyConversion::convertString(), nValue, Property, xmloff::PROPERTY_EFFECTIVE_DEFAULT, xmloff::PROPERTY_EFFECTIVE_VALUE, and SAL_WARN_IF.
Referenced by startFastElement().
|
inlineprotected |
Definition at line 219 of file elementimport.hxx.
References m_eElementType.
Referenced by xmloff::OGridImport::OGridImport().
|
overridevirtual |
Reimplemented from xmloff::OElementImport.
Reimplemented in xmloff::OListAndComboImport, xmloff::OImagePositionImport, xmloff::OReferredControlImport, xmloff::OButtonImport, xmloff::OValueRangeImport, and xmloff::OTextLikeImport.
Definition at line 742 of file elementimport.cxx.
References xmloff::OValuePropertiesMetaData::getValueLimitPropertyNames(), xmloff::OValuePropertiesMetaData::getValuePropertyNames(), xmloff::OPropertyImport::implPushBackPropertyValue(), implTranslateValueProperty(), m_aValueProperties, m_eElementType, xmloff::OElementImport::m_xElement, xmloff::OElementImport::m_xInfo, m_xOuterAttributes, xmloff::PROPERTY_CLASSID, PROPID_CURRENT_VALUE, PROPID_MAX_VALUE, PROPID_MIN_VALUE, PROPID_VALUE, SAL_WARN, and xmloff::OElementImport::startFastElement().
Referenced by xmloff::OListAndComboImport::startFastElement(), xmloff::OImagePositionImport::startFastElement(), xmloff::OReferredControlImport::startFastElement(), xmloff::OValueRangeImport::startFastElement(), and xmloff::OTextLikeImport::startFastElement().
|
protected |
Definition at line 172 of file elementimport.hxx.
Referenced by handleAttribute(), and startFastElement().
|
protected |
Definition at line 170 of file elementimport.hxx.
Referenced by xmloff::OTextLikeImport::createFastChildContext(), determineDefaultServiceName(), endFastElement(), xmloff::OListAndComboImport::endFastElement(), xmloff::OURLReferenceImport::handleAttribute(), xmloff::OListAndComboImport::handleAttribute(), xmloff::OListAndComboImport::OListAndComboImport(), setElementType(), xmloff::OListAndComboImport::startFastElement(), and startFastElement().
|
protected |
name of a value binding (xforms:bind attribute)
Definition at line 187 of file elementimport.hxx.
Referenced by endFastElement(), and handleAttribute().
|
protected |
the address of the calc cell which the control model should be bound to, if applicable
Definition at line 184 of file elementimport.hxx.
Referenced by endFastElement(), and handleAttribute().
|
protected |
Definition at line 169 of file elementimport.hxx.
Referenced by endFastElement(), and handleAttribute().
|
protected |
name of a list binding (form:xforms-list-source attribute)
Definition at line 190 of file elementimport.hxx.
Referenced by endFastElement(), and handleAttribute().
|
protected |
name of a submission (xforms:submission attribute)
Definition at line 193 of file elementimport.hxx.
Referenced by endFastElement(), and handleAttribute().
|
protected |
Definition at line 179 of file elementimport.hxx.
Referenced by addOuterAttributes(), and startFastElement().