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: wrtxml.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 ************************************************************************/
33 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
34 #include <com/sun/star/uno/Sequence.hxx>
35 #include <com/sun/star/beans/PropertyValue.hpp>
36 #include <shellio.hxx>
41 namespace com
{ namespace sun
{ namespace star
{
42 namespace uno
{ template<class A
> class Reference
; }
43 namespace uno
{ template<class A
> class Sequence
; }
44 namespace uno
{ class Any
; }
45 namespace lang
{ class XComponent
; }
46 namespace lang
{ class XMultiServiceFactory
; }
47 namespace beans
{ struct PropertyValue
; }
51 class SwXMLWriter
: public StgWriter
53 sal_uInt32
_Write( SfxMedium
* pTargetMedium
= NULL
);
55 using StgWriter::Write
;
58 virtual ULONG
WriteStorage();
59 virtual ULONG
WriteMedium( SfxMedium
& aTargetMedium
);
63 SwXMLWriter( const String
& rBaseURL
);
64 virtual ~SwXMLWriter();
66 virtual ULONG
Write( SwPaM
&, SfxMedium
&, const String
* = 0 );
70 // helper methods to write XML streams
72 /// write a single XML stream into the package
73 sal_Bool
WriteThroughComponent(
74 /// the component we export
75 const ::com::sun::star::uno::Reference
<
76 ::com::sun::star::lang::XComponent
> & xComponent
,
77 const sal_Char
* pStreamName
, /// the stream name
78 /// service factory for pServiceName
79 const ::com::sun::star::uno::Reference
<
80 ::com::sun::star::lang::XMultiServiceFactory
> & rFactory
,
81 const sal_Char
* pServiceName
, /// service name of the component
82 /// the argument (XInitialization)
83 const ::com::sun::star::uno::Sequence
<
84 ::com::sun::star::uno::Any
> & rArguments
,
86 const ::com::sun::star::uno::Sequence
<
87 ::com::sun::star::beans::PropertyValue
> & rMediaDesc
,
88 sal_Bool bPlainStream
); /// neither compress nor encrypt
90 /// write a single output stream
91 /// (to be called either directly or by WriteThroughComponent(...))
92 sal_Bool
WriteThroughComponent(
93 const ::com::sun::star::uno::Reference
<
94 ::com::sun::star::io::XOutputStream
> & xOutputStream
,
95 const ::com::sun::star::uno::Reference
<
96 ::com::sun::star::lang::XComponent
> & xComponent
,
97 const ::com::sun::star::uno::Reference
<
98 ::com::sun::star::lang::XMultiServiceFactory
> & rFactory
,
99 const sal_Char
* pServiceName
,
100 const ::com::sun::star::uno::Sequence
<
101 ::com::sun::star::uno::Any
> & rArguments
,
102 const ::com::sun::star::uno::Sequence
<
103 ::com::sun::star::beans::PropertyValue
> & rMediaDesc
);
107 #endif // _WRTXML_HXX