LibreOffice Module xmloff (master) 1
|
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... | |
SvXMLImportContext * | 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 More... | |
Private Attributes | |
FactoryMap | aFactoryMap |
map of XMLEventContextFactory objects More... | |
std::unique_ptr< NameMap > | pEventNameMap |
map from XML to API names More... | |
std::vector< std::unique_ptr< NameMap > > | aEventNameMapVector |
stack of previous aEventNameMap More... | |
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.
XMLEventImportHelper::XMLEventImportHelper | ( | ) |
Definition at line 30 of file XMLEventImportHelper.cxx.
XMLEventImportHelper::~XMLEventImportHelper | ( | ) |
Definition at line 35 of file XMLEventImportHelper.cxx.
References aFactoryMap, and pEventNameMap.
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.
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.
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.
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.
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.
|
private |
stack of previous aEventNameMap
Definition at line 63 of file XMLEventImportHelper.hxx.
Referenced by PopTranslationTable(), and PushTranslationTable().
|
private |
map of XMLEventContextFactory objects
Definition at line 57 of file XMLEventImportHelper.hxx.
Referenced by CreateContext(), RegisterFactory(), and ~XMLEventImportHelper().
|
private |
map from XML to API names
Definition at line 60 of file XMLEventImportHelper.hxx.
Referenced by AddTranslationTable(), CreateContext(), PopTranslationTable(), PushTranslationTable(), and ~XMLEventImportHelper().