LibreOffice Module writerfilter (master) 1
OOXMLDocument.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#pragma once
20
21#include <sal/types.h>
22#include <com/sun/star/beans/NamedValue.hpp>
23#include <com/sun/star/uno/Reference.hxx>
24#include <com/sun/star/io/XInputStream.hpp>
25#include <com/sun/star/uno/XComponentContext.hpp>
27#include <com/sun/star/task/XStatusIndicator.hpp>
28#include <com/sun/star/xml/sax/XFastParser.hpp>
29#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
30#include <com/sun/star/xml/dom/XDocument.hpp>
31#include <com/sun/star/frame/XModel.hpp>
32#include <com/sun/star/drawing/XDrawPage.hpp>
35
70namespace writerfilter::ooxml
71{
72
73class OOXMLStream : public virtual SvRefBase
74{
75public:
79
83 virtual css::uno::Reference<css::xml::sax::XFastParser> getFastParser() = 0;
84
85 virtual css::uno::Reference<css::io::XInputStream> getDocumentStream() = 0;
86
90 virtual css::uno::Reference<css::uno::XComponentContext> getContext() = 0;
91
99 virtual OUString getTargetForId(const OUString & rId) = 0;
100
101 virtual const OUString & getTarget() const = 0;
102
103 virtual css::uno::Reference<css::xml::sax::XFastTokenHandler>
105
106};
107
109{
110public:
115
121 virtual void resolve(Stream & rStream) override = 0;
122
133 virtual void resolveFootnote(Stream & rStream,
134 Id aNoteType,
135 const sal_Int32 nNoteId) = 0;
146 virtual void resolveEndnote(Stream & rStream,
147 Id aNoteType,
148 const sal_Int32 NoteId) = 0;
149
156 virtual void resolveComment(Stream & rStream,
157 const sal_Int32 nCommentId) = 0;
158
165 virtual void resolvePicture(Stream & rStream,
166 const OUString & rPictureId) = 0;
167
179 virtual void resolveHeader(Stream & rStream,
180 const sal_Int32 type,
181 const OUString & rId) = 0;
182
194 virtual void resolveFooter(Stream & rStream,
195 const sal_Int32 type,
196 const OUString & rId) = 0;
197
198
206 virtual OUString getTargetForId(const OUString & rId) = 0;
207
208 virtual void setModel(css::uno::Reference<css::frame::XModel> xModel) = 0;
209 virtual css::uno::Reference<css::frame::XModel> getModel() = 0;
210 virtual void setDrawPage(css::uno::Reference<css::drawing::XDrawPage> xDrawPage) = 0;
211 virtual css::uno::Reference<css::drawing::XDrawPage> getDrawPage() = 0;
212 virtual css::uno::Reference<css::io::XInputStream> getInputStreamForId(const OUString & rId) = 0;
213 virtual void setXNoteId(const sal_Int32 nId) = 0;
214 virtual sal_Int32 getXNoteId() const = 0;
215 virtual const OUString & getTarget() const = 0;
218 virtual const oox::drawingml::ThemePtr & getTheme() const = 0;
219
221 virtual void pushShapeContext() = 0;
223 virtual void popShapeContext() = 0;
224 virtual css::uno::Reference<css::xml::dom::XDocument> getThemeDom( ) = 0;
225 virtual css::uno::Reference<css::xml::dom::XDocument> getGlossaryDocDom( ) = 0;
226 virtual css::uno::Sequence<css::uno::Sequence< css::beans::NamedValue> > getGlossaryDomList() = 0;
227 virtual css::uno::Sequence<css::uno::Reference<css::xml::dom::XDocument> > getCustomXmlDomList( ) = 0;
228 virtual css::uno::Sequence<css::uno::Reference<css::xml::dom::XDocument> > getCustomXmlDomPropsList( ) = 0;
229 virtual css::uno::Sequence<css::beans::PropertyValue > getEmbeddingsList() = 0;
230};
231
232
234{
235public:
237 createStream(const css::uno::Reference<css::uno::XComponentContext>& rContext,
238 const css::uno::Reference<css::io::XInputStream>& rStream,
239 bool bRepairStorage);
240
243 OOXMLStream::StreamType_t nStreamType);
244
246 createStream(const OOXMLStream::Pointer_t& pStream, const OUString & rId);
247
248 static OOXMLDocument *
250 const css::uno::Reference<css::task::XStatusIndicator>& xStatusIndicator,
251 bool bSkipImage, const css::uno::Sequence<css::beans::PropertyValue>& rDescriptor);
252
253};
254
255std::string fastTokenToId(sal_uInt32 nToken);
256
257}
258
259/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference to a resource that generates events and sends them to a handler.
Handler for a stream.
static OOXMLStream::Pointer_t createStream(const css::uno::Reference< css::uno::XComponentContext > &rContext, const css::uno::Reference< css::io::XInputStream > &rStream, bool bRepairStorage)
static OOXMLDocument * createDocument(const OOXMLStream::Pointer_t &pStream, const css::uno::Reference< css::task::XStatusIndicator > &xStatusIndicator, bool bSkipImage, const css::uno::Sequence< css::beans::PropertyValue > &rDescriptor)
virtual css::uno::Sequence< css::uno::Sequence< css::beans::NamedValue > > getGlossaryDomList()=0
virtual sal_Int32 getXNoteId() const =0
virtual css::uno::Reference< css::io::XInputStream > getInputStreamForId(const OUString &rId)=0
virtual css::uno::Reference< css::drawing::XDrawPage > getDrawPage()=0
virtual void setDrawPage(css::uno::Reference< css::drawing::XDrawPage > xDrawPage)=0
virtual void resolveFootnote(Stream &rStream, Id aNoteType, const sal_Int32 nNoteId)=0
Resolves a footnote to a stream handler.
virtual void pushShapeContext()=0
Push context of drawingML shapes, so nested shapes are handled separately.
virtual void resolveFooter(Stream &rStream, const sal_Int32 type, const OUString &rId)=0
Resolves a footer to a stream handler.
virtual void resolve(Stream &rStream) override=0
Resolves this document to a stream handler.
virtual void setXNoteId(const sal_Int32 nId)=0
virtual void popShapeContext()=0
Pop context of a previously pushed drawingML shape.
virtual rtl::Reference< oox::shape::ShapeContextHandler > getShapeContext()=0
virtual void setShapeContext(rtl::Reference< oox::shape::ShapeContextHandler > xContext)=0
virtual css::uno::Reference< css::xml::dom::XDocument > getGlossaryDocDom()=0
virtual void resolvePicture(Stream &rStream, const OUString &rPictureId)=0
Resolves a picture to a stream handler.
virtual css::uno::Reference< css::xml::dom::XDocument > getThemeDom()=0
virtual css::uno::Sequence< css::uno::Reference< css::xml::dom::XDocument > > getCustomXmlDomList()=0
virtual css::uno::Sequence< css::uno::Reference< css::xml::dom::XDocument > > getCustomXmlDomPropsList()=0
virtual const OUString & getTarget() const =0
virtual const oox::drawingml::ThemePtr & getTheme() const =0
tools::SvRef< OOXMLDocument > Pointer_t
Pointer to this stream.
virtual css::uno::Reference< css::frame::XModel > getModel()=0
virtual void setModel(css::uno::Reference< css::frame::XModel > xModel)=0
virtual css::uno::Sequence< css::beans::PropertyValue > getEmbeddingsList()=0
virtual void resolveComment(Stream &rStream, const sal_Int32 nCommentId)=0
Resolves a comment to a stream handler.
virtual void resolveHeader(Stream &rStream, const sal_Int32 type, const OUString &rId)=0
Resolves a header to a stream handler.
virtual OUString getTargetForId(const OUString &rId)=0
Returns target URL from relationships for a given id.
virtual void resolveEndnote(Stream &rStream, Id aNoteType, const sal_Int32 NoteId)=0
Resolves an endnote to a stream handler.
virtual const OUString & getTarget() const =0
tools::SvRef< OOXMLStream > Pointer_t
virtual css::uno::Reference< css::xml::sax::XFastParser > getFastParser()=0
Returns fast parser for this stream.
virtual css::uno::Reference< css::xml::sax::XFastTokenHandler > getFastTokenHandler()=0
virtual OUString getTargetForId(const OUString &rId)=0
Returns target URL from relationships for a given id.
virtual css::uno::Reference< css::io::XInputStream > getDocumentStream()=0
virtual css::uno::Reference< css::uno::XComponentContext > getContext()=0
Returns component context for this stream.
std::shared_ptr< Theme > ThemePtr
std::string fastTokenToId(sal_uInt32 nToken)
The classes in this file define the interfaces for the resource model of the DocTokenizer:
sal_uInt32 Id