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::XAttributeList > &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 55 of file XMLEventImportHelper.hxx.

Constructor & Destructor Documentation

XMLEventImportHelper::XMLEventImportHelper ( )

Definition at line 32 of file XMLEventImportHelper.cxx.

XMLEventImportHelper::~XMLEventImportHelper ( )

Definition at line 39 of file XMLEventImportHelper.cxx.

References aFactoryMap, and pEventNameMap.

Member Function Documentation

void XMLEventImportHelper::AddTranslationTable ( const XMLEventNameTranslation pTransTable)

add event name translation to the internal table

Definition at line 56 of file XMLEventImportHelper.cxx.

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

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

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

recover the top-most previously saved translation table

Definition at line 87 of file XMLEventImportHelper.cxx.

References aEventNameMapVector, DBG_ASSERT, and pEventNameMap.

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

void XMLEventImportHelper::PushTranslationTable ( )

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

Definition at line 80 of file XMLEventImportHelper.cxx.

References aEventNameMapVector, and pEventNameMap.

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

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

register a handler for a particular language type

Definition at line 48 of file XMLEventImportHelper.cxx.

References aFactoryMap, and assert().

Member Data Documentation

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

stack of previous aEventNameMap

Definition at line 64 of file XMLEventImportHelper.hxx.

Referenced by PopTranslationTable(), and PushTranslationTable().

FactoryMap XMLEventImportHelper::aFactoryMap
private

map of XMLEventContextFactory objects

Definition at line 58 of file XMLEventImportHelper.hxx.

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

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

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