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 _XMLOFF_XMLEXP_HXX
21 #define _XMLOFF_XMLEXP_HXX
23 #include "sal/config.h"
24 #include "xmloff/dllapi.h"
25 #include "sal/types.h"
27 #include <com/sun/star/embed/XStorage.hpp>
28 #include <com/sun/star/xml/sax/SAXParseException.hpp>
29 #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
30 #include <com/sun/star/xml/sax/SAXException.hpp>
31 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
32 #include <com/sun/star/xml/sax/XAttributeList.hpp>
33 #include <com/sun/star/xml/sax/XLocator.hpp>
34 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
35 #include <com/sun/star/lang/XUnoTunnel.hpp>
36 #include <rtl/ustring.hxx>
37 #include <xmloff/txtparae.hxx>
38 #include <xmloff/formlayerexport.hxx>
39 #include <xmloff/xmlnumfe.hxx>
40 #include <xmloff/xmlaustp.hxx>
41 #include <xmloff/shapeexport.hxx>
42 #include <xmloff/xmltoken.hxx>
43 #include <xmloff/SchXMLExportHelper.hxx>
44 #include <xmloff/XMLFontAutoStylePool.hxx>
45 #include <com/sun/star/document/XFilter.hpp>
46 #include <com/sun/star/lang/XServiceInfo.hpp>
47 #include <com/sun/star/document/XExporter.hpp>
48 #include <com/sun/star/document/XGraphicObjectResolver.hpp>
49 #include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
50 #include <com/sun/star/beans/XPropertySet.hpp>
51 #include <com/sun/star/lang/XInitialization.hpp>
52 #include <com/sun/star/lang/XEventListener.hpp>
53 #include <com/sun/star/uno/XComponentContext.hpp>
54 #include <com/sun/star/container/XNamed.hpp>
56 #include <unotools/saveopt.hxx>
58 #include <xmloff/XMLPageExport.hxx>
59 #include <xmloff/ProgressBarHelper.hxx>
60 #include <cppuhelper/implbase6.hxx>
64 class SvXMLNamespaceMap
;
65 class SvXMLAttributeList
;
66 class SvXMLExport_Impl
;
67 class SvXMLUnitConverter
;
68 class ProgressBarHelper
;
70 class XMLSettingsExportHelper
;
71 class XMLImageMapExport
;
74 // Shapes in Writer cannot be named via context menu (#i51726#)
75 #include <unotools/moduleoptions.hxx>
77 namespace com
{ namespace sun
{ namespace star
{
78 namespace frame
{ class XModel
; }
79 namespace container
{ class XIndexContainer
; }
81 namespace comphelper
{ class UnoInterfaceToUniqueIdentifierMapper
; }
83 #define EXPORT_META 0x0001
84 #define EXPORT_STYLES 0x0002
85 #define EXPORT_MASTERSTYLES 0x0004
86 #define EXPORT_AUTOSTYLES 0x0008
87 #define EXPORT_CONTENT 0x0010
88 #define EXPORT_SCRIPTS 0x0020
89 #define EXPORT_SETTINGS 0x0040
90 #define EXPORT_FONTDECLS 0x0080
91 #define EXPORT_EMBEDDED 0x0100
92 #define EXPORT_NODOCTYPE 0x0200
93 #define EXPORT_PRETTY 0x0400
94 #define EXPORT_SAVEBACKWARDCOMPATIBLE 0x0800
95 #define EXPORT_OASIS 0x8000
96 #define EXPORT_ALL 0x7fff
98 class XMLOFF_DLLPUBLIC SvXMLExport
: public ::cppu::WeakImplHelper6
<
99 ::com::sun::star::document::XFilter
,
100 ::com::sun::star::lang::XServiceInfo
,
101 ::com::sun::star::document::XExporter
,
102 ::com::sun::star::lang::XInitialization
,
103 ::com::sun::star::container::XNamed
,
104 ::com::sun::star::lang::XUnoTunnel
>
106 SvXMLExport_Impl
*mpImpl
; // dummy
108 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xContext
;
110 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> mxModel
;
111 ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XDocumentHandler
> mxHandler
; // the handlers
112 ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XExtendedDocumentHandler
> mxExtHandler
;
113 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormatsSupplier
> mxNumberFormatsSupplier
;
114 ::com::sun::star::uno::Reference
< ::com::sun::star::document::XGraphicObjectResolver
> mxGraphicResolver
;
115 ::com::sun::star::uno::Reference
< ::com::sun::star::document::XEmbeddedObjectResolver
> mxEmbeddedResolver
;
116 ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
> mxStatusIndicator
;
117 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> mxExportInfo
;
118 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
> mxEventListener
;
120 SvXMLAttributeList
*mpAttrList
; // a common attribute list
121 ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
> mxAttrList
; // and an interface of it
123 OUString msOrigFileName
; // the original URL
124 OUString msGraphicObjectProtocol
;
125 OUString msEmbeddedObjectProtocol
;
126 OUString msFilterName
;
127 SvXMLNamespaceMap
*mpNamespaceMap
; // the namepspace map
128 SvXMLUnitConverter
*mpUnitConv
; // the unit converter
129 SvXMLNumFmtExport
*mpNumExport
;
130 ProgressBarHelper
*mpProgressBarHelper
;
132 UniReference
< XMLTextParagraphExport
> mxTextParagraphExport
;
133 UniReference
< XMLShapeExport
> mxShapeExport
;
134 UniReference
< SvXMLAutoStylePoolP
> mxAutoStylePool
;
135 UniReference
< SchXMLExportHelper
> mxChartExport
;
136 UniReference
< XMLPageExport
> mxPageExport
;
137 UniReference
< XMLFontAutoStylePool
> mxFontAutoStylePool
;
138 UniReference
< xmloff::OFormLayerXMLExport
> mxFormExport
;
139 XMLEventExport
* mpEventExport
;
140 XMLImageMapExport
* mpImageMapExport
;
141 XMLErrors
* mpXMLErrors
;
143 sal_Bool mbExtended
; // Does document contain extens.
145 const enum ::xmloff::token::XMLTokenEnum meClass
;
146 SAL_DLLPRIVATE
void _InitCtor();
148 sal_uInt16 mnExportFlags
;
149 sal_uInt16 mnErrorFlags
;
150 bool mbEnableExperimentalOdfExport
;
154 const OUString msWS
; // " "
158 // Shapes in Writer cannot be named via context menu (#i51726#)
159 SvtModuleOptions::EFactory meModelType
;
160 SAL_DLLPRIVATE
void _DetermineModelType();
162 SAL_DLLPRIVATE
void ImplExportMeta(); // <office:meta>
163 SAL_DLLPRIVATE
void ImplExportSettings(); // <office:settings>
164 SAL_DLLPRIVATE
void ImplExportStyles( sal_Bool bUsed
); // <office:styles>
165 SAL_DLLPRIVATE
void ImplExportAutoStyles( sal_Bool bUsed
);
166 // <office:automatic-styles>
167 SAL_DLLPRIVATE
void ImplExportMasterStyles( sal_Bool bUsed
);
168 // <office:master-styles>
169 SAL_DLLPRIVATE
void ImplExportContent(); // <office:body>
170 virtual void SetBodyAttributes();
171 void GetViewSettingsAndViews(com::sun::star::uno::Sequence
<com::sun::star::beans::PropertyValue
>& rProps
);
174 void setExportFlags( sal_uInt16 nExportFlags
) { mnExportFlags
= nExportFlags
; }
176 // Get (modifyable) namespace map
177 SvXMLNamespaceMap
& _GetNamespaceMap() { return *mpNamespaceMap
; }
179 // get a new namespave map (used in starmath to have a default namespace)
180 void ResetNamespaceMap();
182 // This method can be overloaded to export the content of <office:meta>.
183 // There is a default implementation.
184 virtual void _ExportMeta();
186 // This method can be overloaded to export the content of <office:scripts>.
187 // There is a default implementation.
188 virtual void _ExportScripts();
190 // This method can be overloaded to export the font declarations
191 // The default implementation will export the contents of the
192 // XMLFontAutoStylePool if it has been created.
193 virtual void _ExportFontDecls();
195 // This method should be overloaded to export the content of <style:styles>.
196 // If bUsed is set, used styles should be exported only.
197 // Overloaded Methods must call this method !
198 virtual void _ExportStyles( sal_Bool bUsed
) ;
200 // This method must be overloaded to export the contents of
201 // <style:auto-styles>
202 virtual void _ExportAutoStyles() = 0;
204 // This method must be overloaded to export the contents of
205 // <style:master-styles>
206 virtual void _ExportMasterStyles() = 0;
208 // This method must be overloaded to export the content of <office:body>.
209 virtual void _ExportContent() = 0;
211 void SetExtended( sal_Bool bSet
=sal_True
) { mbExtended
= bSet
; }
213 // save linked sections? (may be false in global documents)
214 sal_Bool mbSaveLinkedSections
;
216 virtual XMLTextParagraphExport
* CreateTextParagraphExport();
217 virtual XMLShapeExport
* CreateShapeExport();
218 virtual SvXMLAutoStylePoolP
* CreateAutoStylePool();
219 virtual SchXMLExportHelper
* CreateChartExport();
220 virtual XMLPageExport
* CreatePageExport();
221 virtual XMLFontAutoStylePool
* CreateFontAutoStylePool();
222 virtual xmloff::OFormLayerXMLExport
* CreateFormExport();
223 virtual void GetViewSettings(com::sun::star::uno::Sequence
<com::sun::star::beans::PropertyValue
>& aProps
);
224 virtual void GetConfigurationSettings(com::sun::star::uno::Sequence
<com::sun::star::beans::PropertyValue
>& aProps
);
228 ::xmloff::token::XMLTokenEnum eGroupName
;
229 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> aSettings
;
232 :eGroupName( ::xmloff::token::XML_TOKEN_INVALID
)
238 const ::xmloff::token::XMLTokenEnum _eGroupName
,
239 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& _rSettings
)
240 :eGroupName( _eGroupName
)
241 ,aSettings( _rSettings
)
245 /** returns the current document settings
247 The default implementation will obtain the view settings by calling GetViewSettingsAndViews, and the
248 configuration settings by calling GetConfigurationSettings, and return them together with the proper XML token.
251 the accumulated count of all settings in all groups
253 virtual sal_Int32
GetDocumentSpecificSettings( ::std::list
< SettingsGroup
>& _out_rSettings
);
255 const ::com::sun::star::uno::Reference
< ::com::sun::star::document::XEmbeddedObjectResolver
>& GetEmbeddedResolver() const { return mxEmbeddedResolver
; }
256 inline void SetEmbeddedResolver( com::sun::star::uno::Reference
< com::sun::star::document::XEmbeddedObjectResolver
>& _xEmbeddedResolver
);
258 const ::com::sun::star::uno::Reference
< ::com::sun::star::document::XGraphicObjectResolver
>& GetGraphicResolver() const { return mxGraphicResolver
; }
259 void SetGraphicResolver( com::sun::star::uno::Reference
< com::sun::star::document::XGraphicObjectResolver
>& _xGraphicResolver
);
261 void SetDocHandler( const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XDocumentHandler
> &rHandler
);
266 sal_Int16
const eDefaultMeasureUnit
/*css::util::MeasureUnit*/,
267 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& xContext
,
268 const enum ::xmloff::token::XMLTokenEnum eClass
= xmloff::token::XML_TOKEN_INVALID
,
269 sal_uInt16 nExportFlag
= EXPORT_ALL
);
272 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& xContext
,
273 const OUString
& rFileName
,
274 sal_Int16
const eDefaultMeasureUnit
/*css::util::MeasureUnit*/,
275 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XDocumentHandler
> & rHandler
);
278 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& xContext
,
279 const OUString
& rFileName
,
280 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XDocumentHandler
> & rHandler
,
281 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> &,
282 sal_Int16
const eDefaultFieldUnit
);
284 virtual ~SvXMLExport();
286 static const ::com::sun::star::uno::Sequence
< sal_Int8
> & getUnoTunnelId() throw();
287 static SvXMLExport
* getImplementation( ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> ) throw();
290 virtual void SAL_CALL
setSourceDocument( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>& xDoc
) throw(::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
293 virtual sal_Bool SAL_CALL
filter( const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& aDescriptor
) throw(::com::sun::star::uno::RuntimeException
);
294 virtual void SAL_CALL
cancel() throw(::com::sun::star::uno::RuntimeException
);
297 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
) throw(::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
300 virtual OUString SAL_CALL
getName( ) throw (::com::sun::star::uno::RuntimeException
);
301 virtual void SAL_CALL
setName( const OUString
& aName
) throw (::com::sun::star::uno::RuntimeException
);
304 virtual OUString SAL_CALL
getImplementationName( ) throw(::com::sun::star::uno::RuntimeException
);
305 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw(::com::sun::star::uno::RuntimeException
);
306 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException
);
309 virtual sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& aIdentifier
) throw(::com::sun::star::uno::RuntimeException
);
311 /** ensures that the given namespace is in scope at the next started
314 <p>If the namespace is not yet declared, the necessary attribute will
315 be added, as well.</p>
317 @param i_rNamespace the namespace to be declared
318 @param i_rPreferredPrefix (opt.) preferred prefix for the namespace
320 @returns the actual prefix that the namespace is associated with
322 OUString
EnsureNamespace(OUString
const & i_rNamespace
,
323 OUString
const & i_rPreferredPrefix
= OUString("gen") );
325 // Check if common attribute list is empty.
327 void CheckAttrList() {}
329 void CheckAttrList();
332 // Clear common attribute list.
333 void ClearAttrList();
335 // Add an attribute to the common attribute list.
336 void AddAttributeASCII( sal_uInt16 nPrefix
, const sal_Char
*pName
,
337 const sal_Char
*pValue
);
338 void AddAttribute( sal_uInt16 nPrefix
, const sal_Char
*pName
,
339 const OUString
& rValue
);
340 void AddAttribute( sal_uInt16 nPrefix
, const OUString
& rName
,
341 const OUString
& rValue
);
342 void AddAttribute( sal_uInt16 nPrefix
,
343 enum ::xmloff::token::XMLTokenEnum eName
,
344 const OUString
& rValue
);
345 void AddAttribute( sal_uInt16 nPrefix
,
346 enum ::xmloff::token::XMLTokenEnum eName
,
347 enum ::xmloff::token::XMLTokenEnum eValue
);
348 void AddAttribute( const OUString
& rQName
,
349 const OUString
& rValue
);
350 void AddAttribute( const OUString
& rQName
,
351 enum ::xmloff::token::XMLTokenEnum eValue
);
352 // add several attributes to the common attribute list
353 void AddAttributeList( const ::com::sun::star::uno::Reference
<
354 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
356 // Get common attribute list as implementation or interface.
357 SvXMLAttributeList
&GetAttrList() { return *mpAttrList
; }
358 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
> & GetXAttrList() { return mxAttrList
; }
360 // Get document handler. This methods are not const, because the
361 // reference allowes modifications through the handler.
362 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XDocumentHandler
> & GetDocHandler() { return mxHandler
; }
363 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XExtendedDocumentHandler
> & GetExtDocHandler()
368 // Get original ::com::sun::star::util::URL.
369 const OUString
& GetOrigFileName() const { return msOrigFileName
; }
371 // Get (const) namespace map.
372 const SvXMLNamespaceMap
& GetNamespaceMap() const { return *mpNamespaceMap
; }
374 // Get unit converter
375 const SvXMLUnitConverter
& GetMM100UnitConverter() const { return *mpUnitConv
; }
377 SvXMLUnitConverter
& GetMM100UnitConverter() { return *mpUnitConv
; }
379 void addChaffWhenEncryptedStorage();
381 // Export the document.
382 virtual sal_uInt32
exportDoc( enum ::xmloff::token::XMLTokenEnum eClass
= ::xmloff::token::XML_TOKEN_INVALID
);
384 virtual void addDataStyle(const sal_Int32 nNumberFormat
, sal_Bool bTimeFormat
= sal_False
);
385 virtual void exportDataStyles();
386 virtual void exportAutoDataStyles();
387 virtual OUString
getDataStyleName(const sal_Int32 nNumberFormat
, sal_Bool bTimeFormat
= sal_False
) const;
388 sal_Int32
dataStyleForceSystemLanguage(sal_Int32 nFormat
) const;
390 virtual void exportAnnotationMeta( const com::sun::star::uno::Reference
< com::sun::star::drawing::XShape
>& xShape
);
393 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> &
394 GetModel() const { return mxModel
; }
395 // Get XNumberFormatsSupplier
396 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormatsSupplier
> & GetNumberFormatsSupplier() { return mxNumberFormatsSupplier
; }
397 inline void SetNumberFormatsSupplier(const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormatsSupplier
>& _xNumberFormatSupplier
)
399 mxNumberFormatsSupplier
= _xNumberFormatSupplier
;
400 if ( mxNumberFormatsSupplier
.is() && mxHandler
.is() )
401 mpNumExport
= new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier
);
404 // get export helper for text
405 inline UniReference
< XMLTextParagraphExport
> GetTextParagraphExport();
407 // get export helper for shapes
408 inline UniReference
< XMLShapeExport
> GetShapeExport();
410 // get auto style pool
411 inline UniReference
< SvXMLAutoStylePoolP
> GetAutoStylePool();
414 inline UniReference
< XMLPageExport
> GetPageExport();
416 // get chart export helper
417 inline UniReference
< SchXMLExportHelper
> GetChartExport();
419 // get font auto style pool
420 inline UniReference
< XMLFontAutoStylePool
> GetFontAutoStylePool();
422 ProgressBarHelper
* GetProgressBarHelper();
424 // get Formlayer Export
425 inline UniReference
< xmloff::OFormLayerXMLExport
> GetFormExport();
426 inline bool HasFormExport();
428 // get XPropertySet with export information
429 inline ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> getExportInfo() const { return mxExportInfo
; }
431 com::sun::star::uno::Reference
< com::sun::star::task::XStatusIndicator
> GetStatusIndicator() { return mxStatusIndicator
; }
433 /// get Event export, with handlers for script types "None" and
434 /// "StarBasic" already registered; other handlers may be registered, too.
435 XMLEventExport
& GetEventExport();
437 /// get the export for image maps
438 XMLImageMapExport
& GetImageMapExport();
440 OUString
AddEmbeddedGraphicObject(
441 const OUString
& rGraphicObjectURL
);
442 sal_Bool
AddEmbeddedGraphicObjectAsBase64(
443 const OUString
& rGraphicObjectURL
);
445 OUString
AddEmbeddedObject(
446 const OUString
& rEmbeddedObjectURL
);
447 sal_Bool
AddEmbeddedObjectAsBase64(
448 const OUString
& rEmbeddedObjectURL
);
450 OUString
EncodeStyleName( const OUString
& rName
,
451 sal_Bool
*pEncoded
=0 ) const;
453 // save linked sections?
454 inline sal_Bool
IsSaveLinkedSections() { return mbSaveLinkedSections
; }
457 sal_uInt16
getExportFlags() const { return mnExportFlags
; }
459 sal_Bool
ExportEmbeddedOwnObject(
460 ::com::sun::star::uno::Reference
<
461 ::com::sun::star::lang::XComponent
>& rComp
);
463 OUString
GetRelativeReference(const OUString
& rValue
);
465 // methods for accessing the document handler and handling SAX errors
466 void StartElement(sal_uInt16 nPrefix
,
467 enum ::xmloff::token::XMLTokenEnum eName
,
468 sal_Bool bIgnWSOutside
);
469 void StartElement(const OUString
& rName
,
470 sal_Bool bIgnWSOutside
);
471 void Characters(const OUString
& rChars
);
472 void EndElement(sal_uInt16 nPrefix
,
473 enum ::xmloff::token::XMLTokenEnum eName
,
474 sal_Bool bIgnWSInside
);
475 void EndElement(const OUString
& rName
,
476 sal_Bool bIgnWSInside
);
477 void IgnorableWhitespace();
480 * Record an error condition that occurred during export. The
481 * behavior of SetError can be modified using the error flag
485 /// error ID, may contain an error flag
487 /// string parameters for the error message
488 const ::com::sun::star::uno::Sequence
< OUString
> & rMsgParams
,
489 /// original exception message (if applicable)
490 const OUString
& rExceptionMessage
,
491 /// error location (if applicable)
492 const ::com::sun::star::uno::Reference
<
493 ::com::sun::star::xml::sax::XLocator
> & rLocator
);
497 const ::com::sun::star::uno::Sequence
< OUString
> & rMsgParams
);
499 /** return current error flags (logical 'or' of all error flags so far) */
500 sal_uInt16
GetErrorFlags() { return mnErrorFlags
; }
502 virtual void DisposingModel();
504 ::comphelper::UnoInterfaceToUniqueIdentifierMapper
& getInterfaceToIdentifierMapper();
506 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> getComponentContext();
508 // Shapes in Writer cannot be named via context menu (#i51726#)
509 SvtModuleOptions::EFactory
GetModelType() const
514 // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
515 sal_Bool
writeOutlineStyleAsNormalListStyle() const;
516 bool isExperimentalOdfExportEnabled() const { return mbEnableExperimentalOdfExport
; }
518 ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
> GetTargetStorage();
520 /// returns the currently configured default version for odf export
521 SvtSaveOptions::ODFDefaultVersion
getDefaultVersion() const;
523 /// name of stream in package, e.g., "content.xml"
524 OUString
GetStreamName() const;
526 // FIXME: this is only for legacy stuff that has not yet been adapted
527 // to implement XMetadatable; this can write duplicate IDs!
528 /// add xml:id and legacy namespace id
529 void SAL_DLLPRIVATE
AddAttributeIdLegacy(
530 sal_uInt16
const nLegacyPrefix
, OUString
const& rValue
);
532 /// add xml:id attribute (for RDF metadata)
533 void AddAttributeXmlId(::com::sun::star::uno::Reference
<
534 ::com::sun::star::uno::XInterface
> const & i_xIfc
);
536 /// add RDFa attributes for a metadatable text content
537 void AddAttributesRDFa( ::com::sun::star::uno::Reference
<
538 ::com::sun::star::text::XTextContent
> const & i_xTextContent
);
540 sal_Bool
exportTextNumberElement() const;
542 /// set null date from model to unit converter, if not already done
543 sal_Bool
SetNullDateOnUnitConverter();
546 inline UniReference
< XMLTextParagraphExport
> SvXMLExport::GetTextParagraphExport()
548 if( !mxTextParagraphExport
.is() )
549 mxTextParagraphExport
= CreateTextParagraphExport();
551 return mxTextParagraphExport
;
554 inline UniReference
< XMLShapeExport
> SvXMLExport::GetShapeExport()
556 if( !mxShapeExport
.is() )
557 mxShapeExport
= CreateShapeExport();
559 return mxShapeExport
;
562 inline UniReference
< SvXMLAutoStylePoolP
> SvXMLExport::GetAutoStylePool()
564 if( !mxAutoStylePool
.is() )
565 mxAutoStylePool
= CreateAutoStylePool();
567 return mxAutoStylePool
;
570 inline UniReference
< SchXMLExportHelper
> SvXMLExport::GetChartExport()
572 if( !mxChartExport
.is() )
573 mxChartExport
= CreateChartExport();
575 return mxChartExport
;
578 inline UniReference
< XMLPageExport
> SvXMLExport::GetPageExport()
580 if( !mxPageExport
.is() )
581 mxPageExport
= CreatePageExport();
586 inline UniReference
< XMLFontAutoStylePool
> SvXMLExport::GetFontAutoStylePool()
588 if( !mxFontAutoStylePool
.is() )
589 mxFontAutoStylePool
= CreateFontAutoStylePool();
591 return mxFontAutoStylePool
;
594 inline UniReference
< xmloff::OFormLayerXMLExport
> SvXMLExport::GetFormExport()
596 if( !mxFormExport
.is() )
597 mxFormExport
= CreateFormExport();
602 inline bool SvXMLExport::HasFormExport()
604 return mxFormExport
.is();
607 inline void SvXMLExport::SetEmbeddedResolver(
608 com::sun::star::uno::Reference
< com::sun::star::document::XEmbeddedObjectResolver
>& _xEmbeddedResolver
)
610 mxEmbeddedResolver
= _xEmbeddedResolver
;
613 inline void SvXMLExport::SetGraphicResolver(
614 com::sun::star::uno::Reference
< com::sun::star::document::XGraphicObjectResolver
>& _xGraphicResolver
)
616 mxGraphicResolver
= _xGraphicResolver
;
619 // Helper class to export an element.
620 class XMLOFF_DLLPUBLIC SvXMLElementExport
622 SvXMLExport
& rExport
;
625 sal_Bool bDoSomething
: 1;
627 SAL_DLLPRIVATE
void StartElement( SvXMLExport
& rExp
, sal_uInt16 nPrefix
,
628 const OUString
& rName
,
629 sal_Bool bIgnWSOutside
);
633 // The constructor prints a start tag that has the common attributes
634 // of the XMLExport instance attached.
635 SvXMLElementExport( SvXMLExport
& rExp
, sal_uInt16 nPrefix
,
636 const sal_Char
*pName
,
637 sal_Bool bIgnWSOutside
, sal_Bool bIgnWSInside
);
638 SvXMLElementExport( SvXMLExport
& rExp
, sal_uInt16 nPrefix
,
639 const OUString
& rName
,
640 sal_Bool bIgnWSOutside
, sal_Bool bIgnWSInside
);
641 SvXMLElementExport( SvXMLExport
& rExp
, sal_uInt16 nPrefix
,
642 enum ::xmloff::token::XMLTokenEnum eName
,
643 sal_Bool bIgnWSOutside
, sal_Bool bIgnWSInside
);
644 SvXMLElementExport( SvXMLExport
& rExp
, const OUString
& rQName
,
645 sal_Bool bIgnWSOutside
, sal_Bool bIgnWSInside
);
647 // Thes constructors do nothing if bDoSomething is not set
648 SvXMLElementExport( SvXMLExport
& rExp
, sal_Bool bDoSomething
,
650 enum ::xmloff::token::XMLTokenEnum eName
,
651 sal_Bool bIgnWSOutside
, sal_Bool bIgnWSInside
);
653 // The destructor prints an end tag.
654 ~SvXMLElementExport();
657 #endif // _XMLOFF_SVXMLEXP_HXX
659 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */