LibreOffice Module xmloff (master) 1
|
Export instances of EventsSupplier services. More...
#include <XMLEventExport.hxx>
Public Member Functions | |
XMLEventExport (SvXMLExport &rExport) | |
~XMLEventExport () | |
XMLEventExport & | operator= (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 (const 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 (const 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 | |
SvXMLExport & | m_rExport |
HandlerMap | m_aHandlerMap |
NameMap | m_aNameTranslationMap |
bool | m_bExtNamespace |
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.
XMLEventExport::XMLEventExport | ( | SvXMLExport & | rExport | ) |
Definition at line 45 of file XMLEventExport.cxx.
XMLEventExport::~XMLEventExport | ( | ) |
Definition at line 51 of file XMLEventExport.cxx.
References m_aHandlerMap.
|
delete |
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 m_aHandlerMap.
void XMLEventExport::AddTranslationTable | ( | const XMLEventNameTranslation * | pTransTable | ) |
register additional event names
Definition at line 64 of file XMLEventExport.cxx.
References m_aNameTranslationMap, and XMLEventNameTranslation::sAPIName.
Referenced by xmloff::OFormLayerXMLExport_Impl::OFormLayerXMLExport_Impl().
|
private |
export the end element
Definition at line 241 of file XMLEventExport.cxx.
References SvXMLExport::EndElement(), SvXMLExport::IgnorableWhitespace(), m_bExtNamespace, m_rExport, nNamespace, xmloff::token::XML_EVENT_LISTENERS, XML_NAMESPACE_OFFICE, and XML_NAMESPACE_OFFICE_EXT.
Referenced by ExportSingleEvent().
void XMLEventExport::Export | ( | css::uno::Reference< css::container::XNameAccess > const & | xAccess, |
bool | bUseWhitespace = true |
||
) |
export the events (writes <office:events> element)
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::document::XEventsSupplier > const & | xAccess, |
bool | bUseWhitespace = true |
||
) |
export the events (calls EventExport::Export(Reference<XNameAccess>) )
Referenced by XMLTextParagraphExport::_exportTextFrame(), XMLTextParagraphExport::_exportTextGraphic(), xmloff::OElementExport::exportEvents(), XMLAutoTextEventExport::exportEvents(), XMLTextParagraphExport::exportEvents(), ExportExt(), XMLImageMapExport::ExportMapEntry(), SvXMLExport::ExportScripts_(), and XMLStyleExport::exportStyle().
|
private |
export one event (start container-element if necessary)
export a single event
Definition at line 182 of file XMLEventExport.cxx.
References SvXMLExport::GetNamespaceMap(), SvXMLNamespaceMap::GetQNameByKey(), m_aHandlerMap, XMLEventName::m_aName, XMLEventName::m_nPrefix, m_rExport, 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 Export(), and m_bExtNamespace.
void XMLEventExport::ExportSingleEvent | ( | const 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 EndElement(), ExportEvent(), m_aNameTranslationMap, and SAL_WARN.
Referenced by XMLTextFieldExport::ExportMacro().
|
delete |
|
private |
export the start element
Definition at line 229 of file XMLEventExport.cxx.
References SvXMLExport::IgnorableWhitespace(), m_bExtNamespace, m_rExport, nNamespace, SvXMLExport::StartElement(), xmloff::token::XML_EVENT_LISTENERS, XML_NAMESPACE_OFFICE, and XML_NAMESPACE_OFFICE_EXT.
Referenced by ExportEvent().
|
private |
Definition at line 65 of file XMLEventExport.hxx.
Referenced by AddHandler(), ExportEvent(), and ~XMLEventExport().
|
private |
Definition at line 66 of file XMLEventExport.hxx.
Referenced by AddTranslationTable(), and ExportSingleEvent().
|
private |
Definition at line 68 of file XMLEventExport.hxx.
Referenced by EndElement(), ExportExt(), and StartElement().
|
private |
Definition at line 63 of file XMLEventExport.hxx.
Referenced by EndElement(), ExportEvent(), and StartElement().