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