LibreOffice Module xmloff (master)  1
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
xmloff::OPropertyImport Class Reference

Helper class for importing property values. More...

#include <propertyimport.hxx>

Inheritance diagram for xmloff::OPropertyImport:
[legend]
Collaboration diagram for xmloff::OPropertyImport:
[legend]

Public Member Functions

 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 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< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext (const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
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
 

Protected Types

typedef ::std::vector< css::beans::PropertyValue > PropertyValueArray
 

Protected Member Functions

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
SvXMLImportGetImport ()
 
const SvXMLImportGetImport () const
 

Protected Attributes

PropertyValueArray m_aValues
 
PropertyValueArray m_aGenericValues
 
o3tl::sorted_vector< sal_Int32 > m_aEncounteredAttributes
 
OFormLayerXMLImport_Implm_rContext
 
bool m_bTrackAttributes
 

Friends

class OSinglePropertyContext
 
class OListPropertyContext
 

Detailed Description

Helper class for importing property values.

This class imports properties which are stored as attributes as well as properties which are stored in <form:properties> elements.

Definition at line 71 of file propertyimport.hxx.

Member Typedef Documentation

typedef ::std::vector< css::beans::PropertyValue > xmloff::OPropertyImport::PropertyValueArray
protected

Definition at line 77 of file propertyimport.hxx.

Constructor & Destructor Documentation

xmloff::OPropertyImport::OPropertyImport ( OFormLayerXMLImport_Impl _rImport)

Definition at line 256 of file propertyimport.cxx.

References m_rContext.

Member Function Documentation

void xmloff::OPropertyImport::characters ( const OUString &  aChars)
overridevirtual

This method is called for all characters that are contained in the current element.

The default is to ignore them.

Reimplemented from SvXMLImportContext.

Definition at line 302 of file propertyimport.cxx.

css::uno::Reference< css::xml::sax::XFastContextHandler > xmloff::OPropertyImport::createFastChildContext ( sal_Int32  nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList > &  AttrList 
)
overridevirtual
void xmloff::OPropertyImport::enableTrackAttributes ( )
inlineprotected

enables the tracking of the encountered attributes

The tracking will raise the import costs a little bit, but it's cheaper than derived classes tracking this themself.

Definition at line 131 of file propertyimport.hxx.

Referenced by xmloff::OButtonImport::OButtonImport(), xmloff::OFormImport::OFormImport(), xmloff::OListAndComboImport::OListAndComboImport(), and xmloff::OTextLikeImport::OTextLikeImport().

bool xmloff::OPropertyImport::encounteredAttribute ( sal_Int32  nElement) const
protected

determine if the element imported by the object had a given attribute.

Please be aware of the fact that the name given must be a local name, i.e. not contain a namespace. All form relevant attributes are in the same namespace, so this would be a redundant information.

Definition at line 296 of file propertyimport.cxx.

References o3tl::sorted_vector< Value, Compare, Find, class >::end(), o3tl::sorted_vector< Value, Compare, Find, class >::find(), m_aEncounteredAttributes, m_bTrackAttributes, and TOKEN_MASK.

Referenced by xmloff::OElementImport::simulateDefaultedAttribute().

bool xmloff::OPropertyImport::handleAttribute ( sal_Int32  nElement,
const OUString &  _rValue 
)
protectedvirtual

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.

Parameters
_nNamespaceKeykey of the namespace used in the attribute
_rLocalNamelocal (relative to the namespace) attribute name
_rValueattribute value

Reimplemented in xmloff::OFormImport, xmloff::OListAndComboImport, xmloff::OValueRangeImport, xmloff::OURLReferenceImport, xmloff::ORadioImport, xmloff::OPasswordImport, xmloff::OReferredControlImport, xmloff::OImagePositionImport, xmloff::OControlImport, and xmloff::OElementImport.

Definition at line 308 of file propertyimport.cxx.

References xmloff::OAttribute2Property::AttributeAssignment::aPropertyType, xmloff::OAttribute2Property::AttributeAssignment::bInverseSemantics, xmloff::PropertyConversion::convertString(), SvXMLImport::GetAbsoluteReference(), xmloff::OFormLayerXMLImport_Impl::getAttributeMap(), xmloff::OAttribute2Property::getAttributeTranslation(), xmloff::OFormLayerXMLImport_Impl::getGlobalContext(), SvXMLImport::getPrefixAndNameFromToken(), implPushBackPropertyValue(), m_rContext, xmloff::OAttribute2Property::AttributeAssignment::pEnumMap, SAL_WARN, xmloff::OAttribute2Property::AttributeAssignment::sPropertyName, TOKEN_MASK, xmloff::token::XML_HREF, and xmloff::token::XML_TYPE.

Referenced by xmloff::OElementImport::handleAttribute(), and startFastElement().

void xmloff::OPropertyImport::implPushBackGenericPropertyValue ( const css::beans::PropertyValue &  _rProp)
inlineprotected

Definition at line 144 of file propertyimport.hxx.

void xmloff::OPropertyImport::implPushBackPropertyValue ( const css::beans::PropertyValue &  _rProp)
inlineprotected
void xmloff::OPropertyImport::implPushBackPropertyValue ( const OUString &  _rName,
const css::uno::Any &  _rValue 
)
inlineprotected

Definition at line 138 of file propertyimport.hxx.

void xmloff::OPropertyImport::startFastElement ( sal_Int32  nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList > &  _rxAttrList 
)
overridevirtual

Friends And Related Function Documentation

friend class OListPropertyContext
friend

Definition at line 74 of file propertyimport.hxx.

friend class OSinglePropertyContext
friend

Definition at line 73 of file propertyimport.hxx.

Member Data Documentation

o3tl::sorted_vector<sal_Int32> xmloff::OPropertyImport::m_aEncounteredAttributes
protected

Definition at line 82 of file propertyimport.hxx.

Referenced by encounteredAttribute(), and startFastElement().

PropertyValueArray xmloff::OPropertyImport::m_aGenericValues
protected
PropertyValueArray xmloff::OPropertyImport::m_aValues
protected
bool xmloff::OPropertyImport::m_bTrackAttributes
protected

Definition at line 86 of file propertyimport.hxx.

Referenced by encounteredAttribute(), and startFastElement().

OFormLayerXMLImport_Impl& xmloff::OPropertyImport::m_rContext
protected

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