1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmlexp.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _XMLOFF_XMLEXP_HXX
32 #define _XMLOFF_XMLEXP_HXX
34 #ifndef _COM_SUN_STAR_XML_SAX_SAXPARSEEXCEPTION_HPP_
35 #include <com/sun/star/xml/sax/SAXParseException.hpp>
37 #ifndef _COM_SUN_STAR_XML_SAX_XEXTENDEDDOCUMENTHANDLER_HPP_
38 #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
40 #ifndef _COM_SUN_STAR_XML_SAX_SAXEXCEPTION_HPP_
41 #include <com/sun/star/xml/sax/SAXException.hpp>
43 #ifndef _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_
44 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
46 #ifndef _COM_SUN_STAR_XML_SAX_XATTRIBUTELIST_HPP_
47 #include <com/sun/star/xml/sax/XAttributeList.hpp>
49 #ifndef _COM_SUN_STAR_XML_SAX_XLOCATOR_HPP_
50 #include <com/sun/star/xml/sax/XLocator.hpp>
52 #ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATSSUPPLIER_HPP_
53 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
55 #ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
56 #include <com/sun/star/lang/XUnoTunnel.hpp>
59 #ifndef _RTL_USTRING_HXX_
60 #include <rtl/ustring.hxx>
62 #ifndef _VCL_MAPUNIT_HXX
63 #include <vcl/mapunit.hxx>
66 #ifndef _XMLOFF_TEXTPARAE_HXX_
67 #include <bf_xmloff/txtparae.hxx>
69 #ifndef _XMLOFF_FORMLAYEREXPORT_HXX_
70 #include <bf_xmloff/formlayerexport.hxx>
72 #ifndef _XMLOFF_XMLNUMFE_HXX
73 #include <bf_xmloff/xmlnumfe.hxx>
76 #ifndef _XMLOFF_XMLASTPLP_HXX
77 #include <bf_xmloff/xmlaustp.hxx>
80 #ifndef _XMLOFF_SHAPEEXPORT_HXX_
81 #include <bf_xmloff/shapeexport.hxx>
84 #ifndef _XMLOFF_XMLTOKEN_HXX
85 #include <bf_xmloff/xmltoken.hxx>
88 #ifndef _XMLOFF_SCH_XMLEXPORTHELPER_HXX_
89 #include <bf_xmloff/SchXMLExportHelper.hxx>
91 #ifndef _XMLOFF_XMLFONTAUTOSTYLEPOOL_HXX
92 #include <bf_xmloff/XMLFontAutoStylePool.hxx>
94 #ifndef _COM_SUN_STAR_DOCUMENT_XFILTER_HPP_
95 #include <com/sun/star/document/XFilter.hpp>
97 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
98 #include <com/sun/star/lang/XServiceInfo.hpp>
100 #ifndef _COM_SUN_STAR_DOCUMENT_XEXPORTER_HPP_
101 #include <com/sun/star/document/XExporter.hpp>
103 #ifndef _COM_SUN_STAR_DRAWING_XGRAPHICOBJECTRESOLVER_HPP_
104 #include <com/sun/star/document/XGraphicObjectResolver.hpp>
106 #ifndef _COM_SUN_STAR_DRAWING_XEMBEDDEDOBJECTRESOLVER_HPP_
107 #include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
109 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
110 #include <com/sun/star/beans/XPropertySet.hpp>
112 #ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
113 #include <com/sun/star/lang/XInitialization.hpp>
115 #ifndef _COM_SUN_STAR_DOCUMENT_XEVENTLISTENER_HPP_
116 #include <com/sun/star/lang/XEventListener.hpp>
118 #ifndef _COM_SUN_STAR_CONTAINER_XNAMED_HPP_
119 #include <com/sun/star/container/XNamed.hpp>
122 #ifndef _XMLOFF_XMLPAGEEXPORT_HXX
123 #include <bf_xmloff/XMLPageExport.hxx>
125 #ifndef _XMLOFF_PROGRESSBARHELPER_HXX
126 #include <bf_xmloff/ProgressBarHelper.hxx>
129 #ifndef _CPPUHELPER_IMPLBASE6_HXX_
130 #include <cppuhelper/implbase6.hxx>
132 namespace rtl
{ class OUString
; }
133 namespace com
{ namespace sun
{ namespace star
{
134 namespace frame
{ class XModel
; }
135 namespace container
{ class XIndexContainer
; }
137 namespace binfilter
{
139 class SvXMLNamespaceMap
;
140 class SvXMLAttributeList
;
141 class SvXMLExport_Impl
;
142 class SvXMLUnitConverter
;
143 class ProgressBarHelper
;
144 class XMLEventExport
;
145 class XMLSettingsExportHelper
;
146 class XMLImageMapExport
;
148 class SvXMLExportEventListener
;
151 #define EXPORT_META 0x0001
152 #define EXPORT_STYLES 0x0002
153 #define EXPORT_MASTERSTYLES 0x0004
154 #define EXPORT_AUTOSTYLES 0x0008
155 #define EXPORT_CONTENT 0x0010
156 #define EXPORT_SCRIPTS 0x0020
157 #define EXPORT_SETTINGS 0x0040
158 #define EXPORT_FONTDECLS 0x0080
159 #define EXPORT_EMBEDDED 0x0100
160 #define EXPORT_NODOCTYPE 0x0200
161 #define EXPORT_PRETTY 0x0400
162 #define EXPORT_ALL 0xffff
164 class SvXMLExport
: public ::cppu::WeakImplHelper6
<
165 ::com::sun::star::document::XFilter
,
166 ::com::sun::star::lang::XServiceInfo
,
167 ::com::sun::star::document::XExporter
,
168 ::com::sun::star::lang::XInitialization
,
169 ::com::sun::star::container::XNamed
,
170 ::com::sun::star::lang::XUnoTunnel
>
172 SvXMLExport_Impl
*pImpl
; // dummy
175 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> mxServiceFactory
;
177 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> xModel
;
178 ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XDocumentHandler
> xHandler
; // the handlers
179 ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XExtendedDocumentHandler
> xExtHandler
;
180 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormatsSupplier
> xNumberFormatsSupplier
;
181 ::com::sun::star::uno::Reference
< ::com::sun::star::document::XGraphicObjectResolver
> xGraphicResolver
;
182 ::com::sun::star::uno::Reference
< ::com::sun::star::document::XEmbeddedObjectResolver
> xEmbeddedResolver
;
183 ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
> xStatusIndicator
;
184 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> xExportInfo
;
186 SvXMLAttributeList
*pAttrList
; // a common attribute list
187 ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
> xAttrList
; // and an interface of it
189 ::rtl::OUString sOrigFileName
; // the original URL
190 ::rtl::OUString sPicturesPath
;
191 ::rtl::OUString sGraphicObjectProtocol
;
192 ::rtl::OUString sEmbeddedObjectProtocol
;
193 ::rtl::OUString sObjectsPath
;
194 ::rtl::OUString sFilterName
;
195 SvXMLNamespaceMap
*pNamespaceMap
; // the namepspace map
196 SvXMLUnitConverter
*pUnitConv
; // the unit converter
197 SvXMLNumFmtExport
*pNumExport
;
198 ProgressBarHelper
*pProgressBarHelper
;
200 UniReference
< XMLTextParagraphExport
> mxTextParagraphExport
;
201 UniReference
< XMLShapeExport
> mxShapeExport
;
202 UniReference
< SvXMLAutoStylePoolP
> mxAutoStylePool
;
203 UniReference
< SchXMLExportHelper
> mxChartExport
;
204 UniReference
< XMLPageExport
> mxPageExport
;
205 UniReference
< XMLFontAutoStylePool
> mxFontAutoStylePool
;
206 UniReference
< xmloff::OFormLayerXMLExport
> mxFormExport
;
207 XMLEventExport
* pEventExport
;
208 XMLImageMapExport
* pImageMapExport
;
209 XMLErrors
* pXMLErrors
;
210 SvXMLExportEventListener
* pEventListener
;
212 sal_Bool bExtended
; // Does document contain extens.
214 const enum ::binfilter::xmloff::token::XMLTokenEnum meClass
;
217 sal_uInt16 mnExportFlags
;
218 sal_uInt16 mnErrorFlags
;
222 const ::rtl::OUString sWS
; // " "
226 void ImplExportMeta(); // <office:meta>
227 void ImplExportSettings(); // <office:settings>
228 void ImplExportStyles( sal_Bool bUsed
); // <office:styles>
229 void ImplExportAutoStyles( sal_Bool bUsed
); // <office:automatic-styles>
230 void ImplExportMasterStyles( sal_Bool bUsed
); // <office:master-styles>
231 void ImplExportContent(); // <office:body>
232 virtual void SetBodyAttributes();
235 void setExportFlags( sal_uInt16 nExportFlags
) { mnExportFlags
= nExportFlags
; }
237 // Get (modifyable) namespace map
238 SvXMLNamespaceMap
& _GetNamespaceMap() { return *pNamespaceMap
; }
240 // This method can be overloaded to export the content of <office:meta>.
241 // There is a default implementation.
242 virtual void _ExportMeta();
244 // This method can be overloaded to export the content of <office:view-settings>.
245 // There is no default implementation.
246 virtual void _ExportViewSettings(const XMLSettingsExportHelper
& rSettingsExportHelper
);
248 // This method can be overloaded to export the content of <office:configuration-settings>.
249 // There is no default implementation.
250 virtual void _ExportConfigurationSettings(const XMLSettingsExportHelper
& rSettingsExportHelper
);
252 // This method can be overloaded to export the content of <office:script>.
253 // There is a default implementation.
254 virtual void _ExportScripts();
256 // This method can be overloaded to export the font declarationsE
257 // The default implementation will export the contents of the
258 // XMLFontAutoStylePool if it has been created.
259 virtual void _ExportFontDecls();
261 // This method should be overloaded to export the content of <style:styles>.
262 // If bUsed is set, used styles should be exported only.
263 // Overloaded Methods must call this method !
264 virtual void _ExportStyles( sal_Bool bUsed
) ;
266 // This method must be overloaded to export the contents of
267 // <style:auto-styles>
268 virtual void _ExportAutoStyles() = 0;
270 // This method must be overloaded to export the contents of
271 // <style:master-styles>
272 virtual void _ExportMasterStyles() = 0;
274 // This method must be overloaded to export the content of <office:body>.
275 virtual void _ExportContent() = 0;
277 void SetExtended( sal_Bool bSet
=sal_True
) { bExtended
= bSet
; }
279 // save linked sections? (may be false in global documents)
280 sal_Bool bSaveLinkedSections
;
282 virtual XMLTextParagraphExport
* CreateTextParagraphExport();
283 virtual XMLShapeExport
* CreateShapeExport();
284 virtual SvXMLAutoStylePoolP
* CreateAutoStylePool();
285 virtual SchXMLExportHelper
* CreateChartExport();
286 virtual XMLPageExport
* CreatePageExport();
287 virtual XMLFontAutoStylePool
* CreateFontAutoStylePool();
288 virtual xmloff::OFormLayerXMLExport
* CreateFormExport();
289 virtual void GetViewSettings( ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& aProps
);
290 virtual void GetConfigurationSettings( ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& aProps
);
292 const ::com::sun::star::uno::Reference
< ::com::sun::star::document::XEmbeddedObjectResolver
>& GetEmbeddedResolver() const { return xEmbeddedResolver
; }
293 inline void SetEmbeddedResolver( ::com::sun::star::uno::Reference
< ::com::sun::star::document::XEmbeddedObjectResolver
>& _xEmbeddedResolver
);
295 const ::com::sun::star::uno::Reference
< ::com::sun::star::document::XGraphicObjectResolver
>& GetGraphicResolver() const { return xGraphicResolver
; }
296 void SetGraphicResolver( ::com::sun::star::uno::Reference
< ::com::sun::star::document::XGraphicObjectResolver
>& _xGraphicResolver
);
300 //SvXMLExport( MapUnit eDfltUnit,
301 // const enum ::binfilter::xmloff::token::XMLTokenEnum eClass = xmloff::token::XML_TOKEN_INVALID,
302 // sal_uInt16 nExportFlag = EXPORT_ALL );
304 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceFactory
,
306 const enum ::binfilter::xmloff::token::XMLTokenEnum eClass
= xmloff::token::XML_TOKEN_INVALID
,
307 sal_uInt16 nExportFlag
= EXPORT_ALL
);
309 virtual ~SvXMLExport();
311 static const ::com::sun::star::uno::Sequence
< sal_Int8
> & getUnoTunnelId() throw();
312 static SvXMLExport
* getImplementation( ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> ) throw();
315 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
);
318 virtual sal_Bool SAL_CALL
filter( const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& aDescriptor
) throw(::com::sun::star::uno::RuntimeException
);
319 virtual void SAL_CALL
cancel() throw(::com::sun::star::uno::RuntimeException
);
322 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
);
325 virtual ::rtl::OUString SAL_CALL
getName( ) throw (::com::sun::star::uno::RuntimeException
);
326 virtual void SAL_CALL
setName( const ::rtl::OUString
& aName
) throw (::com::sun::star::uno::RuntimeException
);
329 virtual ::rtl::OUString SAL_CALL
getImplementationName( ) throw(::com::sun::star::uno::RuntimeException
);
330 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
) throw(::com::sun::star::uno::RuntimeException
);
331 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException
);
334 virtual sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& aIdentifier
) throw(::com::sun::star::uno::RuntimeException
);
336 // Check if common attribute list is empty.
338 void CheckAttrList() {}
340 void CheckAttrList();
343 // Clear common attribute list.
344 void ClearAttrList();
346 // Add an attribute to the common attribute list.
347 void AddAttributeASCII( sal_uInt16 nPrefix
, const sal_Char
*pName
,
348 const sal_Char
*pValue
);
349 void AddAttribute( sal_uInt16 nPrefix
, const sal_Char
*pName
,
350 const ::rtl::OUString
& rValue
);
351 void AddAttribute( sal_uInt16 nPrefix
, const ::rtl::OUString
& rName
,
352 const ::rtl::OUString
& rValue
);
353 void AddAttribute( sal_uInt16 nPrefix
,
354 enum ::binfilter::xmloff::token::XMLTokenEnum eName
,
355 const ::rtl::OUString
& rValue
);
356 void AddAttribute( sal_uInt16 nPrefix
,
357 enum ::binfilter::xmloff::token::XMLTokenEnum eName
,
358 enum ::binfilter::xmloff::token::XMLTokenEnum eValue
);
359 void AddAttribute( const ::rtl::OUString
& rQName
,
360 const ::rtl::OUString
& rValue
);
361 void AddAttribute( const ::rtl::OUString
& rQName
,
362 enum ::binfilter::xmloff::token::XMLTokenEnum eValue
);
364 // Get common attribute list as implementation or interface.
365 SvXMLAttributeList
&GetAttrList() { return *pAttrList
; }
366 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
> & GetXAttrList() { return xAttrList
; }
368 // Get document handler. This methods are not const, because the
369 // reference allowes modifications through the handler.
370 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XDocumentHandler
> & GetDocHandler() { return xHandler
; }
371 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XExtendedDocumentHandler
> & GetExtDocHandler()
376 // Get original ::com::sun::star::util::URL.
377 const ::rtl::OUString
& GetOrigFileName() const { return sOrigFileName
; }
379 // Get the relative path for embedded pictures
380 const ::rtl::OUString
& GetPicturesPath() const { return sPicturesPath
; }
382 // Get the relative path for embedded objects
383 const ::rtl::OUString
& GetObjectsPath() const { return sObjectsPath
; }
385 // Get (const) namespace map.
386 const SvXMLNamespaceMap
& GetNamespaceMap() const { return *pNamespaceMap
; }
388 // Get unit converter
389 const SvXMLUnitConverter
& GetMM100UnitConverter() const { return *pUnitConv
; }
391 SvXMLUnitConverter
& GetMM100UnitConverter() { return *pUnitConv
; }
393 // Export the document.
394 virtual sal_uInt32
exportDoc( enum ::binfilter::xmloff::token::XMLTokenEnum eClass
= xmloff::token::XML_TOKEN_INVALID
);
396 virtual void addDataStyle(const sal_Int32 nNumberFormat
, sal_Bool bTimeFormat
= sal_False
);
397 virtual void exportDataStyles();
398 virtual void exportAutoDataStyles();
399 virtual ::rtl::OUString
getDataStyleName(const sal_Int32 nNumberFormat
, sal_Bool bTimeFormat
= sal_False
) const;
400 sal_Int32
dataStyleForceSystemLanguage(sal_Int32 nFormat
) const;
403 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> &
404 GetModel() const { return xModel
; }
405 // Get XNumberFormatsSupplier
406 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormatsSupplier
> & GetNumberFormatsSupplier() { return xNumberFormatsSupplier
; }
408 // get export helper for text
409 inline UniReference
< XMLTextParagraphExport
> GetTextParagraphExport();
411 // get export helper for shapes
412 inline UniReference
< XMLShapeExport
> GetShapeExport();
414 // get auto style pool
415 inline UniReference
< SvXMLAutoStylePoolP
> GetAutoStylePool();
418 inline UniReference
< XMLPageExport
> GetPageExport();
420 // get chart export helper
421 inline UniReference
< SchXMLExportHelper
> GetChartExport();
423 // get font auto style pool
424 inline UniReference
< XMLFontAutoStylePool
> GetFontAutoStylePool();
426 ProgressBarHelper
* GetProgressBarHelper();
428 // get Formlayer Export
429 inline UniReference
< xmloff::OFormLayerXMLExport
> GetFormExport();
430 inline bool HasFormExport();
432 // get XPropertySet with export information
433 inline ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> getExportInfo() const { return xExportInfo
; }
435 ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
> GetStatusIndicator() { return xStatusIndicator
; }
437 /// get Event export, with handlers for script types "None" and
438 /// "StarBasic" already registered; other handlers may be registered, too.
439 XMLEventExport
& GetEventExport();
441 /// get the export for image maps
442 XMLImageMapExport
& GetImageMapExport();
444 ::rtl::OUString
AddEmbeddedGraphicObject(
445 const ::rtl::OUString
& rGraphicObjectURL
);
446 sal_Bool
AddEmbeddedGraphicObjectAsBase64(
447 const ::rtl::OUString
& rGraphicObjectURL
);
449 ::rtl::OUString
AddEmbeddedObject(
450 const ::rtl::OUString
& rEmbeddedObjectURL
);
451 sal_Bool
AddEmbeddedObjectAsBase64(
452 const ::rtl::OUString
& rEmbeddedObjectURL
);
454 // save linked sections?
455 inline sal_Bool
IsSaveLinkedSections() { return bSaveLinkedSections
; }
458 sal_uInt16
getExportFlags() const { return mnExportFlags
; }
460 sal_Bool
ExportEmbeddedOwnObject(
461 ::com::sun::star::uno::Reference
<
462 ::com::sun::star::lang::XComponent
>& rComp
);
464 ::rtl::OUString
GetRelativeReference(const ::rtl::OUString
& rValue
);
466 // methods for accessing the document handler and handling SAX errors
467 void StartElement(sal_uInt16 nPrefix
,
468 enum ::binfilter::xmloff::token::XMLTokenEnum eName
,
469 sal_Bool bIgnWSOutside
);
470 void StartElement(const ::rtl::OUString
& rName
,
471 sal_Bool bIgnWSOutside
);
472 void Characters(const ::rtl::OUString
& rChars
);
473 void EndElement(sal_uInt16 nPrefix
,
474 enum ::binfilter::xmloff::token::XMLTokenEnum eName
,
475 sal_Bool bIgnWSInside
);
476 void EndElement(const ::rtl::OUString
& rName
,
477 sal_Bool bIgnWSInside
);
478 void IgnorableWhitespace();
481 * Record an error condition that occured during export. The
482 * behavior of SetError can be modified using the error flag
486 /// error ID, may contain an error flag
488 /// string parameters for the error message
489 const ::com::sun::star::uno::Sequence
< ::rtl::OUString
> & rMsgParams
,
490 /// original exception message (if applicable)
491 const ::rtl::OUString
& rExceptionMessage
,
492 /// error location (if applicable)
493 const ::com::sun::star::uno::Reference
<
494 ::com::sun::star::xml::sax::XLocator
> & rLocator
);
498 const ::com::sun::star::uno::Sequence
< ::rtl::OUString
> & rMsgParams
);
500 /** return current error flags (logical 'or' of all error flags so far) */
501 sal_uInt16
GetErrorFlags() { return mnErrorFlags
; }
503 virtual void DisposingModel();
506 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> getServiceFactory();
509 inline UniReference
< XMLTextParagraphExport
> SvXMLExport::GetTextParagraphExport()
511 if( !mxTextParagraphExport
.is() )
512 mxTextParagraphExport
= CreateTextParagraphExport();
514 return mxTextParagraphExport
;
517 inline UniReference
< XMLShapeExport
> SvXMLExport::GetShapeExport()
519 if( !mxShapeExport
.is() )
520 mxShapeExport
= CreateShapeExport();
522 return mxShapeExport
;
525 inline UniReference
< SvXMLAutoStylePoolP
> SvXMLExport::GetAutoStylePool()
527 if( !mxAutoStylePool
.is() )
528 mxAutoStylePool
= CreateAutoStylePool();
530 return mxAutoStylePool
;
533 inline UniReference
< SchXMLExportHelper
> SvXMLExport::GetChartExport()
535 if( !mxChartExport
.is() )
536 mxChartExport
= CreateChartExport();
538 return mxChartExport
;
541 inline UniReference
< XMLPageExport
> SvXMLExport::GetPageExport()
543 if( !mxPageExport
.is() )
544 mxPageExport
= CreatePageExport();
549 inline UniReference
< XMLFontAutoStylePool
> SvXMLExport::GetFontAutoStylePool()
551 if( !mxFontAutoStylePool
.is() )
552 mxFontAutoStylePool
= CreateFontAutoStylePool();
554 return mxFontAutoStylePool
;
557 inline UniReference
< xmloff::OFormLayerXMLExport
> SvXMLExport::GetFormExport()
559 if( !mxFormExport
.is() )
560 mxFormExport
= CreateFormExport();
565 inline bool SvXMLExport::HasFormExport()
567 return mxFormExport
.is();
570 inline void SvXMLExport::SetEmbeddedResolver(
571 ::com::sun::star::uno::Reference
< ::com::sun::star::document::XEmbeddedObjectResolver
>& _xEmbeddedResolver
)
573 xEmbeddedResolver
= _xEmbeddedResolver
;
576 inline void SvXMLExport::SetGraphicResolver(
577 ::com::sun::star::uno::Reference
< ::com::sun::star::document::XGraphicObjectResolver
>& _xGraphicResolver
)
579 xGraphicResolver
= _xGraphicResolver
;
582 // Helper class to export an element.
583 class SvXMLElementExport
585 SvXMLExport
& rExport
;
586 ::rtl::OUString aName
;
588 sal_Bool bDoSomething
: 1;
590 void StartElement( SvXMLExport
& rExp
, sal_uInt16 nPrefix
,
591 const ::rtl::OUString
& rName
,
592 sal_Bool bIgnWSOutside
);
596 // The constructor prints a start tag that has the common attributes
597 // of the XMLExport instance attached.
598 SvXMLElementExport( SvXMLExport
& rExp
, sal_uInt16 nPrefix
,
599 const sal_Char
*pName
,
600 sal_Bool bIgnWSOutside
, sal_Bool bIgnWSInside
);
601 SvXMLElementExport( SvXMLExport
& rExp
, sal_uInt16 nPrefix
,
602 const ::rtl::OUString
& rName
,
603 sal_Bool bIgnWSOutside
, sal_Bool bIgnWSInside
);
604 SvXMLElementExport( SvXMLExport
& rExp
, sal_uInt16 nPrefix
,
605 enum ::binfilter::xmloff::token::XMLTokenEnum eName
,
606 sal_Bool bIgnWSOutside
, sal_Bool bIgnWSInside
);
607 SvXMLElementExport( SvXMLExport
& rExp
, const ::rtl::OUString
& rQName
,
608 sal_Bool bIgnWSOutside
, sal_Bool bIgnWSInside
);
610 // Thes constructors do nothing if bDoSomething is not set
611 SvXMLElementExport( SvXMLExport
& rExp
, sal_Bool bDoSomething
,
613 enum ::binfilter::xmloff::token::XMLTokenEnum eName
,
614 sal_Bool bIgnWSOutside
, sal_Bool bIgnWSInside
);
616 // The destructor prints an end tag.
617 ~SvXMLElementExport();
620 }//end of namespace binfilter
621 #endif // _XMLOFF_SVXMLEXP_HXX