LibreOffice Module xmloff (master)  1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
xmloff::OAttribute2Property Class Referencefinal

some kind of opposite to the OAttributeMetaData class. More...

#include <formattributes.hxx>

Classes

struct  AttributeAssignment
 

Public Member Functions

 OAttribute2Property ()
 
 ~OAttribute2Property ()
 
const AttributeAssignmentgetAttributeTranslation (sal_Int32 nAttributeToken)
 return the AttributeAssignment which corresponds to the given attribute More...
 
void addStringProperty (sal_Int32 nAttributeToken, const OUString &_rPropertyName)
 add an attribute assignment referring to a string property to the map More...
 
void addBooleanProperty (sal_Int32 nAttributeToken, const OUString &_rPropertyName, const bool _bAttributeDefault, const bool _bInverseSemantics=false)
 add an attribute assignment referring to a boolean property to the map More...
 
void addInt16Property (sal_Int32 nAttributeToken, const OUString &_rPropertyName)
 add an attribute assignment referring to an int16 property to the map More...
 
void addInt32Property (sal_Int32 nAttributeToken, const OUString &_rPropertyName)
 add an attribute assignment referring to an int32 property to the map More...
 
template<typename EnumT >
void addEnumProperty (sal_Int32 nAttributeToken, const OUString &_rPropertyName, const SvXMLEnumMapEntry< EnumT > *_pValueMap, const css::uno::Type *_pType=nullptr)
 add an attribute assignment referring to an enum property to the map More...
 

Private Member Functions

void addEnumPropertyImpl (sal_Int32 nAttributeToken, const OUString &_rPropertyName, const SvXMLEnumMapEntry< sal_uInt16 > *_pValueMap, const css::uno::Type *_pType)
 
AttributeAssignmentimplAdd (sal_Int32 nAttributeToken, const OUString &_rPropertyName, const css::uno::Type &_rType)
 some common code for the various add*Property methods More...
 

Private Attributes

std::map< sal_Int32, AttributeAssignmentm_aKnownProperties
 

Detailed Description

some kind of opposite to the OAttributeMetaData class.

Able to translate attributes into property names/types

The construction of this class is rather expensive (or at least it's initialization from outside), so it should be shared

Definition at line 303 of file formattributes.hxx.

Constructor & Destructor Documentation

xmloff::OAttribute2Property::OAttribute2Property ( )

Definition at line 333 of file formattributes.cxx.

xmloff::OAttribute2Property::~OAttribute2Property ( )

Definition at line 337 of file formattributes.cxx.

Member Function Documentation

void xmloff::OAttribute2Property::addBooleanProperty ( sal_Int32  nAttributeToken,
const OUString &  _rPropertyName,
const bool  _bAttributeDefault,
const bool  _bInverseSemantics = false 
)

add an attribute assignment referring to a boolean property to the map

Parameters
_pAttributeNamethe name of the attribute
_rPropertyNamethe name of the property assigned to the attribute
_bAttributeDefaultthe default value for the attribute.
_bInverseSemanticsif <TRUE>, an attribute value of <TRUE> means a property value of <FALSE> and vice verse.
if <FALSE>, the attribute value is used as property value directly

Definition at line 356 of file formattributes.cxx.

References xmloff::OAttribute2Property::AttributeAssignment::bInverseSemantics.

Referenced by xmloff::OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl().

template<typename EnumT >
void xmloff::OAttribute2Property::addEnumProperty ( sal_Int32  nAttributeToken,
const OUString &  _rPropertyName,
const SvXMLEnumMapEntry< EnumT > *  _pValueMap,
const css::uno::Type *  _pType = nullptr 
)
inline

add an attribute assignment referring to an enum property to the map

Parameters
_pAttributeNamethe name of the attribute
_rPropertyNamethe name of the property assigned to the attribute
_pValueMapthe map to translate strings into enum values
_pTypethe type of the property. May be NULL, in this case 32bit integer is assumed.

Definition at line 393 of file formattributes.hxx.

References addEnumPropertyImpl().

Referenced by xmloff::OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl().

void xmloff::OAttribute2Property::addEnumPropertyImpl ( sal_Int32  nAttributeToken,
const OUString &  _rPropertyName,
const SvXMLEnumMapEntry< sal_uInt16 > *  _pValueMap,
const css::uno::Type *  _pType 
)
private
void xmloff::OAttribute2Property::addInt16Property ( sal_Int32  nAttributeToken,
const OUString &  _rPropertyName 
)

add an attribute assignment referring to an int16 property to the map

Parameters
_pAttributeNamethe name of the attribute
_rPropertyNamethe name of the property assigned to the attribute

Definition at line 364 of file formattributes.cxx.

Referenced by xmloff::OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl().

void xmloff::OAttribute2Property::addInt32Property ( sal_Int32  nAttributeToken,
const OUString &  _rPropertyName 
)

add an attribute assignment referring to an int32 property to the map

Parameters
_pAttributeNamethe name of the attribute
_rPropertyNamethe name of the property assigned to the attribute

Definition at line 370 of file formattributes.cxx.

Referenced by xmloff::OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl().

void xmloff::OAttribute2Property::addStringProperty ( sal_Int32  nAttributeToken,
const OUString &  _rPropertyName 
)

add an attribute assignment referring to a string property to the map

Parameters
_pAttributeNamethe name of the attribute
_rPropertyNamethe name of the property assigned to the attribute

Definition at line 350 of file formattributes.cxx.

Referenced by xmloff::OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl().

const OAttribute2Property::AttributeAssignment * xmloff::OAttribute2Property::getAttributeTranslation ( sal_Int32  nAttributeToken)

return the AttributeAssignment which corresponds to the given attribute

Returns
a pointer to the <type>AttributeAssignment</type> structure as requested, NULL if the attribute does not represent a property.

Definition at line 341 of file formattributes.cxx.

References TOKEN_MASK.

Referenced by xmloff::OPropertyImport::handleAttribute(), and xmloff::ORadioImport::handleAttribute().

OAttribute2Property::AttributeAssignment & xmloff::OAttribute2Property::implAdd ( sal_Int32  nAttributeToken,
const OUString &  _rPropertyName,
const css::uno::Type &  _rType 
)
private

some common code for the various add*Property methods

Definition at line 386 of file formattributes.cxx.

References xmloff::OAttribute2Property::AttributeAssignment::sPropertyName, and TOKEN_MASK.

Member Data Documentation

std::map<sal_Int32, AttributeAssignment> xmloff::OAttribute2Property::m_aKnownProperties
private

Definition at line 322 of file formattributes.hxx.


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