LibreOffice Module xmloff (master)  1
Classes | Public Member Functions | Private Types | 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 (const OUString &_rAttribName)
 return the AttributeAssignment which corresponds to the given attribute More...
 
void addStringProperty (const char *_pAttributeName, const OUString &_rPropertyName)
 add an attribute assignment referring to a string property to the map More...
 
void addBooleanProperty (const char *_pAttributeName, 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 (const char *_pAttributeName, const OUString &_rPropertyName)
 add an attribute assignment referring to an int16 property to the map More...
 
void addInt32Property (const char *_pAttributeName, const OUString &_rPropertyName)
 add an attribute assignment referring to an int32 property to the map More...
 
template<typename EnumT >
void addEnumProperty (const char *_pAttributeName, 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 Types

typedef std::map< OUString, AttributeAssignmentAttributeAssignments
 

Private Member Functions

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

Private Attributes

AttributeAssignments m_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 272 of file formattributes.hxx.

Member Typedef Documentation

Definition at line 291 of file formattributes.hxx.

Constructor & Destructor Documentation

xmloff::OAttribute2Property::OAttribute2Property ( )

Definition at line 198 of file formattributes.cxx.

xmloff::OAttribute2Property::~OAttribute2Property ( )

Definition at line 202 of file formattributes.cxx.

Member Function Documentation

void xmloff::OAttribute2Property::addBooleanProperty ( const char *  _pAttributeName,
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 221 of file formattributes.cxx.

References xmloff::OAttribute2Property::AttributeAssignment::bInverseSemantics, and implAdd().

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

template<typename EnumT >
void xmloff::OAttribute2Property::addEnumProperty ( const char *  _pAttributeName,
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 366 of file formattributes.hxx.

References addEnumPropertyImpl().

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

void xmloff::OAttribute2Property::addEnumPropertyImpl ( const char *  _pAttributeName,
const OUString &  _rPropertyName,
const SvXMLEnumMapEntry< sal_uInt16 > *  _pValueMap,
const css::uno::Type *  _pType 
)
private
void xmloff::OAttribute2Property::addInt16Property ( const char *  _pAttributeName,
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 229 of file formattributes.cxx.

References implAdd().

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

void xmloff::OAttribute2Property::addInt32Property ( const char *  _pAttributeName,
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 235 of file formattributes.cxx.

References implAdd().

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

void xmloff::OAttribute2Property::addStringProperty ( const char *  _pAttributeName,
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 215 of file formattributes.cxx.

References implAdd().

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

const OAttribute2Property::AttributeAssignment * xmloff::OAttribute2Property::getAttributeTranslation ( const OUString &  _rAttribName)

return the AttributeAssignment which corresponds to the given attribute

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

Definition at line 206 of file formattributes.cxx.

References m_aKnownProperties.

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

OAttribute2Property::AttributeAssignment & xmloff::OAttribute2Property::implAdd ( const char *  _pAttributeName,
const OUString &  _rPropertyName,
const css::uno::Type &  _rType 
)
private

Member Data Documentation

AttributeAssignments xmloff::OAttribute2Property::m_aKnownProperties
private

Definition at line 292 of file formattributes.hxx.

Referenced by getAttributeTranslation(), and implAdd().


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