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, sal_uInt16 _nPrefix, const OUString &_rName)
 
virtual SvXMLImportContextRef CreateChildContext (sal_uInt16 _nPrefix, const OUString &_rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &_rxAttrList) override
 Create a children element context. More...
 
virtual void StartElement (const css::uno::Reference< css::xml::sax::XAttributeList > &_rxAttrList) override
 StartElement is called after a context has been constructed and before an elements context is parsed. More...
 
virtual void 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
bool IsPrefixFilledIn () const
 
sal_uInt16 GetPrefix () const
 
const OUString & GetLocalName () const
 
 SvXMLImportContext (SvXMLImport &rImport, sal_uInt16 nPrfx, const OUString &rLName)
 A contexts constructor does anything that is required if an element starts. More...
 
 SvXMLImportContext (SvXMLImport &rImport)
 
virtual ~SvXMLImportContext ()
 A contexts destructor does anything that is required if an element ends. More...
 
virtual void EndElement ()
 EndElement is called before a context will be destructed, but after an elements context has been parsed. 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
 
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
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &aType) final override
 
virtual void SAL_CALL acquire () final override throw ()
 
virtual void SAL_CALL release () final override throw ()
 
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_uInt16 _nNamespaceKey, const OUString &_rLocalName, const OUString &_rValue)
 handle one single attribute. More...
 
bool encounteredAttribute (const OUString &_rAttributeName) 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
 
std::set< OUString > 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 72 of file propertyimport.hxx.

Member Typedef Documentation

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

Definition at line 78 of file propertyimport.hxx.

Constructor & Destructor Documentation

xmloff::OPropertyImport::OPropertyImport ( OFormLayerXMLImport_Impl _rImport,
sal_uInt16  _nPrefix,
const OUString &  _rName 
)

Definition at line 253 of file propertyimport.cxx.

References m_rContext.

Member Function Documentation

void xmloff::OPropertyImport::Characters ( const OUString &  rChars)
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 303 of file propertyimport.cxx.

SvXMLImportContextRef xmloff::OPropertyImport::CreateChildContext ( sal_uInt16  nPrefix,
const OUString &  rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList > &  xAttrList 
)
overridevirtual

Create a children element context.

By default, the import's CreateContext method is called to create a new default context.

Reimplemented from SvXMLImportContext.

Reimplemented in xmloff::OFormImport, xmloff::OGridImport, xmloff::OListAndComboImport, xmloff::OTextLikeImport, and xmloff::OElementImport.

Definition at line 260 of file propertyimport.cxx.

References xmloff::OFormLayerXMLImport_Impl::getGlobalContext(), xmloff::token::IsXMLToken(), m_rContext, and xmloff::token::XML_PROPERTIES.

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

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 133 of file propertyimport.hxx.

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

bool xmloff::OPropertyImport::encounteredAttribute ( const OUString &  _rAttributeName) 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 297 of file propertyimport.cxx.

References m_aEncounteredAttributes, and m_bTrackAttributes.

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

bool xmloff::OPropertyImport::handleAttribute ( sal_uInt16  _nNamespaceKey,
const OUString &  _rLocalName,
const OUString &  _rValue 
)
protectedvirtual
void xmloff::OPropertyImport::implPushBackGenericPropertyValue ( const css::beans::PropertyValue &  _rProp)
inlineprotected

Definition at line 146 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 140 of file propertyimport.hxx.

void xmloff::OPropertyImport::StartElement ( const css::uno::Reference< css::xml::sax::XAttributeList > &  xAttrList)
overridevirtual

Friends And Related Function Documentation

friend class OListPropertyContext
friend

Definition at line 75 of file propertyimport.hxx.

friend class OSinglePropertyContext
friend

Definition at line 74 of file propertyimport.hxx.

Member Data Documentation

std::set<OUString> xmloff::OPropertyImport::m_aEncounteredAttributes
protected

Definition at line 83 of file propertyimport.hxx.

Referenced by encounteredAttribute(), and StartElement().

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

Definition at line 87 of file propertyimport.hxx.

Referenced by encounteredAttribute(), and StartElement().

OFormLayerXMLImport_Impl& xmloff::OPropertyImport::m_rContext
protected

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