20#ifndef INCLUDED_XMLOFF_XMLEXP_HXX
21#define INCLUDED_XMLOFF_XMLEXP_HXX
27#include <rtl/ustring.hxx>
37#include <com/sun/star/document/XFilter.hpp>
38#include <com/sun/star/lang/XServiceInfo.hpp>
39#include <com/sun/star/document/XExporter.hpp>
40#include <com/sun/star/lang/XInitialization.hpp>
41#include <com/sun/star/container/XNamed.hpp>
85 namespace frame {
class XModel; }
86 namespace lang {
struct Locale; }
88namespace comphelper {
class UnoInterfaceToUniqueIdentifierMapper; }
111 css::document::XFilter,
112 css::lang::XServiceInfo,
113 css::document::XExporter,
114 css::lang::XInitialization,
115 css::container::XNamed>
117 std::unique_ptr<SvXMLExport_Impl>
mpImpl;
119 css::uno::Reference< css::uno::XComponentContext >
m_xContext;
122 css::uno::Reference< css::frame::XModel >
mxModel;
123 css::uno::Reference< css::xml::sax::XDocumentHandler >
mxHandler;
124 css::uno::Reference< css::xml::sax::XExtendedDocumentHandler >
mxExtHandler;
155 SAL_DLLPRIVATE
void InitCtor_();
164 SAL_DLLPRIVATE
void DetermineModelType_();
166 SAL_DLLPRIVATE
void ImplExportMeta();
167 SAL_DLLPRIVATE
void ImplExportSettings();
168 SAL_DLLPRIVATE
void ImplExportStyles();
169 SAL_DLLPRIVATE
void ImplExportAutoStyles();
171 SAL_DLLPRIVATE
void ImplExportMasterStyles();
173 SAL_DLLPRIVATE
void ImplExportContent();
174 virtual void SetBodyAttributes();
175 void GetViewSettingsAndViews(css::uno::Sequence<css::beans::PropertyValue>& rProps);
184 void ResetNamespaceMap();
188 virtual void ExportMeta_();
192 virtual void ExportScripts_();
197 virtual void ExportFontDecls_();
202 virtual void ExportStyles_(
bool bUsed );
213 OUString
const & GetSourceShellID()
const;
214 OUString
const & GetDestinationShellID()
const;
226 virtual void GetViewSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps);
227 virtual void GetConfigurationSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps);
232 css::uno::Sequence< css::beans::PropertyValue >
aSettings;
236 const css::uno::Sequence< css::beans::PropertyValue >& _rSettings )
237 :eGroupName( _eGroupName )
238 ,aSettings( _rSettings )
250 virtual sal_Int32 GetDocumentSpecificSettings( ::std::vector< SettingsGroup >& _out_rSettings );
252 const css::uno::Reference< css::document::XEmbeddedObjectResolver >&
GetEmbeddedResolver()
const {
return mxEmbeddedResolver; }
253 inline void SetEmbeddedResolver( css::uno::Reference< css::document::XEmbeddedObjectResolver >
const & _xEmbeddedResolver );
257 return mxGraphicStorageHandler;
259 void SetGraphicStorageHandler(css::uno::Reference<css::document::XGraphicStorageHandler>
const & rxGraphicStorageHandler);
261 void SetDocHandler(
const css::uno::Reference< css::xml::sax::XDocumentHandler > &rHandler );
267 const css::uno::Reference< css::uno::XComponentContext >& xContext,
268 OUString implementationName,
269 sal_Int16
const eDefaultMeasureUnit ,
274 const css::uno::Reference< css::uno::XComponentContext >& xContext,
275 OUString implementationName,
277 sal_Int16
const eDefaultMeasureUnit ,
278 const css::uno::Reference< css::xml::sax::XDocumentHandler > & rHandler);
281 const css::uno::Reference< css::uno::XComponentContext >& xContext,
282 OUString implementationName,
284 const css::uno::Reference< css::xml::sax::XDocumentHandler > & rHandler,
285 const css::uno::Reference< css::frame::XModel > &,
291 virtual void collectAutoStyles();
294 virtual void SAL_CALL setSourceDocument(
const css::uno::Reference< css::lang::XComponent >& xDoc )
override;
297 virtual sal_Bool SAL_CALL
filter(
const css::uno::Sequence< css::beans::PropertyValue >& aDescriptor )
override;
298 virtual void SAL_CALL cancel()
override;
301 virtual void SAL_CALL initialize(
const css::uno::Sequence< css::uno::Any >& aArguments )
override;
304 virtual OUString SAL_CALL getName( )
override;
305 virtual void SAL_CALL setName(
const OUString& aName )
override;
310 virtual css::
uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) final override;
322 OUString EnsureNamespace(OUString const & i_rNamespace );
326 void CheckAttrList() { (void)
this; }
328 void CheckAttrList();
332 void ClearAttrList();
335 void AddAttribute( sal_uInt16 nPrefix,
const OUString& rName,
336 const OUString& rValue );
339 const OUString& rValue );
343 void AddAttribute(
const OUString& rQName,
344 const OUString& rValue );
345 void AddAttribute(
const OUString& rQName,
360 void AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPrefixRfc,
361 const css::lang::Locale& rLocale,
bool bWriteEmpty);
366 void AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPrefixRfc,
367 const LanguageTag& rLanguageTag,
bool bWriteEmpty );
370 void AddAttributeList(
const css::uno::Reference<
371 css::xml::sax::XAttributeList >& xAttrList );
375 css::uno::Reference< css::xml::sax::XAttributeList >
GetXAttrList()
const {
return mxAttrList; }
388 size_t GetInfoID(
const OUString sPersonalInfo )
const {
return mpAuthorIDs->GetInfoID(sPersonalInfo); }
395 void addChaffWhenEncryptedStorage();
400 void collectDataStyles(
bool bFromUsedStyles);
401 virtual void addDataStyle(
const sal_Int32 nNumberFormat,
bool bTimeFormat =
false );
402 virtual void exportDataStyles();
403 virtual void exportAutoDataStyles();
404 virtual OUString getDataStyleName(
const sal_Int32 nNumberFormat,
bool bTimeFormat =
false )
const;
405 sal_Int32 dataStyleForceSystemLanguage(sal_Int32 nFormat)
const;
407 virtual void exportAnnotationMeta(
const css::uno::Reference < css::drawing::XShape >& xShape);
410 const css::uno::Reference< css::frame::XModel > &
416 mxNumberFormatsSupplier = _xNumberFormatSupplier;
417 if ( mxNumberFormatsSupplier.is() &&
mxHandler.is() )
443 inline bool HasFormExport()
const;
446 const css::uno::Reference< css::beans::XPropertySet >&
getExportInfo()
const {
return mxExportInfo; }
457 OUString AddEmbeddedXGraphic(css::uno::Reference<css::graphic::XGraphic>
const & rxGraphic, OUString & rOutMimeType, OUString
const & rRequestedName = OUString());
458 bool AddEmbeddedXGraphicAsBase64(css::uno::Reference<css::graphic::XGraphic>
const & rxGraphic);
459 bool GetGraphicMimeTypeFromStream(css::uno::Reference<css::graphic::XGraphic>
const & rxGraphic, OUString & rOutMimeType);
461 OUString AddEmbeddedObject(
462 const OUString& rEmbeddedObjectURL );
463 bool AddEmbeddedObjectAsBase64(
464 const OUString& rEmbeddedObjectURL );
466 OUString EncodeStyleName(
const OUString& rName,
467 bool *pEncoded=
nullptr )
const;
475 void ExportEmbeddedOwnObject(
476 css::uno::Reference<css::lang::XComponent >
const & rComp );
478 OUString GetRelativeReference(
const OUString& rValue);
481 void StartElement(sal_uInt16 nPrefix,
483 bool bIgnWSOutside );
484 void StartElement(
const OUString& rName,
485 bool bIgnWSOutside );
486 void Characters(
const OUString& rChars);
487 void EndElement(sal_uInt16 nPrefix,
490 void EndElement(
const OUString& rName,
492 void IgnorableWhitespace();
503 const css::uno::Sequence< OUString> & rMsgParams,
505 const OUString& rExceptionMessage,
507 const css::uno::Reference<css::xml::sax::XLocator> & rLocator );
511 const css::uno::Sequence< OUString> & rMsgParams);
513 virtual void DisposingModel();
526 bool writeOutlineStyleAsNormalListStyle()
const;
528 css::uno::Reference< css::embed::XStorage >
const & GetTargetStorage()
const;
531 char const* GetODFVersionAttributeValue()
const;
539 void SAL_DLLPRIVATE AddAttributeIdLegacy(
540 sal_uInt16
const nLegacyPrefix, OUString
const& rValue);
543 void AddAttributeXmlId(css::uno::Reference<css::uno::XInterface>
const & i_xIfc);
546 void AddAttributesRDFa( css::uno::Reference<css::text::XTextContent>
const & i_xTextContent);
548 bool exportTextNumberElement()
const;
551 bool SetNullDateOnUnitConverter();
554 OUString
const & GetImageFilterName()
const;
619 css::uno::Reference< css::document::XEmbeddedObjectResolver >
const & _xEmbeddedResolver )
625 css::uno::Reference<css::document::XGraphicStorageHandler>
const & rxGraphicStorageHandler)
640 const sal_uInt16 nPrefix,
641 const OUString& rName,
642 const bool bIgnoreWhitespaceOutside );
650 bool bIgnWSOutside,
bool bIgnWSInside );
652 const OUString& rName,
653 bool bIgnWSOutside,
bool bIgnWSInside );
656 bool bIgnWSOutside,
bool bIgnWSInside );
658 bool bIgnWSOutside,
bool bIgnWSInside );
664 bool bIgnWSOutside,
bool bIgnWSInside );
css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator
css::uno::Reference< css::frame::XModel2 > mxModel
const uno::Reference< uno::XComponentContext > m_xContext
With this class you can export a <chart:chart> element containing its data as <table:table> element o...
SvXMLElementExport(SvXMLExport &rExp, sal_uInt16 nPrefix, enum ::xmloff::token::XMLTokenEnum eName, bool bIgnWSOutside, bool bIgnWSInside)
const bool mbIgnoreWhitespaceInside
SvXMLElementExport(SvXMLExport &rExp, bool bDoSomething, sal_uInt16 nPrefix, enum ::xmloff::token::XMLTokenEnum eName, bool bIgnWSOutside, bool bIgnWSInside)
rtl::Reference< XMLShapeExport > mxShapeExport
const SvXMLNamespaceMap & GetNamespaceMap() const
css::uno::Reference< css::document::XEmbeddedObjectResolver > mxEmbeddedResolver
std::unique_ptr< SvXMLExport_Impl > mpImpl
css::uno::Reference< css::frame::XModel > mxModel
const css::uno::Reference< css::task::XStatusIndicator > & GetStatusIndicator() const
virtual XMLFontAutoStylePool * CreateFontAutoStylePool()
void SetError(sal_Int32 nId, const css::uno::Sequence< OUString > &rMsgParams, const OUString &rExceptionMessage, const css::uno::Reference< css::xml::sax::XLocator > &rLocator)
Record an error condition that occurred during export.
rtl::Reference< SchXMLExportHelper > mxChartExport
css::uno::Reference< css::xml::sax::XExtendedDocumentHandler > mxExtHandler
std::unique_ptr< ProgressBarHelper > mpProgressBarHelper
std::unique_ptr< XMLErrors > mpXMLErrors
bool HasFormExport() const
OUString m_implementationName
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
css::uno::Reference< css::xml::sax::XDocumentHandler > mxHandler
bool mbAutoStylesCollected
std::unique_ptr< XMLEventExport > mpEventExport
SvXMLExportFlags getExportFlags() const
css::uno::Reference< css::util::XNumberFormatsSupplier > & GetNumberFormatsSupplier()
SvXMLNamespaceMap & GetNamespaceMap_()
void SetError(sal_Int32 nId, const css::uno::Sequence< OUString > &rMsgParams)
virtual void ExportContent_()=0
Override this method to export the content of <office:body>.
SvXMLUnitConverter maUnitConv
rtl::Reference< comphelper::AttributeList > mxAttrList
rtl::Reference< SchXMLExportHelper > const & GetChartExport()
const css::uno::Reference< css::frame::XModel > & GetModel() const
virtual SvXMLAutoStylePoolP * CreateAutoStylePool()
SchXMLExportHelper * CreateChartExport()
enum ::xmloff::token::XMLTokenEnum meClass
SvtModuleOptions::EFactory GetModelType() const
rtl::Reference< SvXMLAutoStylePoolP > mxAutoStylePool
rtl::Reference< XMLFontAutoStylePool > const & GetFontAutoStylePool()
virtual XMLPageExport * CreatePageExport()
css::uno::Reference< css::document::XGraphicStorageHandler > mxGraphicStorageHandler
css::uno::Reference< css::uno::XComponentContext > m_xContext
css::uno::Reference< css::beans::XPropertySet > mxExportInfo
rtl::Reference< XMLPageExport > const & GetPageExport()
css::uno::Reference< css::xml::sax::XAttributeList > GetXAttrList() const
void AddAttribute(sal_uInt16 nPrefix, enum ::xmloff::token::XMLTokenEnum eName, enum ::xmloff::token::XMLTokenEnum eValue)
virtual void ExportAutoStyles_()=0
Override this method to export the contents of <style:auto-styles>.
std::unique_ptr< SvtSecurityMapPersonalInfo > mpAuthorIDs
const css::uno::Reference< css::xml::sax::XDocumentHandler > & GetDocHandler() const
std::unique_ptr< XMLImageMapExport > mpImageMapExport
css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator
std::unique_ptr< SvXMLNamespaceMap > mpNamespaceMap
rtl::Reference< XMLShapeExport > const & GetShapeExport()
rtl::Reference< SvXMLAutoStylePoolP > const & GetAutoStylePool()
SvXMLExport(const css::uno::Reference< css::uno::XComponentContext > &xContext, OUString implementationName, OUString fileName, const css::uno::Reference< css::xml::sax::XDocumentHandler > &rHandler, const css::uno::Reference< css::frame::XModel > &, FieldUnit const eDefaultFieldUnit, SvXMLExportFlags nExportFlag)
const css::uno::Reference< css::document::XEmbeddedObjectResolver > & GetEmbeddedResolver() const
rtl::Reference< XMLTextParagraphExport > mxTextParagraphExport
virtual XMLTextParagraphExport * CreateTextParagraphExport()
rtl::Reference< XMLPageExport > mxPageExport
SvtModuleOptions::EFactory meModelType
rtl::Reference< XMLFontAutoStylePool > mxFontAutoStylePool
css::uno::Reference< css::lang::XEventListener > mxEventListener
rtl::Reference< xmloff::OFormLayerXMLExport > mxFormExport
const css::uno::Reference< css::beans::XPropertySet > & getExportInfo() const
virtual void ExportMasterStyles_()=0
Override this method to export the contents of <style:master-styles>.
const css::uno::Reference< css::uno::XComponentContext > & getComponentContext() const
rtl::Reference< xmloff::OFormLayerXMLExport > const & GetFormExport()
void setExportFlags(SvXMLExportFlags nExportFlags)
const SvXMLUnitConverter & GetMM100UnitConverter() const
SvXMLExportFlags mnExportFlags
void SetEmbeddedResolver(css::uno::Reference< css::document::XEmbeddedObjectResolver > const &_xEmbeddedResolver)
const OUString & GetOrigFileName() const
SvXMLExport(const css::uno::Reference< css::uno::XComponentContext > &xContext, OUString implementationName, OUString fileName, sal_Int16 const eDefaultMeasureUnit, const css::uno::Reference< css::xml::sax::XDocumentHandler > &rHandler)
virtual XMLShapeExport * CreateShapeExport()
size_t GetInfoID(const OUString sPersonalInfo) const
SvXMLErrorFlags mnErrorFlags
const css::uno::Reference< css::document::XGraphicStorageHandler > & GetGraphicStorageHandler() const
css::uno::Reference< css::util::XNumberFormatsSupplier > mxNumberFormatsSupplier
xmloff::OFormLayerXMLExport * CreateFormExport()
comphelper::AttributeList & GetAttrList()
SvXMLUnitConverter & GetMM100UnitConverter()
SvXMLExport(const css::uno::Reference< css::uno::XComponentContext > &xContext, OUString implementationName, sal_Int16 const eDefaultMeasureUnit, const enum ::xmloff::token::XMLTokenEnum eClass, SvXMLExportFlags nExportFlag)
bool mbSaveLinkedSections
void SetGraphicStorageHandler(css::uno::Reference< css::document::XGraphicStorageHandler > const &rxGraphicStorageHandler)
bool IsSaveLinkedSections() const
void SetNumberFormatsSupplier(const css::uno::Reference< css::util::XNumberFormatsSupplier > &_xNumberFormatSupplier)
void AddAttribute(sal_uInt16 nPrefix, enum ::xmloff::token::XMLTokenEnum eName, const OUString &rValue)
std::unique_ptr< SvXMLNumFmtExport > mpNumExport
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
The XMLErrors is used to collect all errors and warnings that occur for appropriate processing.
Export instances of EventsSupplier services.
Export an ImageMap as defined by service com.sun.star.image.ImageMap to XML.
class SAL_NO_VTABLE XPropertySet
OUString getImplementationName()
XMLTokenEnum
The enumeration of all XML tokens.
css::uno::Sequence< css::beans::PropertyValue > aSettings
SettingsGroup(const ::xmloff::token::XMLTokenEnum _eGroupName, const css::uno::Sequence< css::beans::PropertyValue > &_rSettings)
::xmloff::token::XMLTokenEnum eGroupName
rtl::Reference< FragmentHandler > mxHandler