1ecfe53c5SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3ecfe53c5SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4ecfe53c5SAndrew Rist * or more contributor license agreements. See the NOTICE file
5ecfe53c5SAndrew Rist * distributed with this work for additional information
6ecfe53c5SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7ecfe53c5SAndrew Rist * to you under the Apache License, Version 2.0 (the
8ecfe53c5SAndrew Rist * "License"); you may not use this file except in compliance
9ecfe53c5SAndrew Rist * with the License. You may obtain a copy of the License at
10ecfe53c5SAndrew Rist *
11ecfe53c5SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12ecfe53c5SAndrew Rist *
13ecfe53c5SAndrew Rist * Unless required by applicable law or agreed to in writing,
14ecfe53c5SAndrew Rist * software distributed under the License is distributed on an
15ecfe53c5SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16ecfe53c5SAndrew Rist * KIND, either express or implied. See the License for the
17ecfe53c5SAndrew Rist * specific language governing permissions and limitations
18ecfe53c5SAndrew Rist * under the License.
19ecfe53c5SAndrew Rist *
20ecfe53c5SAndrew Rist *************************************************************/
21ecfe53c5SAndrew Rist
22ecfe53c5SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir #ifndef _XMLOFF_XMLEXP_HXX
25cdf0e10cSrcweir #define _XMLOFF_XMLEXP_HXX
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include "sal/config.h"
28cdf0e10cSrcweir #include "xmloff/dllapi.h"
29cdf0e10cSrcweir #include "sal/types.h"
30cdf0e10cSrcweir
31cdf0e10cSrcweir #include <com/sun/star/embed/XStorage.hpp>
32cdf0e10cSrcweir #include <com/sun/star/xml/sax/SAXParseException.hpp>
33cdf0e10cSrcweir #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
34cdf0e10cSrcweir #include <com/sun/star/xml/sax/SAXException.hpp>
35cdf0e10cSrcweir #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
36cdf0e10cSrcweir #include <com/sun/star/xml/sax/XAttributeList.hpp>
37cdf0e10cSrcweir #include <com/sun/star/xml/sax/XLocator.hpp>
38cdf0e10cSrcweir #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
39cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp>
40cdf0e10cSrcweir #include <rtl/ustring.hxx>
41cdf0e10cSrcweir #include <tools/mapunit.hxx>
42cdf0e10cSrcweir #include <xmloff/txtparae.hxx>
43cdf0e10cSrcweir #include <xmloff/formlayerexport.hxx>
44cdf0e10cSrcweir #include <xmloff/xmlnumfe.hxx>
45cdf0e10cSrcweir #include <xmloff/xmlaustp.hxx>
46cdf0e10cSrcweir #include <xmloff/shapeexport.hxx>
47cdf0e10cSrcweir #include <xmloff/xmltoken.hxx>
48cdf0e10cSrcweir #include <xmloff/SchXMLExportHelper.hxx>
49cdf0e10cSrcweir #include <xmloff/XMLFontAutoStylePool.hxx>
50cdf0e10cSrcweir #include <com/sun/star/document/XFilter.hpp>
51cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
52cdf0e10cSrcweir #include <com/sun/star/document/XExporter.hpp>
53cdf0e10cSrcweir #ifndef _COM_SUN_STAR_DRAWING_XGRAPHICOBJECTRESOLVER_HPP_
54cdf0e10cSrcweir #include <com/sun/star/document/XGraphicObjectResolver.hpp>
55cdf0e10cSrcweir #endif
56cdf0e10cSrcweir #ifndef _COM_SUN_STAR_DRAWING_XEMBEDDEDOBJECTRESOLVER_HPP_
57cdf0e10cSrcweir #include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
58cdf0e10cSrcweir #endif
59cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
60cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp>
61cdf0e10cSrcweir #include <com/sun/star/lang/XEventListener.hpp>
62cdf0e10cSrcweir #include <com/sun/star/container/XNamed.hpp>
63cdf0e10cSrcweir
64cdf0e10cSrcweir #include <unotools/saveopt.hxx>
65cdf0e10cSrcweir
66cdf0e10cSrcweir #include <xmloff/XMLPageExport.hxx>
67cdf0e10cSrcweir #include <xmloff/ProgressBarHelper.hxx>
68cdf0e10cSrcweir #include <cppuhelper/implbase6.hxx>
69cdf0e10cSrcweir
70cdf0e10cSrcweir #include <list>
71cdf0e10cSrcweir
72cdf0e10cSrcweir class SvXMLNamespaceMap;
73cdf0e10cSrcweir class SvXMLAttributeList;
74cdf0e10cSrcweir class SvXMLExport_Impl;
75cdf0e10cSrcweir class SvXMLUnitConverter;
76cdf0e10cSrcweir class ProgressBarHelper;
77cdf0e10cSrcweir class XMLEventExport;
78cdf0e10cSrcweir class XMLSettingsExportHelper;
79cdf0e10cSrcweir class XMLImageMapExport;
80cdf0e10cSrcweir class XMLErrors;
81cdf0e10cSrcweir
82cdf0e10cSrcweir // --> OD 2006-03-14 #i51726#
83cdf0e10cSrcweir #include <unotools/moduleoptions.hxx>
84cdf0e10cSrcweir // <--
85cdf0e10cSrcweir
86cdf0e10cSrcweir namespace rtl { class OUString; }
87cdf0e10cSrcweir namespace com { namespace sun { namespace star {
88cdf0e10cSrcweir namespace uno { class XComponentContext; }
89cdf0e10cSrcweir namespace frame { class XModel; }
90cdf0e10cSrcweir namespace container { class XIndexContainer; }
91cdf0e10cSrcweir } } }
92cdf0e10cSrcweir namespace comphelper { class UnoInterfaceToUniqueIdentifierMapper; }
93cdf0e10cSrcweir
94cdf0e10cSrcweir #define EXPORT_META 0x0001
95cdf0e10cSrcweir #define EXPORT_STYLES 0x0002
96cdf0e10cSrcweir #define EXPORT_MASTERSTYLES 0x0004
97cdf0e10cSrcweir #define EXPORT_AUTOSTYLES 0x0008
98cdf0e10cSrcweir #define EXPORT_CONTENT 0x0010
99cdf0e10cSrcweir #define EXPORT_SCRIPTS 0x0020
100cdf0e10cSrcweir #define EXPORT_SETTINGS 0x0040
101cdf0e10cSrcweir #define EXPORT_FONTDECLS 0x0080
102cdf0e10cSrcweir #define EXPORT_EMBEDDED 0x0100
103cdf0e10cSrcweir #define EXPORT_NODOCTYPE 0x0200
104cdf0e10cSrcweir #define EXPORT_PRETTY 0x0400
105cdf0e10cSrcweir #define EXPORT_SAVEBACKWARDCOMPATIBLE 0x0800
106cdf0e10cSrcweir #define EXPORT_OASIS 0x8000
107cdf0e10cSrcweir #define EXPORT_ALL 0x7fff
108cdf0e10cSrcweir
109cdf0e10cSrcweir class XMLOFF_DLLPUBLIC SvXMLExport : public ::cppu::WeakImplHelper6<
110cdf0e10cSrcweir ::com::sun::star::document::XFilter,
111cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo,
112cdf0e10cSrcweir ::com::sun::star::document::XExporter,
113cdf0e10cSrcweir ::com::sun::star::lang::XInitialization,
114cdf0e10cSrcweir ::com::sun::star::container::XNamed,
115cdf0e10cSrcweir ::com::sun::star::lang::XUnoTunnel>
116cdf0e10cSrcweir {
117cdf0e10cSrcweir SvXMLExport_Impl *mpImpl; // dummy
118cdf0e10cSrcweir
119cdf0e10cSrcweir // #110680#
120cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory;
121cdf0e10cSrcweir
122cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
123cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > mxHandler; // the handlers
124cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > mxExtHandler;
125cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > mxNumberFormatsSupplier;
126cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver > mxGraphicResolver;
127cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver > mxEmbeddedResolver;
128cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > mxStatusIndicator;
129cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxExportInfo;
130cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > mxEventListener;
131cdf0e10cSrcweir
132cdf0e10cSrcweir SvXMLAttributeList *mpAttrList; // a common attribute list
133cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > mxAttrList; // and an interface of it
134cdf0e10cSrcweir
135cdf0e10cSrcweir ::rtl::OUString msOrigFileName; // the original URL
136cdf0e10cSrcweir ::rtl::OUString msPicturesPath;
137cdf0e10cSrcweir ::rtl::OUString msGraphicObjectProtocol;
138cdf0e10cSrcweir ::rtl::OUString msEmbeddedObjectProtocol;
139cdf0e10cSrcweir ::rtl::OUString msObjectsPath;
140cdf0e10cSrcweir ::rtl::OUString msFilterName;
141cdf0e10cSrcweir SvXMLNamespaceMap *mpNamespaceMap; // the namepspace map
142cdf0e10cSrcweir SvXMLUnitConverter *mpUnitConv; // the unit converter
143cdf0e10cSrcweir SvXMLNumFmtExport *mpNumExport;
144cdf0e10cSrcweir ProgressBarHelper *mpProgressBarHelper;
145cdf0e10cSrcweir
146cdf0e10cSrcweir UniReference< XMLTextParagraphExport > mxTextParagraphExport;
147cdf0e10cSrcweir UniReference< XMLShapeExport > mxShapeExport;
148cdf0e10cSrcweir UniReference< SvXMLAutoStylePoolP > mxAutoStylePool;
149cdf0e10cSrcweir UniReference< SchXMLExportHelper > mxChartExport;
150cdf0e10cSrcweir UniReference< XMLPageExport > mxPageExport;
151cdf0e10cSrcweir UniReference< XMLFontAutoStylePool > mxFontAutoStylePool;
152cdf0e10cSrcweir UniReference< xmloff::OFormLayerXMLExport > mxFormExport;
153cdf0e10cSrcweir XMLEventExport* mpEventExport;
154cdf0e10cSrcweir XMLImageMapExport* mpImageMapExport;
155cdf0e10cSrcweir XMLErrors* mpXMLErrors;
156cdf0e10cSrcweir
157cdf0e10cSrcweir sal_Bool mbExtended; // Does document contain extens.
158cdf0e10cSrcweir
159cdf0e10cSrcweir const enum ::xmloff::token::XMLTokenEnum meClass;
160cdf0e10cSrcweir SAL_DLLPRIVATE void _InitCtor();
161cdf0e10cSrcweir
162cdf0e10cSrcweir sal_uInt16 mnExportFlags;
163cdf0e10cSrcweir sal_uInt16 mnErrorFlags;
164cdf0e10cSrcweir bool mbEnableExperimentalOdfExport;
165cdf0e10cSrcweir
166cdf0e10cSrcweir public:
167cdf0e10cSrcweir
168cdf0e10cSrcweir const ::rtl::OUString msWS; // " "
169cdf0e10cSrcweir
170cdf0e10cSrcweir private:
171cdf0e10cSrcweir
172cdf0e10cSrcweir // --> OD 2006-03-10 #i51726#
173cdf0e10cSrcweir SvtModuleOptions::EFactory meModelType;
174cdf0e10cSrcweir SAL_DLLPRIVATE void _DetermineModelType();
175cdf0e10cSrcweir // <--
176cdf0e10cSrcweir
177cdf0e10cSrcweir SAL_DLLPRIVATE void ImplExportMeta(); // <office:meta>
178cdf0e10cSrcweir SAL_DLLPRIVATE void ImplExportSettings(); // <office:settings>
179cdf0e10cSrcweir SAL_DLLPRIVATE void ImplExportStyles( sal_Bool bUsed ); // <office:styles>
180cdf0e10cSrcweir SAL_DLLPRIVATE void ImplExportAutoStyles( sal_Bool bUsed );
181cdf0e10cSrcweir // <office:automatic-styles>
182cdf0e10cSrcweir SAL_DLLPRIVATE void ImplExportMasterStyles( sal_Bool bUsed );
183cdf0e10cSrcweir // <office:master-styles>
184cdf0e10cSrcweir SAL_DLLPRIVATE void ImplExportContent(); // <office:body>
185cdf0e10cSrcweir virtual void SetBodyAttributes();
186cdf0e10cSrcweir void GetViewSettingsAndViews(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rProps);
187cdf0e10cSrcweir
188cdf0e10cSrcweir protected:
setExportFlags(sal_uInt16 nExportFlags)189cdf0e10cSrcweir void setExportFlags( sal_uInt16 nExportFlags ) { mnExportFlags = nExportFlags; }
190cdf0e10cSrcweir
191cdf0e10cSrcweir // Get (modifyable) namespace map
_GetNamespaceMap()192cdf0e10cSrcweir SvXMLNamespaceMap& _GetNamespaceMap() { return *mpNamespaceMap; }
193cdf0e10cSrcweir
194cdf0e10cSrcweir // get a new namespave map (used in starmath to have a default namespace)
195cdf0e10cSrcweir void ResetNamespaceMap();
196cdf0e10cSrcweir
197cdf0e10cSrcweir // This method can be overloaded to export the content of <office:meta>.
198cdf0e10cSrcweir // There is a default implementation.
199cdf0e10cSrcweir virtual void _ExportMeta();
200cdf0e10cSrcweir
201cdf0e10cSrcweir // This method can be overloaded to export the content of <office:scripts>.
202cdf0e10cSrcweir // There is a default implementation.
203cdf0e10cSrcweir virtual void _ExportScripts();
204cdf0e10cSrcweir
205cdf0e10cSrcweir // This method can be overloaded to export the font declarations
206cdf0e10cSrcweir // The default implementation will export the contents of the
207cdf0e10cSrcweir // XMLFontAutoStylePool if it has been created.
208cdf0e10cSrcweir virtual void _ExportFontDecls();
209cdf0e10cSrcweir
210cdf0e10cSrcweir // This method should be overloaded to export the content of <style:styles>.
211cdf0e10cSrcweir // If bUsed is set, used styles should be exported only.
212cdf0e10cSrcweir // Overloaded Methods must call this method !
213cdf0e10cSrcweir virtual void _ExportStyles( sal_Bool bUsed ) ;
214cdf0e10cSrcweir
215cdf0e10cSrcweir // This method must be overloaded to export the contents of
216cdf0e10cSrcweir // <style:auto-styles>
217cdf0e10cSrcweir virtual void _ExportAutoStyles() = 0;
218cdf0e10cSrcweir
219cdf0e10cSrcweir // This method must be overloaded to export the contents of
220cdf0e10cSrcweir // <style:master-styles>
221cdf0e10cSrcweir virtual void _ExportMasterStyles() = 0;
222cdf0e10cSrcweir
223cdf0e10cSrcweir // This method must be overloaded to export the content of <office:body>.
224cdf0e10cSrcweir virtual void _ExportContent() = 0;
225cdf0e10cSrcweir
SetExtended(sal_Bool bSet=sal_True)226cdf0e10cSrcweir void SetExtended( sal_Bool bSet=sal_True ) { mbExtended = bSet; }
227cdf0e10cSrcweir
228cdf0e10cSrcweir // save linked sections? (may be false in global documents)
229cdf0e10cSrcweir sal_Bool mbSaveLinkedSections;
230cdf0e10cSrcweir
231cdf0e10cSrcweir virtual XMLTextParagraphExport* CreateTextParagraphExport();
232cdf0e10cSrcweir virtual XMLShapeExport* CreateShapeExport();
233cdf0e10cSrcweir virtual SvXMLAutoStylePoolP* CreateAutoStylePool();
234cdf0e10cSrcweir virtual SchXMLExportHelper* CreateChartExport();
235cdf0e10cSrcweir virtual XMLPageExport* CreatePageExport();
236cdf0e10cSrcweir virtual XMLFontAutoStylePool* CreateFontAutoStylePool();
237cdf0e10cSrcweir virtual xmloff::OFormLayerXMLExport* CreateFormExport();
238cdf0e10cSrcweir virtual void GetViewSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
239cdf0e10cSrcweir virtual void GetConfigurationSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
240cdf0e10cSrcweir
241cdf0e10cSrcweir struct SettingsGroup
242cdf0e10cSrcweir {
243cdf0e10cSrcweir ::xmloff::token::XMLTokenEnum eGroupName;
244cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSettings;
245cdf0e10cSrcweir
SettingsGroupSvXMLExport::SettingsGroup246cdf0e10cSrcweir SettingsGroup()
247cdf0e10cSrcweir :eGroupName( ::xmloff::token::XML_TOKEN_INVALID )
248cdf0e10cSrcweir ,aSettings()
249cdf0e10cSrcweir {
250cdf0e10cSrcweir }
251cdf0e10cSrcweir
SettingsGroupSvXMLExport::SettingsGroup252cdf0e10cSrcweir SettingsGroup(
253cdf0e10cSrcweir const ::xmloff::token::XMLTokenEnum _eGroupName,
254cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rSettings )
255cdf0e10cSrcweir :eGroupName( _eGroupName )
256cdf0e10cSrcweir ,aSettings( _rSettings )
257cdf0e10cSrcweir {
258cdf0e10cSrcweir }
259cdf0e10cSrcweir };
260cdf0e10cSrcweir /** returns the current document settings
261cdf0e10cSrcweir
262cdf0e10cSrcweir The default implementation will obtain the view settings by calling GetViewSettingsAndViews, and the
263cdf0e10cSrcweir configuration settings by calling GetConfigurationSettings, and return them together with the proper XML token.
264cdf0e10cSrcweir
265cdf0e10cSrcweir @return
266cdf0e10cSrcweir the accumulated count of all settings in all groups
267cdf0e10cSrcweir */
268cdf0e10cSrcweir virtual sal_Int32 GetDocumentSpecificSettings( ::std::list< SettingsGroup >& _out_rSettings );
269cdf0e10cSrcweir
GetEmbeddedResolver() const270cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver >& GetEmbeddedResolver() const { return mxEmbeddedResolver; }
271cdf0e10cSrcweir inline void SetEmbeddedResolver( com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver );
272cdf0e10cSrcweir
GetGraphicResolver() const273cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver >& GetGraphicResolver() const { return mxGraphicResolver; }
274cdf0e10cSrcweir void SetGraphicResolver( com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver >& _xGraphicResolver );
275cdf0e10cSrcweir
276cdf0e10cSrcweir void SetDocHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > &rHandler );
277cdf0e10cSrcweir
278cdf0e10cSrcweir public:
279cdf0e10cSrcweir
280cdf0e10cSrcweir // #110680#
281cdf0e10cSrcweir //SvXMLExport( MapUnit eDfltUnit,
282cdf0e10cSrcweir // const enum ::xmloff::token::XMLTokenEnum eClass = xmloff::token::XML_TOKEN_INVALID,
283cdf0e10cSrcweir // sal_uInt16 nExportFlag = EXPORT_ALL );
284cdf0e10cSrcweir SvXMLExport(
285cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
286cdf0e10cSrcweir MapUnit eDfltUnit,
287cdf0e10cSrcweir const enum ::xmloff::token::XMLTokenEnum eClass = xmloff::token::XML_TOKEN_INVALID,
288cdf0e10cSrcweir sal_uInt16 nExportFlag = EXPORT_ALL );
289cdf0e10cSrcweir
290cdf0e10cSrcweir // #110680#
291cdf0e10cSrcweir //SvXMLExport( const ::rtl::OUString& rFileName,
292cdf0e10cSrcweir // const ::com::sun::star::uno::Reference<
293cdf0e10cSrcweir // ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
294cdf0e10cSrcweir // MapUnit eDfltUnit = MAP_INCH );
295cdf0e10cSrcweir SvXMLExport(
296cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
297cdf0e10cSrcweir const ::rtl::OUString& rFileName,
298cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
299cdf0e10cSrcweir MapUnit eDfltUnit = MAP_INCH );
300cdf0e10cSrcweir
301cdf0e10cSrcweir // #110680#
302cdf0e10cSrcweir //SvXMLExport( const ::rtl::OUString& rFileName,
303cdf0e10cSrcweir // const ::com::sun::star::uno::Reference<
304cdf0e10cSrcweir // ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
305cdf0e10cSrcweir // const ::com::sun::star::uno::Reference<
306cdf0e10cSrcweir // ::com::sun::star::frame::XModel > &,
307cdf0e10cSrcweir // sal_Int16 eDfltUnit );
308cdf0e10cSrcweir SvXMLExport(
309cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
310cdf0e10cSrcweir const ::rtl::OUString& rFileName,
311cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
312cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > &,
313cdf0e10cSrcweir sal_Int16 eDfltUnit );
314cdf0e10cSrcweir
315cdf0e10cSrcweir // #110680#
316cdf0e10cSrcweir //SvXMLExport( const ::rtl::OUString& rFileName,
317cdf0e10cSrcweir // const ::com::sun::star::uno::Reference<
318cdf0e10cSrcweir // ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
319cdf0e10cSrcweir // const ::com::sun::star::uno::Reference<
320cdf0e10cSrcweir // ::com::sun::star::frame::XModel > &,
321cdf0e10cSrcweir // const ::com::sun::star::uno::Reference<
322cdf0e10cSrcweir // ::com::sun::star::document::XGraphicObjectResolver > &,
323cdf0e10cSrcweir // sal_Int16 eDfltUnit );
324cdf0e10cSrcweir SvXMLExport(
325cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
326cdf0e10cSrcweir const ::rtl::OUString& rFileName,
327cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
328cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > &,
329cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver > &,
330cdf0e10cSrcweir sal_Int16 eDfltUnit );
331cdf0e10cSrcweir
332cdf0e10cSrcweir virtual ~SvXMLExport();
333cdf0e10cSrcweir
334cdf0e10cSrcweir static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
335cdf0e10cSrcweir static SvXMLExport* getImplementation( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ) throw();
336cdf0e10cSrcweir
337cdf0e10cSrcweir // XExporter
338cdf0e10cSrcweir 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);
339cdf0e10cSrcweir
340cdf0e10cSrcweir // XFilter
341cdf0e10cSrcweir virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) throw(::com::sun::star::uno::RuntimeException);
342cdf0e10cSrcweir virtual void SAL_CALL cancel() throw(::com::sun::star::uno::RuntimeException);
343cdf0e10cSrcweir
344cdf0e10cSrcweir // XInitialization
345cdf0e10cSrcweir 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);
346cdf0e10cSrcweir
347cdf0e10cSrcweir // XNamed
348cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getName( ) throw (::com::sun::star::uno::RuntimeException);
349cdf0e10cSrcweir virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
350cdf0e10cSrcweir
351cdf0e10cSrcweir // XServiceInfo
352cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
353cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
354cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
355cdf0e10cSrcweir
356cdf0e10cSrcweir // XUnoTunnel
357cdf0e10cSrcweir virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
358cdf0e10cSrcweir
359cdf0e10cSrcweir /** ensures that the given namespace is in scope at the next started
360cdf0e10cSrcweir element.
361cdf0e10cSrcweir
362cdf0e10cSrcweir <p>If the namespace is not yet declared, the necessary attribute will
363cdf0e10cSrcweir be added, as well.</p>
364cdf0e10cSrcweir
365cdf0e10cSrcweir @param i_rNamespace the namespace to be declared
366cdf0e10cSrcweir @param i_rPreferredPrefix (opt.) preferred prefix for the namespace
367cdf0e10cSrcweir
368cdf0e10cSrcweir @returns the actual prefix that the namespace is associated with
369cdf0e10cSrcweir */
370cdf0e10cSrcweir ::rtl::OUString
371cdf0e10cSrcweir EnsureNamespace(::rtl::OUString const & i_rNamespace,
372cdf0e10cSrcweir ::rtl::OUString const & i_rPreferredPrefix
373cdf0e10cSrcweir = ::rtl::OUString::createFromAscii("gen") );
374cdf0e10cSrcweir
375cdf0e10cSrcweir // Check if common attribute list is empty.
376cdf0e10cSrcweir #ifndef DBG_UTIL
CheckAttrList()377cdf0e10cSrcweir void CheckAttrList() {}
378cdf0e10cSrcweir #else
379cdf0e10cSrcweir void CheckAttrList();
380cdf0e10cSrcweir #endif
381cdf0e10cSrcweir
382cdf0e10cSrcweir // Clear common attribute list.
383cdf0e10cSrcweir void ClearAttrList();
384cdf0e10cSrcweir
385cdf0e10cSrcweir // Add an attribute to the common attribute list.
386cdf0e10cSrcweir void AddAttributeASCII( sal_uInt16 nPrefix, const sal_Char *pName,
387cdf0e10cSrcweir const sal_Char *pValue );
388cdf0e10cSrcweir void AddAttribute( sal_uInt16 nPrefix, const sal_Char *pName,
389cdf0e10cSrcweir const ::rtl::OUString& rValue );
390cdf0e10cSrcweir void AddAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rName,
391cdf0e10cSrcweir const ::rtl::OUString& rValue );
392cdf0e10cSrcweir void AddAttribute( sal_uInt16 nPrefix,
393cdf0e10cSrcweir enum ::xmloff::token::XMLTokenEnum eName,
394cdf0e10cSrcweir const ::rtl::OUString& rValue );
395cdf0e10cSrcweir void AddAttribute( sal_uInt16 nPrefix,
396cdf0e10cSrcweir enum ::xmloff::token::XMLTokenEnum eName,
397cdf0e10cSrcweir enum ::xmloff::token::XMLTokenEnum eValue );
398cdf0e10cSrcweir void AddAttribute( const ::rtl::OUString& rQName,
399cdf0e10cSrcweir const ::rtl::OUString& rValue );
400cdf0e10cSrcweir void AddAttribute( const ::rtl::OUString& rQName,
401cdf0e10cSrcweir enum ::xmloff::token::XMLTokenEnum eValue );
402cdf0e10cSrcweir // add several attributes to the common attribute list
403cdf0e10cSrcweir void AddAttributeList( const ::com::sun::star::uno::Reference<
404cdf0e10cSrcweir ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
405cdf0e10cSrcweir
406cdf0e10cSrcweir // Get common attribute list as implementation or interface.
GetAttrList()407cdf0e10cSrcweir SvXMLAttributeList &GetAttrList() { return *mpAttrList; }
GetXAttrList()408cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & GetXAttrList() { return mxAttrList; }
409cdf0e10cSrcweir
410cdf0e10cSrcweir // Get document handler. This methods are not const, because the
411cdf0e10cSrcweir // reference allowes modifications through the handler.
GetDocHandler()412cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & GetDocHandler() { return mxHandler; }
GetExtDocHandler()413cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > & GetExtDocHandler()
414cdf0e10cSrcweir {
415cdf0e10cSrcweir return mxExtHandler;
416cdf0e10cSrcweir }
417cdf0e10cSrcweir
418cdf0e10cSrcweir // Get original ::com::sun::star::util::URL.
GetOrigFileName() const419cdf0e10cSrcweir const ::rtl::OUString& GetOrigFileName() const { return msOrigFileName; }
420cdf0e10cSrcweir
421cdf0e10cSrcweir // Get the relative path for embedded pictures
GetPicturesPath() const422cdf0e10cSrcweir const ::rtl::OUString& GetPicturesPath() const { return msPicturesPath; }
423cdf0e10cSrcweir
424cdf0e10cSrcweir // Get the relative path for embedded objects
GetObjectsPath() const425cdf0e10cSrcweir const ::rtl::OUString& GetObjectsPath() const { return msObjectsPath; }
426cdf0e10cSrcweir
427cdf0e10cSrcweir // Get (const) namespace map.
GetNamespaceMap() const428cdf0e10cSrcweir const SvXMLNamespaceMap& GetNamespaceMap() const { return *mpNamespaceMap; }
429cdf0e10cSrcweir
430cdf0e10cSrcweir // Get unit converter
GetMM100UnitConverter() const431cdf0e10cSrcweir const SvXMLUnitConverter& GetMM100UnitConverter() const { return *mpUnitConv; }
432cdf0e10cSrcweir
GetMM100UnitConverter()433cdf0e10cSrcweir SvXMLUnitConverter& GetMM100UnitConverter() { return *mpUnitConv; }
434cdf0e10cSrcweir
435cdf0e10cSrcweir // Export the document.
436cdf0e10cSrcweir virtual sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID );
437cdf0e10cSrcweir
438cdf0e10cSrcweir virtual void addDataStyle(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False );
439cdf0e10cSrcweir virtual void exportDataStyles();
440cdf0e10cSrcweir virtual void exportAutoDataStyles();
441cdf0e10cSrcweir virtual rtl::OUString getDataStyleName(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat = sal_False ) const;
442cdf0e10cSrcweir sal_Int32 dataStyleForceSystemLanguage(sal_Int32 nFormat) const;
443cdf0e10cSrcweir
444cdf0e10cSrcweir virtual void exportAnnotationMeta( const com::sun::star::uno::Reference < com::sun::star::drawing::XShape >& xShape);
445cdf0e10cSrcweir
446cdf0e10cSrcweir // Get XModel
447cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > &
GetModel() const448cdf0e10cSrcweir GetModel() const { return mxModel; }
449cdf0e10cSrcweir // Get XNumberFormatsSupplier
GetNumberFormatsSupplier()450cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & GetNumberFormatsSupplier() { return mxNumberFormatsSupplier; }
SetNumberFormatsSupplier(const::com::sun::star::uno::Reference<::com::sun::star::util::XNumberFormatsSupplier> & _xNumberFormatSupplier)451cdf0e10cSrcweir inline void SetNumberFormatsSupplier(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& _xNumberFormatSupplier)
452cdf0e10cSrcweir {
453cdf0e10cSrcweir mxNumberFormatsSupplier = _xNumberFormatSupplier;
454cdf0e10cSrcweir if ( mxNumberFormatsSupplier.is() && mxHandler.is() )
455cdf0e10cSrcweir mpNumExport = new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier);
456cdf0e10cSrcweir }
457cdf0e10cSrcweir
458cdf0e10cSrcweir // get export helper for text
459cdf0e10cSrcweir inline UniReference< XMLTextParagraphExport > GetTextParagraphExport();
460cdf0e10cSrcweir
461cdf0e10cSrcweir // get export helper for shapes
462cdf0e10cSrcweir inline UniReference< XMLShapeExport > GetShapeExport();
463cdf0e10cSrcweir
464cdf0e10cSrcweir // get auto style pool
465cdf0e10cSrcweir inline UniReference< SvXMLAutoStylePoolP > GetAutoStylePool();
466cdf0e10cSrcweir
467cdf0e10cSrcweir // get Page Export
468cdf0e10cSrcweir inline UniReference< XMLPageExport > GetPageExport();
469cdf0e10cSrcweir
470cdf0e10cSrcweir // get chart export helper
471cdf0e10cSrcweir inline UniReference< SchXMLExportHelper > GetChartExport();
472cdf0e10cSrcweir
473cdf0e10cSrcweir // get font auto style pool
474cdf0e10cSrcweir inline UniReference< XMLFontAutoStylePool > GetFontAutoStylePool();
475cdf0e10cSrcweir
476cdf0e10cSrcweir ProgressBarHelper* GetProgressBarHelper();
477cdf0e10cSrcweir
478cdf0e10cSrcweir // get Formlayer Export
479cdf0e10cSrcweir inline UniReference< xmloff::OFormLayerXMLExport > GetFormExport();
480cdf0e10cSrcweir inline bool HasFormExport();
481cdf0e10cSrcweir
482cdf0e10cSrcweir // get XPropertySet with export information
getExportInfo() const483cdf0e10cSrcweir inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getExportInfo() const { return mxExportInfo; }
484cdf0e10cSrcweir
GetStatusIndicator()485cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > GetStatusIndicator() { return mxStatusIndicator; }
486cdf0e10cSrcweir
487cdf0e10cSrcweir /// get Event export, with handlers for script types "None" and
488cdf0e10cSrcweir /// "StarBasic" already registered; other handlers may be registered, too.
489cdf0e10cSrcweir XMLEventExport& GetEventExport();
490cdf0e10cSrcweir
491cdf0e10cSrcweir /// get the export for image maps
492cdf0e10cSrcweir XMLImageMapExport& GetImageMapExport();
493cdf0e10cSrcweir
494cdf0e10cSrcweir ::rtl::OUString AddEmbeddedGraphicObject(
495cdf0e10cSrcweir const ::rtl::OUString& rGraphicObjectURL );
496cdf0e10cSrcweir sal_Bool AddEmbeddedGraphicObjectAsBase64(
497cdf0e10cSrcweir const ::rtl::OUString& rGraphicObjectURL );
498cdf0e10cSrcweir
499cdf0e10cSrcweir ::rtl::OUString AddEmbeddedObject(
500cdf0e10cSrcweir const ::rtl::OUString& rEmbeddedObjectURL );
501cdf0e10cSrcweir sal_Bool AddEmbeddedObjectAsBase64(
502cdf0e10cSrcweir const ::rtl::OUString& rEmbeddedObjectURL );
503cdf0e10cSrcweir
504cdf0e10cSrcweir ::rtl::OUString EncodeStyleName( const ::rtl::OUString& rName,
505cdf0e10cSrcweir sal_Bool *pEncoded=0 ) const;
506cdf0e10cSrcweir
507cdf0e10cSrcweir // save linked sections?
IsSaveLinkedSections()508cdf0e10cSrcweir inline sal_Bool IsSaveLinkedSections() { return mbSaveLinkedSections; }
509cdf0e10cSrcweir
510cdf0e10cSrcweir // get export flags
getExportFlags() const511cdf0e10cSrcweir sal_uInt16 getExportFlags() const { return mnExportFlags; }
512cdf0e10cSrcweir
513cdf0e10cSrcweir sal_Bool ExportEmbeddedOwnObject(
514cdf0e10cSrcweir ::com::sun::star::uno::Reference<
515cdf0e10cSrcweir ::com::sun::star::lang::XComponent >& rComp );
516cdf0e10cSrcweir
517cdf0e10cSrcweir rtl::OUString GetRelativeReference(const rtl::OUString& rValue);
518cdf0e10cSrcweir
519cdf0e10cSrcweir // methods for accessing the document handler and handling SAX errors
520cdf0e10cSrcweir void StartElement(sal_uInt16 nPrefix,
521cdf0e10cSrcweir enum ::xmloff::token::XMLTokenEnum eName,
522cdf0e10cSrcweir sal_Bool bIgnWSOutside );
523cdf0e10cSrcweir void StartElement(const ::rtl::OUString& rName,
524cdf0e10cSrcweir sal_Bool bIgnWSOutside );
525cdf0e10cSrcweir void Characters(const ::rtl::OUString& rChars);
526cdf0e10cSrcweir void EndElement(sal_uInt16 nPrefix,
527cdf0e10cSrcweir enum ::xmloff::token::XMLTokenEnum eName,
528cdf0e10cSrcweir sal_Bool bIgnWSInside );
529cdf0e10cSrcweir void EndElement(const ::rtl::OUString& rName,
530cdf0e10cSrcweir sal_Bool bIgnWSInside );
531cdf0e10cSrcweir void IgnorableWhitespace();
532cdf0e10cSrcweir
533cdf0e10cSrcweir /**
534cdf0e10cSrcweir * Record an error condition that occured during export. The
535cdf0e10cSrcweir * behavior of SetError can be modified using the error flag
536cdf0e10cSrcweir * constants.
537cdf0e10cSrcweir */
538cdf0e10cSrcweir void SetError(
539cdf0e10cSrcweir /// error ID, may contain an error flag
540cdf0e10cSrcweir sal_Int32 nId,
541cdf0e10cSrcweir /// string parameters for the error message
542cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rMsgParams,
543cdf0e10cSrcweir /// original exception message (if applicable)
544cdf0e10cSrcweir const ::rtl::OUString& rExceptionMessage,
545cdf0e10cSrcweir /// error location (if applicable)
546cdf0e10cSrcweir const ::com::sun::star::uno::Reference<
547cdf0e10cSrcweir ::com::sun::star::xml::sax::XLocator> & rLocator );
548cdf0e10cSrcweir
549cdf0e10cSrcweir void SetError(
550cdf0e10cSrcweir sal_Int32 nId,
551cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rMsgParams);
552cdf0e10cSrcweir
553cdf0e10cSrcweir /** return list of errors */
554cdf0e10cSrcweir XMLErrors* GetErrors();
555cdf0e10cSrcweir
556cdf0e10cSrcweir /** return current error flags (logical 'or' of all error flags so far) */
GetErrorFlags()557cdf0e10cSrcweir sal_uInt16 GetErrorFlags() { return mnErrorFlags; }
558cdf0e10cSrcweir
559cdf0e10cSrcweir virtual void DisposingModel();
560cdf0e10cSrcweir
561cdf0e10cSrcweir ::comphelper::UnoInterfaceToUniqueIdentifierMapper& getInterfaceToIdentifierMapper();
562cdf0e10cSrcweir
563cdf0e10cSrcweir // #110680#
564cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getServiceFactory();
565cdf0e10cSrcweir
566cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
567cdf0e10cSrcweir GetComponentContext() const;
568cdf0e10cSrcweir
569cdf0e10cSrcweir // --> OD 2006-03-10 #i51726#
GetModelType() const570cdf0e10cSrcweir SvtModuleOptions::EFactory GetModelType() const
571cdf0e10cSrcweir {
572cdf0e10cSrcweir return meModelType;
573cdf0e10cSrcweir }
574cdf0e10cSrcweir // <--
575cdf0e10cSrcweir
576cdf0e10cSrcweir // --> OD 2006-09-27 #i69627#
577cdf0e10cSrcweir sal_Bool writeOutlineStyleAsNormalListStyle() const;
578cdf0e10cSrcweir // <--
isExperimentalOdfExportEnabled() const579cdf0e10cSrcweir bool isExperimentalOdfExportEnabled() const { return mbEnableExperimentalOdfExport; }
580cdf0e10cSrcweir
581cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > GetTargetStorage();
582cdf0e10cSrcweir
583cdf0e10cSrcweir /// returns the currently configured default version for odf export
584cdf0e10cSrcweir SvtSaveOptions::ODFDefaultVersion getDefaultVersion() const;
585cdf0e10cSrcweir
586cdf0e10cSrcweir /// name of stream in package, e.g., "content.xml"
587cdf0e10cSrcweir ::rtl::OUString GetStreamName() const;
588cdf0e10cSrcweir
589cdf0e10cSrcweir // FIXME: this is only for legacy stuff that has not yet been adapted
590cdf0e10cSrcweir // to implement XMetadatable; this can write duplicate IDs!
591cdf0e10cSrcweir /// add xml:id and legacy namespace id
592cdf0e10cSrcweir void SAL_DLLPRIVATE AddAttributeIdLegacy(
593cdf0e10cSrcweir sal_uInt16 const nLegacyPrefix, ::rtl::OUString const& rValue);
594cdf0e10cSrcweir
595cdf0e10cSrcweir /// add xml:id attribute (for RDF metadata)
596cdf0e10cSrcweir void AddAttributeXmlId(::com::sun::star::uno::Reference<
597cdf0e10cSrcweir ::com::sun::star::uno::XInterface> const & i_xIfc);
598cdf0e10cSrcweir
599cdf0e10cSrcweir /// add RDFa attributes for a metadatable text content
600cdf0e10cSrcweir void AddAttributesRDFa( ::com::sun::star::uno::Reference<
601cdf0e10cSrcweir ::com::sun::star::text::XTextContent> const & i_xTextContent);
602cdf0e10cSrcweir
603cdf0e10cSrcweir // --> OD 2008-11-26 #158694#
604cdf0e10cSrcweir sal_Bool exportTextNumberElement() const;
605cdf0e10cSrcweir // <--
606cdf0e10cSrcweir
607cdf0e10cSrcweir /// set null date from model to unit converter, if not already done
608cdf0e10cSrcweir sal_Bool SetNullDateOnUnitConverter();
609cdf0e10cSrcweir };
610cdf0e10cSrcweir
GetTextParagraphExport()611cdf0e10cSrcweir inline UniReference< XMLTextParagraphExport > SvXMLExport::GetTextParagraphExport()
612cdf0e10cSrcweir {
613cdf0e10cSrcweir if( !mxTextParagraphExport.is() )
614cdf0e10cSrcweir mxTextParagraphExport = CreateTextParagraphExport();
615cdf0e10cSrcweir
616cdf0e10cSrcweir return mxTextParagraphExport;
617cdf0e10cSrcweir }
618cdf0e10cSrcweir
GetShapeExport()619cdf0e10cSrcweir inline UniReference< XMLShapeExport > SvXMLExport::GetShapeExport()
620cdf0e10cSrcweir {
621cdf0e10cSrcweir if( !mxShapeExport.is() )
622cdf0e10cSrcweir mxShapeExport = CreateShapeExport();
623cdf0e10cSrcweir
624cdf0e10cSrcweir return mxShapeExport;
625cdf0e10cSrcweir }
626cdf0e10cSrcweir
GetAutoStylePool()627cdf0e10cSrcweir inline UniReference< SvXMLAutoStylePoolP > SvXMLExport::GetAutoStylePool()
628cdf0e10cSrcweir {
629cdf0e10cSrcweir if( !mxAutoStylePool.is() )
630cdf0e10cSrcweir mxAutoStylePool = CreateAutoStylePool();
631cdf0e10cSrcweir
632cdf0e10cSrcweir return mxAutoStylePool;
633cdf0e10cSrcweir }
634cdf0e10cSrcweir
GetChartExport()635cdf0e10cSrcweir inline UniReference< SchXMLExportHelper > SvXMLExport::GetChartExport()
636cdf0e10cSrcweir {
637cdf0e10cSrcweir if( !mxChartExport.is() )
638cdf0e10cSrcweir mxChartExport = CreateChartExport();
639cdf0e10cSrcweir
640cdf0e10cSrcweir return mxChartExport;
641cdf0e10cSrcweir }
642cdf0e10cSrcweir
GetPageExport()643cdf0e10cSrcweir inline UniReference< XMLPageExport > SvXMLExport::GetPageExport()
644cdf0e10cSrcweir {
645cdf0e10cSrcweir if( !mxPageExport.is() )
646cdf0e10cSrcweir mxPageExport = CreatePageExport();
647cdf0e10cSrcweir
648cdf0e10cSrcweir return mxPageExport;
649cdf0e10cSrcweir }
650cdf0e10cSrcweir
GetFontAutoStylePool()651cdf0e10cSrcweir inline UniReference< XMLFontAutoStylePool > SvXMLExport::GetFontAutoStylePool()
652cdf0e10cSrcweir {
653cdf0e10cSrcweir if( !mxFontAutoStylePool.is() )
654cdf0e10cSrcweir mxFontAutoStylePool = CreateFontAutoStylePool();
655cdf0e10cSrcweir
656cdf0e10cSrcweir return mxFontAutoStylePool;
657cdf0e10cSrcweir }
658cdf0e10cSrcweir
GetFormExport()659cdf0e10cSrcweir inline UniReference< xmloff::OFormLayerXMLExport > SvXMLExport::GetFormExport()
660cdf0e10cSrcweir {
661cdf0e10cSrcweir if( !mxFormExport.is() )
662cdf0e10cSrcweir mxFormExport = CreateFormExport();
663cdf0e10cSrcweir
664cdf0e10cSrcweir return mxFormExport;
665cdf0e10cSrcweir }
666cdf0e10cSrcweir
HasFormExport()667cdf0e10cSrcweir inline bool SvXMLExport::HasFormExport()
668cdf0e10cSrcweir {
669cdf0e10cSrcweir return mxFormExport.is();
670cdf0e10cSrcweir }
671cdf0e10cSrcweir
SetEmbeddedResolver(com::sun::star::uno::Reference<com::sun::star::document::XEmbeddedObjectResolver> & _xEmbeddedResolver)672cdf0e10cSrcweir inline void SvXMLExport::SetEmbeddedResolver(
673cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver )
674cdf0e10cSrcweir {
675cdf0e10cSrcweir mxEmbeddedResolver = _xEmbeddedResolver;
676cdf0e10cSrcweir }
677cdf0e10cSrcweir
SetGraphicResolver(com::sun::star::uno::Reference<com::sun::star::document::XGraphicObjectResolver> & _xGraphicResolver)678cdf0e10cSrcweir inline void SvXMLExport::SetGraphicResolver(
679cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver >& _xGraphicResolver )
680cdf0e10cSrcweir {
681cdf0e10cSrcweir mxGraphicResolver = _xGraphicResolver;
682cdf0e10cSrcweir }
683cdf0e10cSrcweir
684cdf0e10cSrcweir // Helper class to export an element.
685cdf0e10cSrcweir class XMLOFF_DLLPUBLIC SvXMLElementExport
686cdf0e10cSrcweir {
687*c45df7c4SOliver-Rainer Wittmann SvXMLExport& mrExport;
688*c45df7c4SOliver-Rainer Wittmann ::rtl::OUString maElementName;
689*c45df7c4SOliver-Rainer Wittmann const sal_Bool mbIgnoreWhitespaceInside :1;
690*c45df7c4SOliver-Rainer Wittmann const sal_Bool mbDoSomething :1;
691*c45df7c4SOliver-Rainer Wittmann
692*c45df7c4SOliver-Rainer Wittmann SAL_DLLPRIVATE
693*c45df7c4SOliver-Rainer Wittmann void StartElement(
694*c45df7c4SOliver-Rainer Wittmann const sal_uInt16 nPrefix,
695*c45df7c4SOliver-Rainer Wittmann const ::rtl::OUString& rName,
696*c45df7c4SOliver-Rainer Wittmann const sal_Bool bIgnoreWhitespaceOutside );
697cdf0e10cSrcweir
698cdf0e10cSrcweir public:
699cdf0e10cSrcweir
700cdf0e10cSrcweir // The constructor prints a start tag that has the common attributes
701cdf0e10cSrcweir // of the XMLExport instance attached.
702cdf0e10cSrcweir SvXMLElementExport( SvXMLExport& rExp, sal_uInt16 nPrefix,
703cdf0e10cSrcweir const sal_Char *pName,
704cdf0e10cSrcweir sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside );
705cdf0e10cSrcweir SvXMLElementExport( SvXMLExport& rExp, sal_uInt16 nPrefix,
706cdf0e10cSrcweir const ::rtl::OUString& rName,
707cdf0e10cSrcweir sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside );
708cdf0e10cSrcweir SvXMLElementExport( SvXMLExport& rExp, sal_uInt16 nPrefix,
709cdf0e10cSrcweir enum ::xmloff::token::XMLTokenEnum eName,
710cdf0e10cSrcweir sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside );
711cdf0e10cSrcweir SvXMLElementExport( SvXMLExport& rExp, const ::rtl::OUString& rQName,
712cdf0e10cSrcweir sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside );
713cdf0e10cSrcweir
714cdf0e10cSrcweir // Thes constructors do nothing if bDoSomething is not set
715cdf0e10cSrcweir SvXMLElementExport( SvXMLExport& rExp, sal_Bool bDoSomething,
716cdf0e10cSrcweir sal_uInt16 nPrefix, const sal_Char *pName,
717cdf0e10cSrcweir sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside );
718cdf0e10cSrcweir SvXMLElementExport( SvXMLExport& rExp, sal_Bool bDoSomething,
719cdf0e10cSrcweir sal_uInt16 nPrefix, const ::rtl::OUString& rName,
720cdf0e10cSrcweir sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside );
721cdf0e10cSrcweir SvXMLElementExport( SvXMLExport& rExp, sal_Bool bDoSomething,
722cdf0e10cSrcweir sal_uInt16 nPrefix,
723cdf0e10cSrcweir enum ::xmloff::token::XMLTokenEnum eName,
724cdf0e10cSrcweir sal_Bool bIgnWSOutside, sal_Bool bIgnWSInside );
725cdf0e10cSrcweir
726cdf0e10cSrcweir // The destructor prints an end tag.
727cdf0e10cSrcweir ~SvXMLElementExport();
728cdf0e10cSrcweir };
729cdf0e10cSrcweir
730cdf0e10cSrcweir #endif // _XMLOFF_SVXMLEXP_HXX
731cdf0e10cSrcweir
732