LibreOffice Module xmloff (master) 1
Public Member Functions | Private Attributes | List of all members
XMLEventImportHelper Class Reference

Helps the XMLEventsImportContext. More...

#include <XMLEventImportHelper.hxx>

Public Member Functions

 XMLEventImportHelper ()
 
 ~XMLEventImportHelper ()
 
void RegisterFactory (const OUString &rLanguage, std::unique_ptr< XMLEventContextFactory > aFactory)
 register a handler for a particular language type More...
 
void AddTranslationTable (const XMLEventNameTranslation *pTransTable)
 add event name translation to the internal table More...
 
void PushTranslationTable ()
 save the old translation table on a stack and install an empty table More...
 
void PopTranslationTable ()
 recover the top-most previously saved translation table More...
 
SvXMLImportContextCreateContext (SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, XMLEventsImportContext *rEvents, const OUString &rXmlEventName, const OUString &rLanguage)
 create an appropriate import context for a particular event More...
 

Private Attributes

FactoryMap aFactoryMap
 map of XMLEventContextFactory objects More...
 
std::unique_ptr< NameMappEventNameMap
 map from XML to API names More...
 
std::vector< std::unique_ptr< NameMap > > aEventNameMapVector
 stack of previous aEventNameMap More...
 

Detailed Description

Helps the XMLEventsImportContext.

This class stores a) the translation from XML event names to API event names, and b) a mapping from script language names to XMLEventContextFactory objects (that handle particular languages).

Event name translation tables may be added, i.e. they will be joined together. If different translations are needed (i.e., if the same XML name needs to be translated to different API names in different contexts), then translation tables may be saved on a translation table stack.

Definition at line 54 of file XMLEventImportHelper.hxx.

Constructor & Destructor Documentation

◆ XMLEventImportHelper()

XMLEventImportHelper::XMLEventImportHelper ( )

Definition at line 30 of file XMLEventImportHelper.cxx.

◆ ~XMLEventImportHelper()

XMLEventImportHelper::~XMLEventImportHelper ( )

Definition at line 35 of file XMLEventImportHelper.cxx.

References aFactoryMap, and pEventNameMap.

Member Function Documentation

◆ AddTranslationTable()

void XMLEventImportHelper::AddTranslationTable ( const XMLEventNameTranslation pTransTable)

add event name translation to the internal table

Definition at line 52 of file XMLEventImportHelper.cxx.

References aName, DBG_ASSERT, pEventNameMap, and XMLEventNameTranslation::sAPIName.

◆ CreateContext()

SvXMLImportContext * XMLEventImportHelper::CreateContext ( SvXMLImport &  rImport,
const css::uno::Reference< css::xml::sax::XFastAttributeList > &  xAttrList,
XMLEventsImportContext rEvents,
const OUString &  rXmlEventName,
const OUString &  rLanguage 
)

create an appropriate import context for a particular event

Definition at line 96 of file XMLEventImportHelper.cxx.

References aFactoryMap, pEventNameMap, sMacroName, XML_NAMESPACE_OOO, XMLERROR_FLAG_ERROR, and XMLERROR_ILLEGAL_EVENT.

◆ PopTranslationTable()

void XMLEventImportHelper::PopTranslationTable ( )

recover the top-most previously saved translation table

Definition at line 83 of file XMLEventImportHelper.cxx.

References aEventNameMapVector, DBG_ASSERT, and pEventNameMap.

◆ PushTranslationTable()

void XMLEventImportHelper::PushTranslationTable ( )

save the old translation table on a stack and install an empty table

Definition at line 76 of file XMLEventImportHelper.cxx.

References aEventNameMapVector, and pEventNameMap.

◆ RegisterFactory()

void XMLEventImportHelper::RegisterFactory ( const OUString &  rLanguage,
std::unique_ptr< XMLEventContextFactory aFactory 
)

register a handler for a particular language type

Definition at line 44 of file XMLEventImportHelper.cxx.

References aFactoryMap.

Member Data Documentation

◆ aEventNameMapVector

std::vector< std::unique_ptr<NameMap> > XMLEventImportHelper::aEventNameMapVector
private

stack of previous aEventNameMap

Definition at line 63 of file XMLEventImportHelper.hxx.

Referenced by PopTranslationTable(), and PushTranslationTable().

◆ aFactoryMap

FactoryMap XMLEventImportHelper::aFactoryMap
private

map of XMLEventContextFactory objects

Definition at line 57 of file XMLEventImportHelper.hxx.

Referenced by CreateContext(), RegisterFactory(), and ~XMLEventImportHelper().

◆ pEventNameMap

std::unique_ptr<NameMap> XMLEventImportHelper::pEventNameMap
private

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