LibreOffice Module sw (master)  1
wrtxml.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 #ifndef INCLUDED_SW_SOURCE_FILTER_XML_WRTXML_HXX
20 #define INCLUDED_SW_SOURCE_FILTER_XML_WRTXML_HXX
21 
22 #include <com/sun/star/io/XOutputStream.hpp>
23 #include <com/sun/star/task/XStatusIndicator.hpp>
24 #include <com/sun/star/uno/Sequence.hxx>
25 #include <com/sun/star/uno/XComponentContext.hpp>
26 #include <com/sun/star/beans/PropertyValue.hpp>
27 #include <shellio.hxx>
28 
29 class SwPaM;
30 class SfxMedium;
31 
32 namespace com::sun::star {
33  namespace uno { template<class A> class Reference; }
34  namespace uno { template<class A> class Sequence; }
35  namespace uno { class Any; }
36  namespace lang { class XComponent; }
37  namespace lang { class XMultiServiceFactory; }
38  namespace beans { struct PropertyValue; }
39 }
40 
41 class SwXMLWriter : public StgWriter
42 {
43  ErrCode Write_( const css::uno::Reference < css::task::XStatusIndicator>&, const OUString& );
44 
45  using StgWriter::Write;
46 
47 protected:
48  virtual ErrCode WriteStorage() override;
49  virtual ErrCode WriteMedium( SfxMedium& aTargetMedium ) override;
50 
51 public:
52 
53  SwXMLWriter( const OUString& rBaseURL );
54  virtual ~SwXMLWriter() override;
55 
56  virtual ErrCode Write( SwPaM&, SfxMedium&, const OUString* ) override;
57 
58 private:
59 
60  // helper methods to write XML streams
61 
62  // write a single XML stream into the package
64  // the component we export
65  const css::uno::Reference<css::lang::XComponent> & xComponent,
66  const char* pStreamName, // the stream name
67  // service factory for pServiceName
68  const css::uno::Reference<css::uno::XComponentContext> & rFactory,
69  const char* pServiceName, // service name of the component
70  // the argument (XInitialization)
71  const css::uno::Sequence<css::uno::Any> & rArguments,
72  // output descriptor
73  const css::uno::Sequence<css::beans::PropertyValue> & rMediaDesc );
74 
75  // write a single output stream
76  // (to be called either directly or by WriteThroughComponent(...))
77  static bool WriteThroughComponent(
78  const css::uno::Reference<css::io::XOutputStream> & xOutputStream,
79  const css::uno::Reference<css::lang::XComponent> & xComponent,
80  const css::uno::Reference<css::uno::XComponentContext> & rFactory,
81  const char* pServiceName,
82  const css::uno::Sequence<css::uno::Any> & rArguments,
83  const css::uno::Sequence<css::beans::PropertyValue> & rMediaDesc );
84 };
85 
86 #endif // INCLUDED_SW_SOURCE_FILTER_XML_WRTXML_HXX
87 
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ErrCode Write(SwPaM &, SfxMedium &, const OUString *) override
Definition: wrtxml.cxx:456
Reference
ErrCode Write_(const css::uno::Reference< css::task::XStatusIndicator > &, const OUString &)
Definition: wrtxml.cxx:78
css::uno::Reference< css::lang::XComponent > xComponent
virtual ErrCode WriteStorage() override
Definition: wrtxml.cxx:435
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
SwXMLWriter(const OUString &rBaseURL)
Definition: wrtxml.cxx:69
exports com.sun.star. beans
virtual ErrCode Write(SwPaM &, const css::uno::Reference< css::embed::XStorage > &, const OUString *, SfxMedium *=nullptr) override
exports com.sun.star. lang
virtual ~SwXMLWriter() override
Definition: wrtxml.cxx:74
bool WriteThroughComponent(const css::uno::Reference< css::lang::XComponent > &xComponent, const char *pStreamName, const css::uno::Reference< css::uno::XComponentContext > &rFactory, const char *pServiceName, const css::uno::Sequence< css::uno::Any > &rArguments, const css::uno::Sequence< css::beans::PropertyValue > &rMediaDesc)
virtual ErrCode WriteMedium(SfxMedium &aTargetMedium) override
Definition: wrtxml.cxx:440