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

Export instances of EventsSupplier services. More...

#include <XMLEventExport.hxx>

Collaboration diagram for XMLEventExport:
[legend]

Public Member Functions

 XMLEventExport (SvXMLExport &rExport)
 
 ~XMLEventExport ()
 
XMLEventExportoperator= (XMLEventExport const &)=delete
 
 XMLEventExport (XMLEventExport const &)=delete
 
void AddHandler (const OUString &rName, std::unique_ptr< XMLEventExportHandler > pHandler)
 register an EventExportHandler for a particular script type More...
 
void AddTranslationTable (const XMLEventNameTranslation *pTransTable)
 register additional event names More...
 
void Export (css::uno::Reference< css::document::XEventsSupplier > const &xAccess, bool bUseWhitespace=true)
 export the events (calls EventExport::Export(Reference<XNameAccess>) ) More...
 
void Export (css::uno::Reference< css::container::XNameReplace > const &xAccess, bool bUseWhitespace=true)
 export the events (calls EventExport::Export(Reference<XNameAccess>) ) More...
 
void Export (css::uno::Reference< css::container::XNameAccess > const &xAccess, bool bUseWhitespace=true)
 export the events (writes <office:events> element) More...
 
void ExportExt (css::uno::Reference< css::container::XNameAccess > const &xAccess)
 export the events, but write <officeooo:events> element (for new file format additions) More...
 
void ExportSingleEvent (css::uno::Sequence< css::beans::PropertyValue > &rEventValues, const OUString &rApiEventName, bool bUseWhitespace=true)
 export a single event (writes <office:events> element) More...
 

Private Member Functions

SAL_DLLPRIVATE void ExportEvent (css::uno::Sequence< css::beans::PropertyValue > &rEventValues, const XMLEventName &rXmlEventName, bool bUseWhitespace, bool &rExported)
 export one event (start container-element if necessary) More...
 
SAL_DLLPRIVATE void StartElement (bool bUseWhitespace)
 export the start element More...
 
SAL_DLLPRIVATE void EndElement (bool bUseWhitespace)
 export the end element More...
 

Private Attributes

SvXMLExportrExport
 
HandlerMap aHandlerMap
 
NameMap aNameTranslationMap
 
bool bExtNamespace
 

Detailed Description

Export instances of EventsSupplier services.

To use this class you must fulfill two conditions:

1) provide a translation from the API event names to XML event names 2) Register XMLEventExportHandler instances for all script types that you would like to export.

The Export()-Methods all have a bUseWhitespace parameter that causes the exported elements to be surrounded by whitespace, which in turn causes the elements to be indented properly. By default, whitespace is used, but it may not be called for in all cases (e.g events attached to hyperlink within a paragraph.)

Definition at line 61 of file XMLEventExport.hxx.

Constructor & Destructor Documentation

XMLEventExport::XMLEventExport ( SvXMLExport rExport)

Definition at line 45 of file XMLEventExport.cxx.

XMLEventExport::~XMLEventExport ( )

Definition at line 51 of file XMLEventExport.cxx.

References aHandlerMap.

XMLEventExport::XMLEventExport ( XMLEventExport const &  )
delete

Member Function Documentation

void XMLEventExport::AddHandler ( const OUString &  rName,
std::unique_ptr< XMLEventExportHandler pHandler 
)

register an EventExportHandler for a particular script type

The handlers will be deleted when the object is destroyed, hence no pointers to a handler registered with AddHandler() should be held by anyone.

Definition at line 57 of file XMLEventExport.cxx.

References aHandlerMap.

void XMLEventExport::AddTranslationTable ( const XMLEventNameTranslation pTransTable)

register additional event names

Definition at line 64 of file XMLEventExport.cxx.

References aNameTranslationMap, and XMLEventNameTranslation::sAPIName.

Referenced by xmloff::OFormLayerXMLExport_Impl::OFormLayerXMLExport_Impl().

void XMLEventExport::EndElement ( bool  bUseWhitespace)
private
void XMLEventExport::Export ( css::uno::Reference< css::document::XEventsSupplier > const &  xAccess,
bool  bUseWhitespace = true 
)
void XMLEventExport::Export ( css::uno::Reference< css::container::XNameReplace > const &  xAccess,
bool  bUseWhitespace = true 
)

export the events (calls EventExport::Export(Reference<XNameAccess>) )

void XMLEventExport::Export ( css::uno::Reference< css::container::XNameAccess > const &  xAccess,
bool  bUseWhitespace = true 
)

export the events (writes <office:events> element)

void XMLEventExport::ExportEvent ( css::uno::Sequence< css::beans::PropertyValue > &  rEventValues,
const XMLEventName rXmlEventName,
bool  bUseWhitespace,
bool &  rExported 
)
private

export one event (start container-element if necessary)

export a single event

Definition at line 182 of file XMLEventExport.cxx.

References aHandlerMap, SvXMLExport::GetNamespaceMap(), SvXMLNamespaceMap::GetQNameByKey(), gsEventType(), XMLEventName::m_aName, XMLEventName::m_nPrefix, rExport, XMLImageStyle::rValue, StartElement(), and sType.

Referenced by ExportSingleEvent().

void XMLEventExport::ExportExt ( css::uno::Reference< css::container::XNameAccess > const &  xAccess)

export the events, but write <officeooo:events> element (for new file format additions)

Definition at line 142 of file XMLEventExport.cxx.

References bExtNamespace, and Export().

void XMLEventExport::ExportSingleEvent ( css::uno::Sequence< css::beans::PropertyValue > &  rEventValues,
const OUString &  rApiEventName,
bool  bUseWhitespace = true 
)

export a single event (writes <office:events> element)

export a singular event and write <office:events> container

Definition at line 152 of file XMLEventExport.cxx.

References aNameTranslationMap, EndElement(), ExportEvent(), and SAL_WARN.

Referenced by XMLTextFieldExport::ExportMacro().

XMLEventExport& XMLEventExport::operator= ( XMLEventExport const &  )
delete
void XMLEventExport::StartElement ( bool  bUseWhitespace)
private

Member Data Documentation

HandlerMap XMLEventExport::aHandlerMap
private

Definition at line 65 of file XMLEventExport.hxx.

Referenced by AddHandler(), ExportEvent(), and ~XMLEventExport().

NameMap XMLEventExport::aNameTranslationMap
private

Definition at line 66 of file XMLEventExport.hxx.

Referenced by AddTranslationTable(), and ExportSingleEvent().

bool XMLEventExport::bExtNamespace
private

Definition at line 68 of file XMLEventExport.hxx.

Referenced by EndElement(), ExportExt(), and StartElement().

SvXMLExport& XMLEventExport::rExport
private

Definition at line 63 of file XMLEventExport.hxx.

Referenced by EndElement(), ExportEvent(), and StartElement().


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