Update Remove Formatting icons
[LibreOffice.git] / writerfilter / source / ooxml / OOXMLStreamImpl.hxx
blobe09db3c4f5aff3d40237fe887ec6d26a854ae241
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #pragma once
21 #include <map>
23 #include <ooxml/OOXMLDocument.hxx>
24 #include <com/sun/star/embed/XRelationshipAccess.hpp>
26 extern OUString customTarget;
27 extern OUString embeddingsTarget;
29 namespace writerfilter::ooxml
32 class OOXMLStreamImpl : public OOXMLStream
34 void init();
36 css::uno::Reference<css::uno::XComponentContext> mxContext;
37 css::uno::Reference<css::io::XInputStream> mxStorageStream;
38 css::uno::Reference<css::embed::XStorage> mxStorage;
39 css::uno::Reference<css::embed::XRelationshipAccess> mxRelationshipAccess;
40 css::uno::Reference<css::io::XStream> mxDocumentStream;
41 css::uno::Reference<css::xml::sax::XFastParser> mxFastParser;
42 css::uno::Reference<css::xml::sax::XFastTokenHandler> mxFastTokenHandler;
44 StreamType_t mnStreamType;
46 OUString msId;
47 OUString msPath;
48 OUString msTarget;
50 /// Cache holding an Id <-> Target map of external relations.
51 std::map<OUString, OUString> maIdCache;
53 bool lcl_getTarget(const css::uno::Reference<css::embed::XRelationshipAccess>& xRelationshipAccess,
54 StreamType_t nStreamType,
55 const OUString & rId,
56 OUString & rDocumentTarget);
57 public:
58 typedef tools::SvRef<OOXMLStreamImpl> Pointer_t;
60 OOXMLStreamImpl
61 (OOXMLStreamImpl const & rStream, StreamType_t nType);
62 OOXMLStreamImpl
63 (css::uno::Reference<css::uno::XComponentContext> const & xContext,
64 css::uno::Reference<css::io::XInputStream> const & xStorageStream,
65 StreamType_t nType, bool bRepairStorage);
66 OOXMLStreamImpl(OOXMLStreamImpl const & rStream, const OUString & rId);
68 virtual ~OOXMLStreamImpl() override;
70 virtual css::uno::Reference<css::xml::sax::XFastParser> getFastParser() override;
71 virtual css::uno::Reference<css::io::XInputStream> getDocumentStream() override;
72 virtual css::uno::Reference<css::uno::XComponentContext> getContext() override;
73 virtual OUString getTargetForId(const OUString & rId) override;
74 virtual const OUString & getTarget() const override;
76 virtual css::uno::Reference<css::xml::sax::XFastTokenHandler> getFastTokenHandler() override;
78 // Giving access to mxDocumentStream. It is needed by resolving custom xml to get list of customxml's used in document.
79 const css::uno::Reference<css::io::XStream>& accessDocumentStream() { return mxDocumentStream;}
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */