Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _XMLOFF_XMLIMP_HXX
30 : : #define _XMLOFF_XMLIMP_HXX
31 : :
32 : : #include "sal/config.h"
33 : : #include "xmloff/dllapi.h"
34 : : #include "sal/types.h"
35 : : #include <com/sun/star/embed/XStorage.hpp>
36 : : #include <com/sun/star/xml/sax/SAXParseException.hpp>
37 : : #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
38 : : #include <com/sun/star/xml/sax/SAXException.hpp>
39 : : #include <com/sun/star/xml/sax/XAttributeList.hpp>
40 : : #include <com/sun/star/xml/sax/XLocator.hpp>
41 : : #include <com/sun/star/lang/XUnoTunnel.hpp>
42 : : #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
43 : : #include <com/sun/star/container/XNameContainer.hpp>
44 : : #include <com/sun/star/lang/XInitialization.hpp>
45 : : #include <com/sun/star/lang/XServiceInfo.hpp>
46 : : #include <com/sun/star/document/XImporter.hpp>
47 : : #include <com/sun/star/document/XFilter.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 <cppuhelper/weak.hxx>
52 : : #include <xmloff/txtimp.hxx>
53 : : #include <xmloff/shapeimport.hxx>
54 : : #include <xmloff/SchXMLImportHelper.hxx>
55 : : #include <xmloff/ProgressBarHelper.hxx>
56 : : #include <cppuhelper/implbase6.hxx>
57 : : #include <xmloff/formlayerimport.hxx>
58 : :
59 : : #include <com/sun/star/beans/NamedValue.hpp>
60 : :
61 : : namespace rtl { class OUString; }
62 : : namespace com { namespace sun { namespace star {
63 : : namespace uno { class XComponentContext; }
64 : : namespace frame { class XModel; }
65 : : namespace io { class XOutputStream; }
66 : : namespace rdf { class XMetadatable; }
67 : : } } }
68 : : namespace comphelper { class UnoInterfaceToUniqueIdentifierMapper; }
69 : :
70 : : class SvXMLNamespaceMap;
71 : : class SvXMLImportContext;
72 : : class SvXMLImportContexts_Impl;
73 : : class SvXMLImport_Impl;
74 : : class SvXMLUnitConverter;
75 : : class SvXMLNumFmtHelper;
76 : : class XMLFontStylesContext;
77 : : class XMLEventImportHelper;
78 : : class XMLErrors;
79 : : class StyleMap;
80 : : class String;
81 : :
82 : : namespace xmloff {
83 : : class RDFaImportHelper;
84 : : }
85 : :
86 : : #define IMPORT_META 0x0001
87 : : #define IMPORT_STYLES 0x0002
88 : : #define IMPORT_MASTERSTYLES 0x0004
89 : : #define IMPORT_AUTOSTYLES 0x0008
90 : : #define IMPORT_CONTENT 0x0010
91 : : #define IMPORT_SCRIPTS 0x0020
92 : : #define IMPORT_SETTINGS 0x0040
93 : : #define IMPORT_FONTDECLS 0x0080
94 : : #define IMPORT_EMBEDDED 0x0100
95 : : #define IMPORT_OOO_NAMESPACES 0x0100
96 : : #define IMPORT_ALL 0xffff
97 : :
98 : :
99 : :
100 : : class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper6<
101 : : ::com::sun::star::xml::sax::XExtendedDocumentHandler,
102 : : ::com::sun::star::lang::XServiceInfo,
103 : : ::com::sun::star::lang::XInitialization,
104 : : ::com::sun::star::document::XImporter,
105 : : ::com::sun::star::document::XFilter,
106 : : ::com::sun::star::lang::XUnoTunnel>
107 : : {
108 : : friend class SvXMLImportContext;
109 : :
110 : : ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > mxLocator;
111 : : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
112 : : ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > mxNumberFormatsSupplier;
113 : : ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver > mxGraphicResolver;
114 : : ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver > mxEmbeddedResolver;
115 : : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxImportInfo;
116 : :
117 : : UniReference< XMLTextImportHelper > mxTextImport;
118 : : UniReference< XMLShapeImportHelper > mxShapeImport;
119 : : UniReference< SchXMLImportHelper > mxChartImport;
120 : : UniReference< ::xmloff::OFormLayerXMLImport > mxFormImport;
121 : :
122 : : SvXMLImportContextRef mxFontDecls;
123 : : SvXMLImportContextRef mxStyles;
124 : : SvXMLImportContextRef mxAutoStyles;
125 : : SvXMLImportContextRef mxMasterStyles;
126 : :
127 : : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxGradientHelper;
128 : : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxHatchHelper;
129 : : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxBitmapHelper;
130 : : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxTransGradientHelper;
131 : : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxMarkerHelper;
132 : : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxDashHelper;
133 : : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > mxNumberStyles;
134 : : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > mxEventListener;
135 : :
136 : : SvXMLImport_Impl *mpImpl; // dummy
137 : :
138 : : SvXMLNamespaceMap *mpNamespaceMap;
139 : : SvXMLUnitConverter *mpUnitConv;
140 : : SvXMLImportContexts_Impl *mpContexts;
141 : : SvXMLNumFmtHelper *mpNumImport;
142 : : ProgressBarHelper *mpProgressBarHelper;
143 : : XMLEventImportHelper *mpEventImportHelper;
144 : : XMLErrors *mpXMLErrors;
145 : : StyleMap *mpStyleMap;
146 : : ::rtl::OUString msPackageProtocol;
147 : :
148 : : SAL_DLLPRIVATE void _InitCtor();
149 : :
150 : : sal_uInt16 mnImportFlags;
151 : : sal_uInt16 mnErrorFlags;
152 : :
153 : : protected:
154 : : // #110680#
155 : : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory;
156 : :
157 : : ::com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > mxStatusIndicator;
158 : : sal_Bool mbIsFormsSupported;
159 : : bool mbIsTableShapeSupported;
160 : : bool mbIsGraphicLoadOnDemandSupported;
161 : :
162 : : // This method is called after the namespace map has been updated, but
163 : : // before a context for the current element has been pushed.
164 : : virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
165 : : const ::rtl::OUString& rLocalName,
166 : : const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
167 : :
168 : : virtual XMLTextImportHelper* CreateTextImport();
169 : : virtual XMLShapeImportHelper* CreateShapeImport();
170 : 254 : inline sal_Bool HasShapeImport() const { return mxShapeImport.is(); }
171 : 126 : inline void ClearShapeImport() { mxShapeImport = 0; }
172 : :
173 : : virtual SchXMLImportHelper* CreateChartImport();
174 : : virtual ::xmloff::OFormLayerXMLImport* CreateFormImport();
175 : :
176 : : void SetFontDecls( XMLFontStylesContext *pFontDecls );
177 : : void SetStyles( SvXMLStylesContext *pStyles );
178 : : void SetAutoStyles( SvXMLStylesContext *pAutoStyles );
179 : : void SetMasterStyles( SvXMLStylesContext *pMasterStyles );
180 : :
181 : : sal_Bool IsODFVersionConsistent( const ::rtl::OUString& aODFVersion );
182 : :
183 : 128 : const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedObjectResolver >& GetEmbeddedResolver() const { return mxEmbeddedResolver; }
184 : : inline void SetEmbeddedResolver( com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver );
185 : :
186 : 128 : const ::com::sun::star::uno::Reference< ::com::sun::star::document::XGraphicObjectResolver >& GetGraphicResolver() const { return mxGraphicResolver; }
187 : : void SetGraphicResolver( com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver >& _xGraphicResolver );
188 : :
189 : :
190 : : void _CreateNumberFormatsSupplier();
191 : : void _CreateDataStylesImport();
192 : :
193 : : public:
194 : : // #110680#
195 : : // SvXMLImport( sal_uInt16 nImportFlags = IMPORT_ALL ) throw();
196 : : SvXMLImport(
197 : : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
198 : : sal_uInt16 nImportFlags = IMPORT_ALL ) throw();
199 : :
200 : : virtual ~SvXMLImport() throw();
201 : :
202 : : static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
203 : :
204 : : // ::com::sun::star::xml::sax::XDocumentHandler
205 : : virtual void SAL_CALL startDocument(void)
206 : : throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
207 : : virtual void SAL_CALL endDocument(void)
208 : : throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
209 : : virtual void SAL_CALL startElement(const ::rtl::OUString& aName,
210 : : const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs)
211 : : throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
212 : : virtual void SAL_CALL endElement(const ::rtl::OUString& aName)
213 : : throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
214 : : virtual void SAL_CALL characters(const ::rtl::OUString& aChars)
215 : : throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
216 : : virtual void SAL_CALL ignorableWhitespace(const ::rtl::OUString& aWhitespaces)
217 : : throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
218 : : virtual void SAL_CALL processingInstruction(const ::rtl::OUString& aTarget,
219 : : const ::rtl::OUString& aData)
220 : : throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
221 : : virtual void SAL_CALL setDocumentLocator(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & xLocator)
222 : : throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
223 : :
224 : : // ::com::sun::star::xml::sax::XExtendedDocumentHandler
225 : : virtual void SAL_CALL startCDATA(void) throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
226 : : virtual void SAL_CALL endCDATA(void) throw( ::com::sun::star::uno::RuntimeException );
227 : : virtual void SAL_CALL comment(const ::rtl::OUString& sComment)
228 : : throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
229 : : virtual void SAL_CALL allowLineBreak(void)
230 : : throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
231 : : virtual void SAL_CALL unknown(const ::rtl::OUString& sString)
232 : : throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
233 : :
234 : : // XImporter
235 : : virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
236 : :
237 : : // XFilter
238 : : virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor ) throw (::com::sun::star::uno::RuntimeException);
239 : : virtual void SAL_CALL cancel( ) throw (::com::sun::star::uno::RuntimeException);
240 : :
241 : : // XInitialization
242 : : 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);
243 : :
244 : : // XUnoTunnel
245 : : virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
246 : :
247 : : // XServiceInfo
248 : : virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
249 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
250 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
251 : :
252 : : // may be called by certain subclasses that handle document meta-data
253 : : // override to provide customized handling of document statistics
254 : : // the base class implementation initializes the progress bar and should
255 : : // be called by overriding methods
256 : : virtual void SetStatistics(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > & i_rStats);
257 : :
258 : : // get import helper for text
259 : : inline UniReference< XMLTextImportHelper > GetTextImport();
260 : 254 : sal_Bool HasTextImport() const { return mxTextImport.is(); }
261 : : inline SvXMLNumFmtHelper* GetDataStylesImport();
262 : :
263 : : // get import helper for shapes
264 : : inline UniReference< XMLShapeImportHelper > GetShapeImport();
265 : :
266 : : // get import helper for charts
267 : : inline UniReference< SchXMLImportHelper > GetChartImport();
268 : :
269 : : // get import helper for form layer
270 : : inline UniReference< ::xmloff::OFormLayerXMLImport > GetFormImport();
271 : :
272 : : // get XPropertySet with import information
273 : 508 : inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getImportInfo() const { return mxImportInfo; }
274 : :
275 : : // get import helper for events
276 : : XMLEventImportHelper& GetEventImport();
277 : :
278 : 59819 : SvXMLNamespaceMap& GetNamespaceMap() { return *mpNamespaceMap; }
279 : 1178 : const SvXMLNamespaceMap& GetNamespaceMap() const { return *mpNamespaceMap; }
280 : : const SvXMLUnitConverter& GetMM100UnitConverter() const { return *mpUnitConv; }
281 : 149 : SvXMLUnitConverter& GetMM100UnitConverter() { return *mpUnitConv; }
282 : 428 : const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & GetLocator() const { return mxLocator; }
283 : : const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > &
284 : 8795 : GetModel() const { return mxModel; }
285 : :
286 : : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetGradientHelper();
287 : : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetHatchHelper();
288 : : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetBitmapHelper();
289 : : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetTransGradientHelper();
290 : : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetMarkerHelper();
291 : : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & GetDashHelper();
292 : : inline ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & GetNumberFormatsSupplier();
293 : 14 : inline void SetNumberFormatsSupplier(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& _xNumberFormatSupplier)
294 : : {
295 : 14 : mxNumberFormatsSupplier = _xNumberFormatSupplier;
296 : 14 : }
297 : :
298 : : // Convert a local packe URL into either a graphic manager or a
299 : : // internal package URL. The later one happens only if bLoadURL is true
300 : : ::rtl::OUString ResolveGraphicObjectURL( const ::rtl::OUString& rURL, sal_Bool bLoadOnDemand );
301 : : ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
302 : : GetStreamForGraphicObjectURLFromBase64();
303 : : ::rtl::OUString ResolveGraphicObjectURLFromBase64(
304 : : const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& rOut );
305 : :
306 : : sal_Bool IsPackageURL( const ::rtl::OUString& rURL ) const;
307 : : ::rtl::OUString ResolveEmbeddedObjectURL( const ::rtl::OUString& rURL,
308 : : const ::rtl::OUString& rClassId );
309 : : ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
310 : : GetStreamForEmbeddedObjectURLFromBase64();
311 : : ::rtl::OUString ResolveEmbeddedObjectURLFromBase64();
312 : :
313 : : // get source storage we're importing from (if available)
314 : : ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
315 : : GetSourceStorage();
316 : :
317 : : void AddStyleDisplayName( sal_uInt16 nFamily,
318 : : const ::rtl::OUString& rName,
319 : : const ::rtl::OUString& rDisplayName );
320 : : ::rtl::OUString GetStyleDisplayName( sal_uInt16 nFamily,
321 : : const ::rtl::OUString& rName ) const;
322 : :
323 : : ProgressBarHelper* GetProgressBarHelper();
324 : :
325 : : void AddNumberStyle(sal_Int32 nKey, const rtl::OUString& sName);
326 : :
327 : : virtual void SetViewSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aViewProps);
328 : : virtual void SetConfigurationSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aConfigProps);
329 : : virtual void SetDocumentSpecificSettings(const ::rtl::OUString& _rSettingsGroupName,
330 : : const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& _rSettings);
331 : :
332 : : XMLFontStylesContext *GetFontDecls();
333 : : SvXMLStylesContext *GetStyles();
334 : : SvXMLStylesContext *GetAutoStyles();
335 : : const XMLFontStylesContext *GetFontDecls() const;
336 : : const SvXMLStylesContext *GetStyles() const;
337 : : const SvXMLStylesContext *GetAutoStyles() const;
338 : :
339 : 3794 : sal_uInt16 getImportFlags() const { return mnImportFlags; }
340 : : sal_Bool IsFormsSupported() const { return mbIsFormsSupported; }
341 : : rtl::OUString GetAbsoluteReference(const rtl::OUString& rValue) const;
342 : :
343 : : sal_Unicode ConvStarBatsCharToStarSymbol( sal_Unicode c );
344 : : sal_Unicode ConvStarMathCharToStarSymbol( sal_Unicode c );
345 : :
346 : : bool IsTableShapeSupported() const { return mbIsTableShapeSupported; }
347 : :
348 : : ::rtl::OUString GetODFVersion() const;
349 : :
350 : : /**
351 : : * Record an error condition that occurred during import. The
352 : : * behavior of SetError can be modified using the error flag
353 : : * constants.
354 : : */
355 : : void SetError(
356 : : /// error ID, may contain an error flag
357 : : sal_Int32 nId,
358 : : /// string parameters for the error message
359 : : const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rMsgParams,
360 : : /// original exception message (if applicable)
361 : : const ::rtl::OUString& rExceptionMessage,
362 : : /// error location (if applicable)
363 : : const ::com::sun::star::uno::Reference<
364 : : ::com::sun::star::xml::sax::XLocator> & rLocator );
365 : :
366 : : void SetError(
367 : : sal_Int32 nId,
368 : : const ::com::sun::star::uno::Sequence< ::rtl::OUString> & rMsgParams);
369 : :
370 : : void SetError( sal_Int32 nId );
371 : : void SetError( sal_Int32 nId, const rtl::OUString& rMsg1 );
372 : : void SetError( sal_Int32 nId, const rtl::OUString& rMsg1,
373 : : const rtl::OUString& rMsg2 );
374 : :
375 : : /** return current error flags */
376 : : sal_uInt16 GetErrorFlags() { return mnErrorFlags; }
377 : :
378 : : virtual void DisposingModel();
379 : :
380 : : ::comphelper::UnoInterfaceToUniqueIdentifierMapper& getInterfaceToIdentifierMapper();
381 : :
382 : : // #110680#
383 : : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getServiceFactory();
384 : :
385 : : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
386 : : GetComponentContext() const;
387 : :
388 : : // Convert drawing object positions from OOo file format to OASIS file format and vice versa (#i28749#)
389 : : sal_Bool IsShapePositionInHoriL2R() const;
390 : :
391 : : sal_Bool IsTextDocInOOoFileFormat() const;
392 : :
393 : : ::rtl::OUString GetBaseURL() const;
394 : : ::rtl::OUString GetDocumentBase() const;
395 : :
396 : : /// name of stream in package, e.g., "content.xml"
397 : : ::rtl::OUString GetStreamName() const;
398 : :
399 : : /// set the XmlId attribute of given UNO object (for RDF metadata)
400 : : void SetXmlId(::com::sun::star::uno::Reference<
401 : : ::com::sun::star::uno::XInterface> const & i_xIfc,
402 : : ::rtl::OUString const & i_rXmlId);
403 : :
404 : : /// Add a RDFa statement; parameters are XML attribute values
405 : : void AddRDFa(
406 : : ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable>
407 : : i_xObject,
408 : : ::rtl::OUString const & i_rAbout,
409 : : ::rtl::OUString const & i_rProperty,
410 : : ::rtl::OUString const & i_rContent,
411 : : ::rtl::OUString const & i_rDatatype);
412 : :
413 : : /// do not dllexport this; only for advanced cases (bookmark-start)
414 : : SAL_DLLPRIVATE ::xmloff::RDFaImportHelper & GetRDFaImportHelper();
415 : :
416 : : // #i31958# XForms helper method
417 : : // (to be implemented by applications suporting XForms)
418 : : virtual void initXForms();
419 : :
420 : : /** returns the upd and build id (f.e. "680m124$Build-8964" gives rMaster = 680 and rBuild = 8964)
421 : : from the metafile.
422 : : this only works if the meta.xml was already imported and the
423 : : import propertyset contains the string property "BuildId".
424 : : If false is returned the build ids are not available (yet).
425 : : **/
426 : : bool getBuildIds( sal_Int32& rUPD, sal_Int32& rBuild ) const;
427 : :
428 : : static const sal_uInt16 OOo_1x = 10;
429 : : static const sal_uInt16 OOo_2x = 20;
430 : : static const sal_uInt16 OOo_Current = 30;
431 : :
432 : : /** this checks the build ID and returns
433 : :
434 : : * OOo_1x for files created with OpenOffice.org 1.x or StarOffice 7 (this also includes binary import over binfilter)
435 : : * OOo_2x for files created with OpenOffice.org 2.x or StarOffice 8
436 : : * OOo_Current for files created with OpenOffice.org 3.x and StarOffice9 or newer or for files not created with OpenOffice.org or StarOffice
437 : : */
438 : : sal_uInt16 getGeneratorVersion() const;
439 : :
440 : : /** If true, the URL for graphic shapes may be stored as a package URL and
441 : : loaded later (on demand) by the application. Otherwise graphics are
442 : : loaded immediately and the graphic shape gets the graphic manager URL.
443 : :
444 : : @see <member>mbIsGraphicLoadOnDemandSupported</member>
445 : : */
446 : : bool isGraphicLoadOnDemandSupported() const;
447 : : };
448 : :
449 : 8596 : inline UniReference< XMLTextImportHelper > SvXMLImport::GetTextImport()
450 : : {
451 [ + + ]: 8596 : if( !mxTextImport.is() )
452 : 254 : mxTextImport = CreateTextImport();
453 : :
454 : 8596 : return mxTextImport;
455 : : }
456 : :
457 : 184 : inline UniReference< XMLShapeImportHelper > SvXMLImport::GetShapeImport()
458 : : {
459 [ - + ]: 184 : if( !mxShapeImport.is() )
460 : 0 : mxShapeImport = CreateShapeImport();
461 : :
462 : 184 : return mxShapeImport;
463 : : }
464 : :
465 : : inline UniReference< SchXMLImportHelper > SvXMLImport::GetChartImport()
466 : : {
467 : : if( !mxChartImport.is() )
468 : : mxChartImport = CreateChartImport();
469 : :
470 : : return mxChartImport;
471 : : }
472 : :
473 : 459 : inline UniReference< ::xmloff::OFormLayerXMLImport > SvXMLImport::GetFormImport()
474 : : {
475 [ + + ]: 459 : if( !mxFormImport.is() )
476 : 126 : mxFormImport = CreateFormImport();
477 : :
478 : 459 : return mxFormImport;
479 : : }
480 : :
481 : 2 : inline void SvXMLImport::SetEmbeddedResolver(
482 : : com::sun::star::uno::Reference< com::sun::star::document::XEmbeddedObjectResolver >& _xEmbeddedResolver )
483 : : {
484 : 2 : mxEmbeddedResolver = _xEmbeddedResolver;
485 : 2 : }
486 : :
487 : 308 : inline void SvXMLImport::SetGraphicResolver(
488 : : com::sun::star::uno::Reference< com::sun::star::document::XGraphicObjectResolver >& _xGraphicResolver )
489 : : {
490 : 308 : mxGraphicResolver = _xGraphicResolver;
491 : 308 : }
492 : :
493 : 61 : inline ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & SvXMLImport::GetNumberFormatsSupplier()
494 : : {
495 [ - + ][ # # ]: 61 : if ( ! mxNumberFormatsSupplier.is() && mxModel.is() )
[ - + ]
496 : 0 : _CreateNumberFormatsSupplier();
497 : :
498 : 61 : return mxNumberFormatsSupplier;
499 : : }
500 : :
501 : : inline SvXMLNumFmtHelper* SvXMLImport::GetDataStylesImport()
502 : : {
503 : : if ( mpNumImport == NULL)
504 : : _CreateDataStylesImport();
505 : :
506 : : return mpNumImport;
507 : : }
508 : :
509 : :
510 : : #endif // _XMLOFF_XMLIMP_HXX
511 : :
512 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|