LibreOffice Module sc (master)  1
xmlwrap.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 
20 #ifndef INCLUDED_SC_INC_XMLWRAP_HXX
21 #define INCLUDED_SC_INC_XMLWRAP_HXX
22 
23 #include <com/sun/star/uno/Reference.hxx>
24 #include "importfilterdata.hxx"
25 
26 #include <vcl/errcode.hxx>
27 
28 namespace com::sun::star {
29  namespace beans { struct PropertyValue; }
30  namespace frame { class XModel; }
31  namespace task { class XStatusIndicator; }
32  namespace uno { class XComponentContext; }
33  namespace uno { template <class E> class Sequence; }
34  namespace embed { class XStorage; }
35  namespace xml {
36  namespace sax { struct InputSource; class XParser; class XWriter; }
37  }
38 }
39 
40 class ScDocument;
41 class SfxMedium;
42 class ScMySharedData;
43 class ScDocShell;
44 
45 enum class ImportFlags {
46  Styles = 0x01,
47  Content = 0x02,
48  Metadata = 0x04,
49  Settings = 0x08,
51 };
52 namespace o3tl
53 {
54  template<> struct typed_flags<ImportFlags> : is_typed_flags<ImportFlags, 0x0f> {};
55 }
56 
57 
59 {
61 
65  css::uno::Reference< css::embed::XStorage > xStorage;
66 
67  css::uno::Reference< css::task::XStatusIndicator> GetStatusIndicator() const;
68 
69  ErrCode ImportFromComponent(const css::uno::Reference<css::uno::XComponentContext>& xContext,
70  const css::uno::Reference<css::frame::XModel>& xModel,
71  const css::uno::Reference<css::xml::sax::XParser>& xParser,
72  css::xml::sax::InputSource& aParserInput,
73  const OUString& sComponentName, const OUString& sDocName,
74  const css::uno::Sequence<css::uno::Any>& aArgs,
75  bool bMustBeSuccessfull);
76 
77  bool ExportToComponent(const css::uno::Reference<css::uno::XComponentContext>& xContext,
78  const css::uno::Reference<css::frame::XModel>& xModel,
79  const css::uno::Reference<css::xml::sax::XWriter>& xWriter,
80  const css::uno::Sequence<css::beans::PropertyValue>& aDescriptor,
81  const OUString& sName, const OUString& sMediaType, const OUString& sComponentName,
82  const css::uno::Sequence<css::uno::Any>& aArgs,
83  std::unique_ptr<ScMySharedData>& pSharedData);
84 
85 public:
86 
88  ScDocShell& rDocSh, SfxMedium* pM, const css::uno::Reference<css::embed::XStorage>& xStor );
89 
90  bool Import( ImportFlags nMode, ErrCode& rError );
91  bool Export(bool bStylesOnly);
92 
94 };
95 
96 #endif
97 
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const sc::ImportPostProcessData & GetImportPostProcessData() const
Definition: xmlwrap.hxx:93
ErrCode ImportFromComponent(const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel > &xModel, const css::uno::Reference< css::xml::sax::XParser > &xParser, css::xml::sax::InputSource &aParserInput, const OUString &sComponentName, const OUString &sDocName, const css::uno::Sequence< css::uno::Any > &aArgs, bool bMustBeSuccessfull)
Definition: xmlwrap.cxx:106
exports com.sun.star. xml
bool Import(ImportFlags nMode, ErrCode &rError)
Definition: xmlwrap.cxx:283
exports com.sun.star. embed
Stores data imported from the file that need to be processed at the end of the import process...
ImportFlags
Definition: xmlwrap.hxx:45
exports com.sun.star. frame
sc::ImportPostProcessData maPostProcessData
Definition: xmlwrap.hxx:60
ScDocument & rDoc
Definition: xmlwrap.hxx:63
css::uno::Reference< css::embed::XStorage > xStorage
Definition: xmlwrap.hxx:65
exports com.sun.star. task
exports com.sun.star. beans
SfxMedium * pMedium
Definition: xmlwrap.hxx:64
css::uno::Reference< css::task::XStatusIndicator > GetStatusIndicator() const
Definition: xmlwrap.cxx:90
bool ExportToComponent(const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel > &xModel, const css::uno::Reference< css::xml::sax::XWriter > &xWriter, const css::uno::Sequence< css::beans::PropertyValue > &aDescriptor, const OUString &sName, const OUString &sMediaType, const OUString &sComponentName, const css::uno::Sequence< css::uno::Any > &aArgs, std::unique_ptr< ScMySharedData > &pSharedData)
Definition: xmlwrap.cxx:609
ScXMLImportWrapper(ScDocShell &rDocSh, SfxMedium *pM, const css::uno::Reference< css::embed::XStorage > &xStor)
Definition: xmlwrap.cxx:81
bool Export(bool bStylesOnly)
Definition: xmlwrap.cxx:719
ScDocShell & mrDocShell
Definition: xmlwrap.hxx:62