1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_XMLOFF_XMLEXP_HXX
21 #define INCLUDED_XMLOFF_XMLEXP_HXX
23 #include <sal/config.h>
24 #include <xmloff/dllapi.h>
25 #include <sal/types.h>
27 #include <com/sun/star/lang/XUnoTunnel.hpp>
28 #include <rtl/ustring.hxx>
29 #include <xmloff/attrlist.hxx>
30 #include <xmloff/txtparae.hxx>
31 #include <xmloff/formlayerexport.hxx>
32 #include <xmloff/xmlnumfe.hxx>
33 #include <xmloff/xmlaustp.hxx>
34 #include <xmloff/shapeexport.hxx>
35 #include <xmloff/xmltoken.hxx>
36 #include <xmloff/SchXMLExportHelper.hxx>
37 #include <xmloff/XMLFontAutoStylePool.hxx>
38 #include <xmloff/xmluconv.hxx>
39 #include <com/sun/star/document/XFilter.hpp>
40 #include <com/sun/star/lang/XServiceInfo.hpp>
41 #include <com/sun/star/document/XExporter.hpp>
42 #include <com/sun/star/lang/XInitialization.hpp>
43 #include <com/sun/star/container/XNamed.hpp>
45 #include <unotools/saveopt.hxx>
47 #include <xmloff/XMLPageExport.hxx>
48 #include <cppuhelper/implbase.hxx>
49 #include <tools/fldunit.hxx>
50 #include <vcl/errcode.hxx>
54 #include <o3tl/typed_flags_set.hxx>
56 namespace com
{ namespace sun
{ namespace star
{ namespace beans
{ class XPropertySet
; } } } }
57 namespace com
{ namespace sun
{ namespace star
{ namespace document
{ class XEmbeddedObjectResolver
; } } } }
58 namespace com
{ namespace sun
{ namespace star
{ namespace document
{ class XGraphicStorageHandler
; } } } }
59 namespace com
{ namespace sun
{ namespace star
{ namespace embed
{ class XStorage
; } } } }
60 namespace com
{ namespace sun
{ namespace star
{ namespace graphic
{ class XGraphic
; } } } }
61 namespace com
{ namespace sun
{ namespace star
{ namespace lang
{ class XEventListener
; } } } }
62 namespace com
{ namespace sun
{ namespace star
{ namespace task
{ class XStatusIndicator
; } } } }
63 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{ class XComponentContext
; } } } }
64 namespace com
{ namespace sun
{ namespace star
{ namespace util
{ class XNumberFormatsSupplier
; } } } }
65 namespace com
{ namespace sun
{ namespace star
{ namespace xml
{ namespace sax
{ class XAttributeList
; } } } } }
66 namespace com
{ namespace sun
{ namespace star
{ namespace xml
{ namespace sax
{ class XDocumentHandler
; } } } } }
67 namespace com
{ namespace sun
{ namespace star
{ namespace xml
{ namespace sax
{ class XExtendedDocumentHandler
; } } } } }
68 namespace com
{ namespace sun
{ namespace star
{ namespace xml
{ namespace sax
{ class XLocator
; } } } } }
70 class SvXMLNamespaceMap
;
71 class SvXMLExport_Impl
;
72 class ProgressBarHelper
;
74 class XMLImageMapExport
;
77 enum class SvXMLErrorFlags
;
79 // Shapes in Writer cannot be named via context menu (#i51726#)
80 #include <unotools/moduleoptions.hxx>
82 namespace com
{ namespace sun
{ namespace star
{
83 namespace frame
{ class XModel
; }
84 namespace lang
{ struct Locale
; }
86 namespace comphelper
{ class UnoInterfaceToUniqueIdentifierMapper
; }
88 enum class SvXMLExportFlags
{
92 MASTERSTYLES
= 0x0004,
100 SAVEBACKWARDCOMPATIBLE
= 0x0800,
106 template<> struct typed_flags
<SvXMLExportFlags
> : is_typed_flags
<SvXMLExportFlags
, 0x8dff> {};
109 class XMLOFF_DLLPUBLIC SvXMLExport
: public cppu::WeakImplHelper
<
110 css::document::XFilter
,
111 css::lang::XServiceInfo
,
112 css::document::XExporter
,
113 css::lang::XInitialization
,
114 css::container::XNamed
,
115 css::lang::XUnoTunnel
>
117 std::unique_ptr
<SvXMLExport_Impl
> mpImpl
; // dummy
119 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
120 OUString
const m_implementationName
;
122 css::uno::Reference
< css::frame::XModel
> mxModel
;
123 css::uno::Reference
< css::xml::sax::XDocumentHandler
> mxHandler
; // the handlers
124 css::uno::Reference
< css::xml::sax::XExtendedDocumentHandler
> mxExtHandler
;
125 css::uno::Reference
< css::util::XNumberFormatsSupplier
> mxNumberFormatsSupplier
;
126 css::uno::Reference
< css::document::XGraphicStorageHandler
> mxGraphicStorageHandler
;
127 css::uno::Reference
< css::document::XEmbeddedObjectResolver
> mxEmbeddedResolver
;
128 css::uno::Reference
< css::task::XStatusIndicator
> mxStatusIndicator
;
129 css::uno::Reference
< css::beans::XPropertySet
> mxExportInfo
;
130 css::uno::Reference
< css::lang::XEventListener
> mxEventListener
;
132 rtl::Reference
<SvXMLAttributeList
> mxAttrList
; // a common attribute list
134 OUString msOrigFileName
; // the original URL
135 OUString msFilterName
;
136 OUString msImgFilterName
;
137 std::unique_ptr
<SvXMLNamespaceMap
> mpNamespaceMap
; // the namepspace map
138 SvXMLUnitConverter maUnitConv
; // the unit converter
139 std::unique_ptr
<SvXMLNumFmtExport
> mpNumExport
;
140 std::unique_ptr
<ProgressBarHelper
> mpProgressBarHelper
;
142 rtl::Reference
< XMLTextParagraphExport
> mxTextParagraphExport
;
143 rtl::Reference
< XMLShapeExport
> mxShapeExport
;
144 rtl::Reference
< SvXMLAutoStylePoolP
> mxAutoStylePool
;
145 rtl::Reference
< SchXMLExportHelper
> mxChartExport
;
146 rtl::Reference
< XMLPageExport
> mxPageExport
;
147 rtl::Reference
< XMLFontAutoStylePool
> mxFontAutoStylePool
;
148 rtl::Reference
< xmloff::OFormLayerXMLExport
> mxFormExport
;
149 std::unique_ptr
<XMLEventExport
> mpEventExport
;
150 std::unique_ptr
<XMLImageMapExport
> mpImageMapExport
;
151 std::unique_ptr
<XMLErrors
> mpXMLErrors
;
153 const enum ::xmloff::token::XMLTokenEnum meClass
;
154 SAL_DLLPRIVATE
void InitCtor_();
156 SvXMLExportFlags mnExportFlags
;
157 SvXMLErrorFlags mnErrorFlags
;
159 const OUString msWS
; // " "
161 // Shapes in Writer cannot be named via context menu (#i51726#)
162 SvtModuleOptions::EFactory meModelType
;
163 SAL_DLLPRIVATE
void DetermineModelType_();
165 SAL_DLLPRIVATE
void ImplExportMeta(); // <office:meta>
166 SAL_DLLPRIVATE
void ImplExportSettings(); // <office:settings>
167 SAL_DLLPRIVATE
void ImplExportStyles(); // <office:styles>
168 SAL_DLLPRIVATE
void ImplExportAutoStyles();
169 // <office:automatic-styles>
170 SAL_DLLPRIVATE
void ImplExportMasterStyles();
171 // <office:master-styles>
172 SAL_DLLPRIVATE
void ImplExportContent(); // <office:body>
173 virtual void SetBodyAttributes();
174 void GetViewSettingsAndViews(css::uno::Sequence
<css::beans::PropertyValue
>& rProps
);
177 void setExportFlags( SvXMLExportFlags nExportFlags
) { mnExportFlags
= nExportFlags
; }
179 // Get (modifiable) namespace map
180 SvXMLNamespaceMap
& GetNamespaceMap_() { return *mpNamespaceMap
; }
182 // get a new namespave map (used in starmath to have a default namespace)
183 void ResetNamespaceMap();
185 /// Override this method to export the content of <office:meta>.
186 /// There is a default implementation.
187 virtual void ExportMeta_();
189 /// Override this method to export the content of <office:scripts>.
190 /// There is a default implementation.
191 virtual void ExportScripts_();
193 /// Override this method to export the font declarations
194 /// The default implementation will export the contents of the
195 /// XMLFontAutoStylePool if it has been created.
196 virtual void ExportFontDecls_();
198 /// Override this method to export the content of <style:styles>.
199 /// If bUsed is set, used styles should be exported only.
200 /// Overriding Methods must call this method !
201 virtual void ExportStyles_( bool bUsed
);
203 /// Override this method to export the contents of <style:auto-styles>.
204 virtual void ExportAutoStyles_() = 0;
206 /// Override this method to export the contents of <style:master-styles>.
207 virtual void ExportMasterStyles_() = 0;
209 /// Override this method to export the content of <office:body>.
210 virtual void ExportContent_() = 0;
212 OUString
const & GetSourceShellID() const;
213 OUString
const & GetDestinationShellID() const;
215 // save linked sections? (may be false in global documents)
216 bool mbSaveLinkedSections
;
218 virtual XMLTextParagraphExport
* CreateTextParagraphExport();
219 virtual XMLShapeExport
* CreateShapeExport();
220 virtual SvXMLAutoStylePoolP
* CreateAutoStylePool();
221 SchXMLExportHelper
* CreateChartExport();
222 virtual XMLPageExport
* CreatePageExport();
223 virtual XMLFontAutoStylePool
* CreateFontAutoStylePool();
224 xmloff::OFormLayerXMLExport
* CreateFormExport();
225 virtual void GetViewSettings(css::uno::Sequence
<css::beans::PropertyValue
>& aProps
);
226 virtual void GetConfigurationSettings(css::uno::Sequence
<css::beans::PropertyValue
>& aProps
);
230 ::xmloff::token::XMLTokenEnum
const eGroupName
;
231 css::uno::Sequence
< css::beans::PropertyValue
> const aSettings
;
234 const ::xmloff::token::XMLTokenEnum _eGroupName
,
235 const css::uno::Sequence
< css::beans::PropertyValue
>& _rSettings
)
236 :eGroupName( _eGroupName
)
237 ,aSettings( _rSettings
)
241 /** returns the current document settings
243 The default implementation will obtain the view settings by calling GetViewSettingsAndViews, and the
244 configuration settings by calling GetConfigurationSettings, and return them together with the proper XML token.
247 the accumulated count of all settings in all groups
249 virtual sal_Int32
GetDocumentSpecificSettings( ::std::vector
< SettingsGroup
>& _out_rSettings
);
251 const css::uno::Reference
< css::document::XEmbeddedObjectResolver
>& GetEmbeddedResolver() const { return mxEmbeddedResolver
; }
252 inline void SetEmbeddedResolver( css::uno::Reference
< css::document::XEmbeddedObjectResolver
> const & _xEmbeddedResolver
);
254 const css::uno::Reference
<css::document::XGraphicStorageHandler
> & GetGraphicStorageHandler() const
256 return mxGraphicStorageHandler
;
258 void SetGraphicStorageHandler(css::uno::Reference
<css::document::XGraphicStorageHandler
> const & rxGraphicStorageHandler
);
260 void SetDocHandler( const css::uno::Reference
< css::xml::sax::XDocumentHandler
> &rHandler
);
262 bool mbAutoStylesCollected
;
266 sal_Int16
const eDefaultMeasureUnit
/*css::util::MeasureUnit*/,
267 const css::uno::Reference
< css::uno::XComponentContext
>& xContext
,
268 OUString
const & implementationName
,
269 const enum ::xmloff::token::XMLTokenEnum eClass
,
270 SvXMLExportFlags nExportFlag
);
273 const css::uno::Reference
< css::uno::XComponentContext
>& xContext
,
274 OUString
const & implementationName
,
275 const OUString
& rFileName
,
276 sal_Int16
const eDefaultMeasureUnit
/*css::util::MeasureUnit*/,
277 const css::uno::Reference
< css::xml::sax::XDocumentHandler
> & rHandler
);
280 const css::uno::Reference
< css::uno::XComponentContext
>& xContext
,
281 OUString
const & implementationName
,
282 const OUString
& rFileName
,
283 const css::uno::Reference
< css::xml::sax::XDocumentHandler
> & rHandler
,
284 const css::uno::Reference
< css::frame::XModel
> &,
285 FieldUnit
const eDefaultFieldUnit
,
286 SvXMLExportFlags nExportFlag
);
288 virtual ~SvXMLExport() override
;
290 virtual void collectAutoStyles();
292 static const css::uno::Sequence
< sal_Int8
> & getUnoTunnelId() throw();
293 static SvXMLExport
* getImplementation( const css::uno::Reference
< css::uno::XInterface
>& ) throw();
296 virtual void SAL_CALL
setSourceDocument( const css::uno::Reference
< css::lang::XComponent
>& xDoc
) override
;
299 virtual sal_Bool SAL_CALL
filter( const css::uno::Sequence
< css::beans::PropertyValue
>& aDescriptor
) override
;
300 virtual void SAL_CALL
cancel() override
;
303 virtual void SAL_CALL
initialize( const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
306 virtual OUString SAL_CALL
getName( ) override
;
307 virtual void SAL_CALL
setName( const OUString
& aName
) override
;
310 virtual OUString SAL_CALL
getImplementationName( ) final override
;
311 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) final override
;
312 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) final override
;
315 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) override
;
317 /** ensures that the given namespace is in scope at the next started
320 <p>If the namespace is not yet declared, the necessary attribute will
321 be added, as well.</p>
323 @param i_rNamespace the namespace to be declared
325 @returns the actual prefix that the namespace is associated with
327 OUString
EnsureNamespace(OUString
const & i_rNamespace
);
329 // Check if common attribute list is empty.
331 void CheckAttrList() { (void) this; /* avoid loplugin:staticmethods */ }
333 void CheckAttrList();
336 // Clear common attribute list.
337 void ClearAttrList();
339 // Add an attribute to the common attribute list.
340 void AddAttributeASCII( sal_uInt16 nPrefix
, const sal_Char
*pName
,
341 const sal_Char
*pValue
);
342 void AddAttribute( sal_uInt16 nPrefix
, const sal_Char
*pName
,
343 const OUString
& rValue
);
344 void AddAttribute( sal_uInt16 nPrefix
, const OUString
& rName
,
345 const OUString
& rValue
);
346 void AddAttribute( sal_uInt16 nPrefix
,
347 enum ::xmloff::token::XMLTokenEnum eName
,
348 const OUString
& rValue
);
349 void AddAttribute( sal_uInt16 nPrefix
,
350 enum ::xmloff::token::XMLTokenEnum eName
,
351 enum ::xmloff::token::XMLTokenEnum eValue
);
352 void AddAttribute( const OUString
& rQName
,
353 const OUString
& rValue
);
354 void AddAttribute( const OUString
& rQName
,
355 enum ::xmloff::token::XMLTokenEnum eValue
);
357 /** Add language tag attributes, deciding which are necessary.
360 Namespace prefix for *:language, *:script and *:country
363 Namespace prefix for *:rfc-language-tag
366 Whether to write empty *:language and *:country attribute
367 values in case of an empty locale (denoting system).
369 void AddLanguageTagAttributes( sal_uInt16 nPrefix
, sal_uInt16 nPrefixRfc
,
370 const css::lang::Locale
& rLocale
, bool bWriteEmpty
);
372 /** Same as AddLanguageTagAttributes() but with LanguageTag parameter
375 void AddLanguageTagAttributes( sal_uInt16 nPrefix
, sal_uInt16 nPrefixRfc
,
376 const LanguageTag
& rLanguageTag
, bool bWriteEmpty
);
378 // add several attributes to the common attribute list
379 void AddAttributeList( const css::uno::Reference
<
380 css::xml::sax::XAttributeList
>& xAttrList
);
382 // Get common attribute list as implementation or interface.
383 SvXMLAttributeList
&GetAttrList() { return *mxAttrList
; }
384 css::uno::Reference
< css::xml::sax::XAttributeList
> GetXAttrList() { return mxAttrList
.get(); }
386 // Get document handler. This methods are not const, because the
387 // reference allowes modifications through the handler.
388 const css::uno::Reference
< css::xml::sax::XDocumentHandler
> & GetDocHandler() { return mxHandler
; }
391 const OUString
& GetOrigFileName() const { return msOrigFileName
; }
393 // Get (const) namespace map.
394 const SvXMLNamespaceMap
& GetNamespaceMap() const { return *mpNamespaceMap
; }
396 // Get unit converter
397 const SvXMLUnitConverter
& GetMM100UnitConverter() const { return maUnitConv
; }
399 SvXMLUnitConverter
& GetMM100UnitConverter() { return maUnitConv
; }
401 void addChaffWhenEncryptedStorage();
403 // Export the document.
404 virtual ErrCode
exportDoc( enum ::xmloff::token::XMLTokenEnum eClass
= ::xmloff::token::XML_TOKEN_INVALID
);
406 virtual void addDataStyle(const sal_Int32 nNumberFormat
, bool bTimeFormat
= false );
407 virtual void exportDataStyles();
408 virtual void exportAutoDataStyles();
409 virtual OUString
getDataStyleName(const sal_Int32 nNumberFormat
, bool bTimeFormat
= false ) const;
410 sal_Int32
dataStyleForceSystemLanguage(sal_Int32 nFormat
) const;
412 virtual void exportAnnotationMeta( const css::uno::Reference
< css::drawing::XShape
>& xShape
);
415 const css::uno::Reference
< css::frame::XModel
> &
416 GetModel() const { return mxModel
; }
417 // Get XNumberFormatsSupplier
418 css::uno::Reference
< css::util::XNumberFormatsSupplier
> & GetNumberFormatsSupplier() { return mxNumberFormatsSupplier
; }
419 void SetNumberFormatsSupplier(const css::uno::Reference
< css::util::XNumberFormatsSupplier
>& _xNumberFormatSupplier
)
421 mxNumberFormatsSupplier
= _xNumberFormatSupplier
;
422 if ( mxNumberFormatsSupplier
.is() && mxHandler
.is() )
423 mpNumExport
.reset( new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier
) );
426 // get export helper for text
427 inline rtl::Reference
< XMLTextParagraphExport
> const & GetTextParagraphExport();
429 // get export helper for shapes
430 inline rtl::Reference
< XMLShapeExport
> const & GetShapeExport();
432 // get auto style pool
433 inline rtl::Reference
< SvXMLAutoStylePoolP
> const & GetAutoStylePool();
436 inline rtl::Reference
< XMLPageExport
> const & GetPageExport();
438 // get chart export helper
439 inline rtl::Reference
< SchXMLExportHelper
> const & GetChartExport();
441 // get font auto style pool
442 inline rtl::Reference
< XMLFontAutoStylePool
> const & GetFontAutoStylePool();
444 ProgressBarHelper
* GetProgressBarHelper();
446 // get Formlayer Export
447 inline rtl::Reference
< xmloff::OFormLayerXMLExport
> const & GetFormExport();
448 inline bool HasFormExport();
450 // get XPropertySet with export information
451 const css::uno::Reference
< css::beans::XPropertySet
>& getExportInfo() const { return mxExportInfo
; }
453 const css::uno::Reference
< css::task::XStatusIndicator
>& GetStatusIndicator() { return mxStatusIndicator
; }
455 /// get Event export, with handlers for script types "None" and
456 /// "StarBasic" already registered; other handlers may be registered, too.
457 XMLEventExport
& GetEventExport();
459 /// get the export for image maps
460 XMLImageMapExport
& GetImageMapExport();
462 OUString
AddEmbeddedXGraphic(css::uno::Reference
<css::graphic::XGraphic
> const & rxGraphic
, OUString
& rOutMimeType
, OUString
const & rRequestedName
= OUString());
463 bool AddEmbeddedXGraphicAsBase64(css::uno::Reference
<css::graphic::XGraphic
> const & rxGraphic
);
464 bool GetGraphicMimeTypeFromStream(css::uno::Reference
<css::graphic::XGraphic
> const & rxGraphic
, OUString
& rOutMimeType
);
466 OUString
AddEmbeddedObject(
467 const OUString
& rEmbeddedObjectURL
);
468 bool AddEmbeddedObjectAsBase64(
469 const OUString
& rEmbeddedObjectURL
);
471 OUString
EncodeStyleName( const OUString
& rName
,
472 bool *pEncoded
=nullptr ) const;
474 // save linked sections?
475 bool IsSaveLinkedSections() { return mbSaveLinkedSections
; }
478 SvXMLExportFlags
getExportFlags() const { return mnExportFlags
; }
480 void ExportEmbeddedOwnObject(
481 css::uno::Reference
<css::lang::XComponent
> const & rComp
);
483 OUString
GetRelativeReference(const OUString
& rValue
);
485 // methods for accessing the document handler and handling SAX errors
486 void StartElement(sal_uInt16 nPrefix
,
487 enum ::xmloff::token::XMLTokenEnum eName
,
488 bool bIgnWSOutside
);
489 void StartElement(const OUString
& rName
,
490 bool bIgnWSOutside
);
491 void Characters(const OUString
& rChars
);
492 void EndElement(sal_uInt16 nPrefix
,
493 enum ::xmloff::token::XMLTokenEnum eName
,
495 void EndElement(const OUString
& rName
,
497 void IgnorableWhitespace();
500 * Record an error condition that occurred during export. The
501 * behavior of SetError can be modified using the error flag
505 /// error ID, may contain an error flag
507 /// string parameters for the error message
508 const css::uno::Sequence
< OUString
> & rMsgParams
,
509 /// original exception message (if applicable)
510 const OUString
& rExceptionMessage
,
511 /// error location (if applicable)
512 const css::uno::Reference
<css::xml::sax::XLocator
> & rLocator
);
516 const css::uno::Sequence
< OUString
> & rMsgParams
);
518 virtual void DisposingModel();
520 ::comphelper::UnoInterfaceToUniqueIdentifierMapper
& getInterfaceToIdentifierMapper();
522 const css::uno::Reference
< css::uno::XComponentContext
>& getComponentContext() { return m_xContext
;}
524 // Shapes in Writer cannot be named via context menu (#i51726#)
525 SvtModuleOptions::EFactory
GetModelType() const
530 // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
531 bool writeOutlineStyleAsNormalListStyle() const;
533 css::uno::Reference
< css::embed::XStorage
> const & GetTargetStorage();
535 /// returns the currently configured default version for odf export
536 SvtSaveOptions::ODFDefaultVersion
getDefaultVersion() const;
538 /// returns the deterministic version for odf export
539 SvtSaveOptions::ODFSaneDefaultVersion
getSaneDefaultVersion() const;
541 // FIXME: this is only for legacy stuff that has not yet been adapted
542 // to implement XMetadatable; this can write duplicate IDs!
543 /// add xml:id and legacy namespace id
544 void SAL_DLLPRIVATE
AddAttributeIdLegacy(
545 sal_uInt16
const nLegacyPrefix
, OUString
const& rValue
);
547 /// add xml:id attribute (for RDF metadata)
548 void AddAttributeXmlId(css::uno::Reference
<css::uno::XInterface
> const & i_xIfc
);
550 /// add RDFa attributes for a metadatable text content
551 void AddAttributesRDFa( css::uno::Reference
<css::text::XTextContent
> const & i_xTextContent
);
553 bool exportTextNumberElement() const;
555 /// set null date from model to unit converter, if not already done
556 bool SetNullDateOnUnitConverter();
558 /// Get clamped mimetype for image export (empty if none)
559 OUString
const & GetImageFilterName() const;
562 inline rtl::Reference
< XMLTextParagraphExport
> const & SvXMLExport::GetTextParagraphExport()
564 if( !mxTextParagraphExport
.is() )
565 mxTextParagraphExport
= CreateTextParagraphExport();
567 return mxTextParagraphExport
;
570 inline rtl::Reference
< XMLShapeExport
> const & SvXMLExport::GetShapeExport()
572 if( !mxShapeExport
.is() )
573 mxShapeExport
= CreateShapeExport();
575 return mxShapeExport
;
578 inline rtl::Reference
< SvXMLAutoStylePoolP
> const & SvXMLExport::GetAutoStylePool()
580 if( !mxAutoStylePool
.is() )
581 mxAutoStylePool
= CreateAutoStylePool();
583 return mxAutoStylePool
;
586 inline rtl::Reference
< SchXMLExportHelper
> const & SvXMLExport::GetChartExport()
588 if( !mxChartExport
.is() )
589 mxChartExport
= CreateChartExport();
591 return mxChartExport
;
594 inline rtl::Reference
< XMLPageExport
> const & SvXMLExport::GetPageExport()
596 if( !mxPageExport
.is() )
597 mxPageExport
= CreatePageExport();
602 inline rtl::Reference
< XMLFontAutoStylePool
> const & SvXMLExport::GetFontAutoStylePool()
604 if( !mxFontAutoStylePool
.is() )
605 mxFontAutoStylePool
= CreateFontAutoStylePool();
607 return mxFontAutoStylePool
;
610 inline rtl::Reference
< xmloff::OFormLayerXMLExport
> const & SvXMLExport::GetFormExport()
612 if( !mxFormExport
.is() )
613 mxFormExport
= CreateFormExport();
618 inline bool SvXMLExport::HasFormExport()
620 return mxFormExport
.is();
623 inline void SvXMLExport::SetEmbeddedResolver(
624 css::uno::Reference
< css::document::XEmbeddedObjectResolver
> const & _xEmbeddedResolver
)
626 mxEmbeddedResolver
= _xEmbeddedResolver
;
629 inline void SvXMLExport::SetGraphicStorageHandler(
630 css::uno::Reference
<css::document::XGraphicStorageHandler
> const & rxGraphicStorageHandler
)
632 mxGraphicStorageHandler
= rxGraphicStorageHandler
;
635 // Helper class to export an element.
636 class XMLOFF_DLLPUBLIC SvXMLElementExport
638 SvXMLExport
& mrExport
;
639 OUString maElementName
;
640 const bool mbIgnoreWhitespaceInside
:1;
641 const bool mbDoSomething
:1;
645 const sal_uInt16 nPrefix
,
646 const OUString
& rName
,
647 const bool bIgnoreWhitespaceOutside
);
651 // The constructor prints a start tag that has the common attributes
652 // of the XMLExport instance attached.
653 SvXMLElementExport( SvXMLExport
& rExp
, sal_uInt16 nPrefix
,
654 const sal_Char
*pName
,
655 bool bIgnWSOutside
, bool bIgnWSInside
);
656 SvXMLElementExport( SvXMLExport
& rExp
, sal_uInt16 nPrefix
,
657 const OUString
& rName
,
658 bool bIgnWSOutside
, bool bIgnWSInside
);
659 SvXMLElementExport( SvXMLExport
& rExp
, sal_uInt16 nPrefix
,
660 enum ::xmloff::token::XMLTokenEnum eName
,
661 bool bIgnWSOutside
, bool bIgnWSInside
);
662 SvXMLElementExport( SvXMLExport
& rExp
, const OUString
& rQName
,
663 bool bIgnWSOutside
, bool bIgnWSInside
);
665 // These constructors do nothing if bDoSomething is not set
666 SvXMLElementExport( SvXMLExport
& rExp
, bool bDoSomething
,
668 enum ::xmloff::token::XMLTokenEnum eName
,
669 bool bIgnWSOutside
, bool bIgnWSInside
);
671 // The destructor prints an end tag.
672 ~SvXMLElementExport();
675 #endif // _XMLOFF_SVXMLEXP_HXX
677 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */