LibreOffice Module xmloff (master)  1
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
XMLPropertyHandlerFactory Class Reference

This class is a base-class to create XMLPropertyHandler. More...

#include <prhdlfac.hxx>

Inheritance diagram for XMLPropertyHandlerFactory:
[legend]
Collaboration diagram for XMLPropertyHandlerFactory:
[legend]

Classes

struct  Impl
 

Public Member Functions

 XMLPropertyHandlerFactory ()
 
virtual ~XMLPropertyHandlerFactory () override
 
virtual const XMLPropertyHandlerGetPropertyHandler (sal_Int32 nType) const
 This method retrieves a PropertyHandler for the given XML-type. More...
 
- Public Member Functions inherited from salhelper::SimpleReferenceObject
 SimpleReferenceObject ()
 
void acquire ()
 
void release ()
 

Static Public Member Functions

static std::unique_ptr< XMLPropertyHandlerCreatePropertyHandler (sal_Int32 nType)
 helper method to statically create a property handler; this will not use the handler cache. More...
 
- Static Public Member Functions inherited from salhelper::SimpleReferenceObject
static voidoperator new (std::size_t nSize)
 
static voidoperator new (std::size_t nSize, std::nothrow_t const &rNothrow)
 
static void operator delete (void *pPtr)
 
static void operator delete (void *pPtr, std::nothrow_t const &rNothrow)
 

Protected Member Functions

const XMLPropertyHandlerGetHdlCache (sal_Int32 nType) const
 Retrieves a PropertyHandler from the internal cache. More...
 
void PutHdlCache (sal_Int32 nType, const XMLPropertyHandler *pHdl) const
 Puts a PropertyHandler into the internal cache. More...
 
- Protected Member Functions inherited from salhelper::SimpleReferenceObject
virtual ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE
 

Private Member Functions

 XMLPropertyHandlerFactory (const XMLPropertyHandlerFactory &)=delete
 
XMLPropertyHandlerFactoryoperator= (const XMLPropertyHandlerFactory &)=delete
 
SAL_DLLPRIVATE const XMLPropertyHandlerGetBasicHandler (sal_Int32 nType) const
 Retrieves ( creates if necessary ) PropertyHandler for basic XML-types. More...
 

Private Attributes

std::unique_ptr< ImplmpImpl
 

Additional Inherited Members

- Protected Attributes inherited from salhelper::SimpleReferenceObject
oslInterlockedCount m_nCount
 

Detailed Description

This class is a base-class to create XMLPropertyHandler.

It creates PropertyHandler for given XML-types and store them in an internal cache. They'll be deleted at destruction- time. For create your own PropertyHandler for specific XML-types you have to override the virtual method GetPropertyHandler ( see below ).

Definition at line 40 of file prhdlfac.hxx.

Constructor & Destructor Documentation

XMLPropertyHandlerFactory::XMLPropertyHandlerFactory ( const XMLPropertyHandlerFactory )
privatedelete
XMLPropertyHandlerFactory::XMLPropertyHandlerFactory ( )

Definition at line 128 of file prhdlfac.cxx.

XMLPropertyHandlerFactory::~XMLPropertyHandlerFactory ( )
overridevirtual

Definition at line 131 of file prhdlfac.cxx.

References mpImpl.

Member Function Documentation

std::unique_ptr< XMLPropertyHandler > XMLPropertyHandlerFactory::CreatePropertyHandler ( sal_Int32  nType)
static

helper method to statically create a property handler; this will not use the handler cache.

This method should only be called in special circumstances; calling GetPropertyHandler is almost always preferable.

Definition at line 173 of file prhdlfac.cxx.

References xmloff::token::GetXMLToken(), xmloff::token::XML_ALWAYS, xmloff::token::XML_AUTO, xmloff::token::XML_FONT_COLOR, xmloff::token::XML_LR_TB, xmloff::token::XML_NONE, xmloff::token::XML_PAGE, xmloff::token::XML_SOLID, xmloff::token::XML_TOKEN_INVALID, xmloff::token::XML_TRUE, XML_TYPE_ATTRIBUTE_CONTAINER, XML_TYPE_BOOL, XML_TYPE_BOOL_FALSE, XML_TYPE_BORDER, XML_TYPE_BORDER_WIDTH, XML_TYPE_BUILDIN_CMP_ONLY, XML_TYPE_CHAR_COUNTRY, XML_TYPE_CHAR_HEIGHT, XML_TYPE_CHAR_HEIGHT_DIFF, XML_TYPE_CHAR_HEIGHT_PROP, XML_TYPE_CHAR_LANGUAGE, XML_TYPE_CHAR_RFC_LANGUAGE_TAG, XML_TYPE_CHAR_SCRIPT, XML_TYPE_COLOR, XML_TYPE_COLOR_MODE, XML_TYPE_COLORAUTO, XML_TYPE_COLORTRANSPARENT, XML_TYPE_DOUBLE, XML_TYPE_DOUBLE_PERCENT, XML_TYPE_DURATION16_MS, XML_TYPE_HEX, XML_TYPE_ISAUTOCOLOR, XML_TYPE_ISTRANSPARENT, XML_TYPE_LINE_SPACE_DISTANCE, XML_TYPE_LINE_SPACE_FIXED, XML_TYPE_LINE_SPACE_MINIMUM, XML_TYPE_MEASURE, XML_TYPE_MEASURE16, XML_TYPE_MEASURE8, XML_TYPE_MEASURE_PX, XML_TYPE_NBOOL, XML_TYPE_NEG_PERCENT, XML_TYPE_NEG_PERCENT16, XML_TYPE_NEG_PERCENT8, XML_TYPE_NUMBER, XML_TYPE_NUMBER16, XML_TYPE_NUMBER16_AUTO, XML_TYPE_NUMBER16_NO_ZERO, XML_TYPE_NUMBER16_NONE, XML_TYPE_NUMBER8, XML_TYPE_NUMBER8_NO_ZERO, XML_TYPE_NUMBER8_NONE, XML_TYPE_NUMBER_NO_ZERO, XML_TYPE_NUMBER_NONE, XML_TYPE_PERCENT, XML_TYPE_PERCENT16, XML_TYPE_PERCENT8, XML_TYPE_RECTANGLE_HEIGHT, XML_TYPE_RECTANGLE_LEFT, XML_TYPE_RECTANGLE_TOP, XML_TYPE_RECTANGLE_WIDTH, XML_TYPE_STRING, XML_TYPE_STYLENAME, XML_TYPE_TEXT_ADJUST, XML_TYPE_TEXT_ADJUSTLAST, XML_TYPE_TEXT_BOOLCROSSEDOUT, XML_TYPE_TEXT_BREAKAFTER, XML_TYPE_TEXT_BREAKBEFORE, XML_TYPE_TEXT_CASEMAP, XML_TYPE_TEXT_CASEMAP_VAR, XML_TYPE_TEXT_CROSSEDOUT_STYLE, XML_TYPE_TEXT_CROSSEDOUT_TEXT, XML_TYPE_TEXT_CROSSEDOUT_TYPE, XML_TYPE_TEXT_CROSSEDOUT_WIDTH, XML_TYPE_TEXT_DRAW_ASPECT, XML_TYPE_TEXT_ESCAPEMENT, XML_TYPE_TEXT_ESCAPEMENT_HEIGHT, XML_TYPE_TEXT_FONTENCODING, XML_TYPE_TEXT_FONTFAMILY, XML_TYPE_TEXT_FONTFAMILYNAME, XML_TYPE_TEXT_FONTPITCH, XML_TYPE_TEXT_HIDDEN_AS_DISPLAY, XML_TYPE_TEXT_HORIZONTAL_ADJUST, XML_TYPE_TEXT_KERNING, XML_TYPE_TEXT_OVERLINE_COLOR, XML_TYPE_TEXT_OVERLINE_HASCOLOR, XML_TYPE_TEXT_OVERLINE_STYLE, XML_TYPE_TEXT_OVERLINE_TYPE, XML_TYPE_TEXT_OVERLINE_WIDTH, XML_TYPE_TEXT_POSTURE, XML_TYPE_TEXT_SHADOW, XML_TYPE_TEXT_SHADOWED, XML_TYPE_TEXT_SPLIT, XML_TYPE_TEXT_TABSTOP, XML_TYPE_TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_HASCOLOR, XML_TYPE_TEXT_UNDERLINE_STYLE, XML_TYPE_TEXT_UNDERLINE_TYPE, XML_TYPE_TEXT_UNDERLINE_WIDTH, XML_TYPE_TEXT_VERTICAL_POS, XML_TYPE_TEXT_WEIGHT, XML_TYPE_TEXT_WRITING_MODE, and XML_TYPE_TEXT_WRITING_MODE_WITH_DEFAULT.

Referenced by GetBasicHandler().

const XMLPropertyHandler * XMLPropertyHandlerFactory::GetBasicHandler ( sal_Int32  nType) const
private

Retrieves ( creates if necessary ) PropertyHandler for basic XML-types.

Definition at line 161 of file prhdlfac.cxx.

References CreatePropertyHandler(), GetHdlCache(), and PutHdlCache().

Referenced by GetPropertyHandler().

const XMLPropertyHandler * XMLPropertyHandlerFactory::GetHdlCache ( sal_Int32  nType) const
protected

Retrieves a PropertyHandler from the internal cache.

Definition at line 146 of file prhdlfac.cxx.

References mpImpl.

Referenced by GetBasicHandler().

const XMLPropertyHandler * XMLPropertyHandlerFactory::GetPropertyHandler ( sal_Int32  nType) const
virtual

This method retrieves a PropertyHandler for the given XML-type.

To extend this method for more XML-types override this method like the example below. If you call the method of the base-class you get propertyhandler for basic-XML-types ( e.g. for color, percent, ... ). After that you could create your new XML-types. After creating a new type you have to put the pointer into the cache via the method PutHdlCache( sal_Int32 , XMLPropertyHandler* ).

virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const { XMLPropertyHandler* pHdl = XMLPropertyHandlerFactory::GetPropertyHandler( nType );

if( !pHdl ) { switch( nType ) { case XML_TYPE_XYZ : pHdl = new XML_xyz_PropHdl; break; case ... : : }

if( pHdl ) PutHdlCache( nType, pHdl ); }

return pHdl; }

Reimplemented in xmloff::OControlPropertyHandlerFactory, XMLSdPropHdlFactory, XMLChartPropHdlFactory, XMLTextPropertyHandlerFactory, and XMLPageMasterPropHdlFactory.

Definition at line 138 of file prhdlfac.cxx.

References GetBasicHandler(), MID_FLAG_MASK, and SAL_WARN_IF.

Referenced by XMLPageMasterPropHdlFactory::GetPropertyHandler(), XMLTextPropertyHandlerFactory::GetPropertyHandler(), XMLChartPropHdlFactory::GetPropertyHandler(), XMLSdPropHdlFactory::GetPropertyHandler(), and xmloff::OControlPropertyHandlerFactory::GetPropertyHandler().

XMLPropertyHandlerFactory& XMLPropertyHandlerFactory::operator= ( const XMLPropertyHandlerFactory )
privatedelete
void XMLPropertyHandlerFactory::PutHdlCache ( sal_Int32  nType,
const XMLPropertyHandler pHdl 
) const
protected

Member Data Documentation

std::unique_ptr<Impl> XMLPropertyHandlerFactory::mpImpl
private

Definition at line 42 of file prhdlfac.hxx.

Referenced by GetHdlCache(), PutHdlCache(), and ~XMLPropertyHandlerFactory().


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