LibreOffice Module xmloff (master) 1
|
implements common behaviour for importing forms, controls and columns More...
#include <elementimport.hxx>
Public Member Functions | |
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 | |
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 Attributes | |
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 |
Private Member Functions | |
OUString | implGetDefaultName () const |
void | implApplyGenericProperties () |
void | implApplySpecificProperties () |
PropertyGroups::const_iterator | impl_matchPropertyGroup (const PropertyGroups &i_propertyGroups) const |
virtual OUString | determineDefaultServiceName () const |
Additional Inherited Members | |
Protected Types inherited from xmloff::OPropertyImport | |
typedef ::std::vector< css::beans::PropertyValue > | PropertyValueArray |
implements common behaviour for importing forms, controls and columns
Definition at line 65 of file elementimport.hxx.
xmloff::OElementImport::OElementImport | ( | OFormLayerXMLImport_Impl & | _rImport, |
IEventAttacherManager & | _rEventManager, | ||
const css::uno::Reference< css::container::XNameContainer > & | _rxParentContainer | ||
) |
ctor
_rImport | the importer |
_rEventManager | the event attacher manager for the control being imported |
_rAttributeMap | the attribute map to be used for translating attributes into properties |
_rxParentContainer | the container in which the new element should be inserted |
Definition at line 118 of file elementimport.cxx.
References m_xParentContainer, and m_xParentContainer.
|
overridevirtual |
Definition at line 130 of file elementimport.cxx.
|
protectedvirtual |
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 in xmloff::OControlImport, xmloff::OGridImport, and xmloff::OFormImport.
Definition at line 558 of file elementimport.cxx.
References OUStringToOString().
Referenced by xmloff::OControlImport::createElement(), xmloff::OFormImport::createElement(), and startFastElement().
|
overrideprotectedvirtual |
Reimplemented from xmloff::OPropertyImport.
Reimplemented in xmloff::OListAndComboImport, xmloff::OGridImport, xmloff::OFormImport, and xmloff::OTextLikeImport.
Definition at line 168 of file elementimport.cxx.
References xmloff::OPropertyImport::createFastChildContext(), xmloff::OFormLayerXMLImport_Impl::getGlobalContext(), m_rFormImport, OFFICE, XML_ELEMENT, and xmloff::token::XML_EVENT_LISTENERS.
Referenced by xmloff::OListAndComboImport::createFastChildContext(), xmloff::OGridImport::createFastChildContext(), xmloff::OFormImport::createFastChildContext(), and xmloff::OTextLikeImport::createFastChildContext().
|
privatevirtual |
Reimplemented in xmloff::OControlImport, and xmloff::OFormImport.
Definition at line 134 of file elementimport.cxx.
Referenced by startFastElement().
|
inlineprotected |
controls whether |handleAttribute| implicitly calls |tryGenericAttribute|, or whether the derived class must do this explicitly at a suitable place in its own |handleAttribute|
Definition at line 149 of file elementimport.hxx.
References m_bImplicitGenericAttributeHandling.
|
overrideprotectedvirtual |
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 SvXMLImportContext.
Reimplemented in xmloff::OControlImport, xmloff::OTextLikeImport, xmloff::OListAndComboImport, xmloff::OGridImport, and xmloff::OFormImport.
Definition at line 178 of file elementimport.cxx.
References Any, xmloff::OFormLayerXMLImport_Impl::applyControlNumberStyle(), XMLTextStyleContext::GetDataStyleName(), implApplyGenericProperties(), implApplySpecificProperties(), implGetDefaultName(), LEAVE_LOG_CONTEXT, m_pStyleElement, xmloff::OPropertyImport::m_rContext, m_sName, m_xElement, and m_xParentContainer.
Referenced by xmloff::OControlImport::endFastElement(), and xmloff::OFormImport::endFastElement().
|
overrideprotectedvirtual |
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::OPropertyImport.
Reimplemented in xmloff::OControlImport, xmloff::OImagePositionImport, xmloff::OReferredControlImport, xmloff::OPasswordImport, xmloff::ORadioImport, xmloff::OURLReferenceImport, xmloff::OValueRangeImport, xmloff::OListAndComboImport, and xmloff::OFormImport.
Definition at line 525 of file elementimport.cxx.
References m_rContext, m_sName, TOKEN_MASK, xmloff::token::XML_CONTROL_IMPLEMENTATION, xmloff::token::XML_NAME, and xmloff::token::XML_TEXT_STYLE_NAME.
Referenced by xmloff::OControlImport::handleAttribute(), and xmloff::OFormImport::handleAttribute().
|
private |
Definition at line 464 of file elementimport.cxx.
References ENSURE_OR_RETURN, and m_xInfo.
|
private |
Definition at line 297 of file elementimport.cxx.
References Any, DBG_UNHANDLED_EXCEPTION, Exception, getSequenceElementType(), xmloff::OPropertyImport::m_aGenericValues, m_xElement, m_xInfo, OUStringToOString(), Property, SAL_WARN, and SAL_WARN_IF.
Referenced by endFastElement().
|
private |
Definition at line 216 of file elementimport.cxx.
References Any, DBG_UNHANDLED_EXCEPTION, Exception, xmloff::OPropertyImport::m_aValues, m_xElement, m_xInfo, OUStringToOString(), and pValues.
Referenced by endFastElement().
|
private |
Definition at line 441 of file elementimport.cxx.
References comphelper::findValue(), i, m_xParentContainer, and u.
Referenced by endFastElement().
|
overrideprotectedvirtual |
Implements xmloff::IEventAttacher.
Definition at line 577 of file elementimport.cxx.
References m_xElement.
|
protected |
can be used to handle properties where the attribute default and the property default differ.
In such case, if the property had the attribute default upon writing, nothing is read, so upon reading, the property is still at its own default (which is not the attribute default).
This method, if told the attribute and the property, and the (implied) attribute default, sets the property value as if the attribute was encountered.
Definition at line 583 of file elementimport.cxx.
References FORM, m_xInfo, TOKEN_MASK, and XML_ELEMENT.
Referenced by xmloff::OListAndComboImport::startFastElement(), xmloff::OButtonImport::startFastElement(), xmloff::OTextLikeImport::startFastElement(), and xmloff::OFormImport::startFastElement().
|
overrideprotectedvirtual |
Reimplemented from xmloff::OPropertyImport.
Reimplemented in xmloff::OListAndComboImport, xmloff::OImagePositionImport, xmloff::OReferredControlImport, xmloff::OButtonImport, xmloff::OValueRangeImport, xmloff::OTextLikeImport, xmloff::OControlImport, and xmloff::OFormImport.
Definition at line 139 of file elementimport.cxx.
References createElement(), determineDefaultServiceName(), ENTER_LOG_CONTEXT, FORM, SvXMLImportContext::GetImport(), m_sServiceName, m_xElement, m_xInfo, xmloff::OPropertyImport::startFastElement(), xmloff::token::XML_CONTROL_IMPLEMENTATION, XML_ELEMENT, and XML_NAMESPACE_OOO.
Referenced by xmloff::OControlImport::startFastElement(), and xmloff::OFormImport::startFastElement().
|
protected |
to be called from within handleAttribute, checks whether the given attribute is covered by our generic attribute handler mechanisms
Definition at line 475 of file elementimport.cxx.
References Any, attribute, first, xmloff::metadata::getAttributeDescription(), xmloff::metadata::getPropertyGroupList(), pos, SAL_WARN, and xmloff::token::XML_TOKEN_INVALID.
Referenced by xmloff::OControlImport::handleAttribute().
|
protected |
Definition at line 89 of file elementimport.hxx.
Referenced by disableImplicitGenericAttributeHandling().
|
protected |
Definition at line 76 of file elementimport.hxx.
Referenced by endFastElement().
|
protected |
Definition at line 74 of file elementimport.hxx.
|
protected |
Definition at line 73 of file elementimport.hxx.
Referenced by createFastChildContext(), xmloff::OGridImport::createFastChildContext(), xmloff::OFormImport::createFastChildContext(), xmloff::OControlImport::endFastElement(), xmloff::OFormImport::endFastElement(), xmloff::OReferredControlImport::startFastElement(), and xmloff::OFormImport::startFastElement().
|
protected |
Definition at line 72 of file elementimport.hxx.
Referenced by endFastElement().
|
protected |
Definition at line 71 of file elementimport.hxx.
Referenced by startFastElement().
|
protected |
the element we're creating. Valid after StartElement
Definition at line 85 of file elementimport.hxx.
Referenced by xmloff::OFormImport::createFastChildContext(), xmloff::OTextLikeImport::createFastChildContext(), xmloff::OControlImport::doRegisterCellValueBinding(), xmloff::OControlImport::doRegisterXFormsListBinding(), xmloff::OControlImport::doRegisterXFormsSubmission(), xmloff::OControlImport::doRegisterXFormsValueBinding(), endFastElement(), xmloff::OControlImport::endFastElement(), xmloff::OListAndComboImport::endFastElement(), implApplyGenericProperties(), implApplySpecificProperties(), xmloff::OTextLikeImport::removeRedundantCurrentValue(), xmloff::OReferredControlImport::startFastElement(), xmloff::OValueRangeImport::startFastElement(), xmloff::OTextLikeImport::startFastElement(), startFastElement(), and xmloff::OControlImport::startFastElement().
|
protected |
Definition at line 87 of file elementimport.hxx.
Referenced by xmloff::OControlImport::createElement(), impl_matchPropertyGroup(), implApplyGenericProperties(), implApplySpecificProperties(), xmloff::OTextLikeImport::removeRedundantCurrentValue(), xmloff::OValueRangeImport::startFastElement(), xmloff::OTextLikeImport::startFastElement(), startFastElement(), and xmloff::OControlImport::startFastElement().
|
protected |
the parent container to insert the new element into
Definition at line 81 of file elementimport.hxx.
Referenced by endFastElement(), implGetDefaultName(), and OElementImport().