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/uno/Sequence.hxx>
24#include <com/sun/star/uno/XComponentContext.hpp>
25#include <com/sun/star/beans/PropertyValue.hpp>
26#include <shellio.hxx>
27
28class SwPaM;
29class SfxMedium;
30
31namespace com::sun::star {
32 namespace uno { template<class A> class Reference; }
33 namespace uno { template<class A> class Sequence; }
34 namespace uno { class Any; }
35 namespace lang { class XComponent; }
36 namespace lang { class XMultiServiceFactory; }
37 namespace beans { struct PropertyValue; }
38}
39
40class SwXMLWriter : public StgWriter
41{
42 ErrCode Write_(const SfxItemSet* pMediumItemSet);
43
44 using StgWriter::Write;
45
46protected:
47 virtual ErrCode WriteStorage() override;
48 virtual ErrCode WriteMedium( SfxMedium& aTargetMedium ) override;
49
50public:
51
52 SwXMLWriter( const OUString& rBaseURL );
53 virtual ~SwXMLWriter() override;
54
55 virtual ErrCode Write( SwPaM&, SfxMedium&, const OUString* ) override;
56
57private:
58
59 // helper methods to write XML streams
60
61 // write a single XML stream into the package
63 // the component we export
64 const css::uno::Reference<css::lang::XComponent> & xComponent,
65 const char* pStreamName, // the stream name
66 // service factory for pServiceName
67 const css::uno::Reference<css::uno::XComponentContext> & rFactory,
68 const char* pServiceName, // service name of the component
69 // the argument (XInitialization)
70 const css::uno::Sequence<css::uno::Any> & rArguments,
71 // output descriptor
72 const css::uno::Sequence<css::beans::PropertyValue> & rMediaDesc );
73
74 // write a single output stream
75 // (to be called either directly or by WriteThroughComponent(...))
77 const css::uno::Reference<css::io::XOutputStream> & xOutputStream,
78 const css::uno::Reference<css::lang::XComponent> & xComponent,
79 const css::uno::Reference<css::uno::XComponentContext> & rFactory,
80 const char* pServiceName,
81 const css::uno::Sequence<css::uno::Any> & rArguments,
82 const css::uno::Sequence<css::beans::PropertyValue> & rMediaDesc );
83};
84
85#endif // INCLUDED_SW_SOURCE_FILTER_XML_WRTXML_HXX
86
87/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ErrCode Write(SwPaM &, const css::uno::Reference< css::embed::XStorage > &, const OUString *, SfxMedium *=nullptr) override
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
virtual ErrCode Write(SwPaM &, SfxMedium &, const OUString *) override
Definition: wrtxml.cxx:473
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)
ErrCode Write_(const SfxItemSet *pMediumItemSet)
Definition: wrtxml.cxx:82
static bool WriteThroughComponent(const css::uno::Reference< css::io::XOutputStream > &xOutputStream, const css::uno::Reference< css::lang::XComponent > &xComponent, 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:468
virtual ErrCode WriteStorage() override
Definition: wrtxml.cxx:463
virtual ~SwXMLWriter() override
Definition: wrtxml.cxx:78
SwXMLWriter(const OUString &rBaseURL)
Definition: wrtxml.cxx:73
@ Sequence
Reference