LibreOffice Module writerfilter (master) 1
OLEHandler.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 "LoggedResources.hxx"
22#include <com/sun/star/awt/Size.hpp>
23#include <com/sun/star/drawing/XShape.hpp>
24#include <com/sun/star/text/WrapTextMode.hpp>
25
26namespace com::sun::star{
27 namespace graphic{
28 class XGraphic;
29 }
30 namespace io{
31 class XInputStream;
32 }
33 namespace text{
34 class XTextContent;
35 class XTextDocument;
36 }
37 namespace uno {
38 class XComponentContext;
39 }
40}
42{
43class DomainMapper;
47{
48 OUString m_sProgId;
49 OUString m_sDrawAspect;
53 OUString m_aURL;
54
55 css::text::WrapTextMode m_nWrapMode;
56
57 css::uno::Reference<css::drawing::XShape> m_xShape;
58
59 css::uno::Reference<css::io::XInputStream> m_xInputStream;
61
62 // Properties
63 virtual void lcl_attribute(Id Name, Value & val) override;
64 virtual void lcl_sprm(Sprm & sprm) override;
65
66public:
67 explicit OLEHandler(DomainMapper& rDomainMapper);
68 virtual ~OLEHandler() override;
69
70 const css::uno::Reference<css::drawing::XShape>& getShape() const { return m_xShape; };
71
72 bool isOLEObject() const { return m_xInputStream.is(); }
73
75 void importStream(const css::uno::Reference<css::uno::XComponentContext>& xComponentContext,
76 const css::uno::Reference<css::text::XTextDocument>& xTextDocument,
77 const css::uno::Reference<css::text::XTextContent>& xOLE);
78
80 OUString getCLSID() const;
81
82 OUString const & GetDrawAspect() const;
83 OUString const & GetVisAreaWidth() const;
84 OUString const & GetVisAreaHeight() const;
85
86 OUString copyOLEOStream(css::uno::Reference<css::text::XTextDocument> const& xTextDocument);
87
88 css::awt::Size getSize() const;
89 css::uno::Reference<css::graphic::XGraphic> getReplacement() const;
90
91};
92}
93
94/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void sprm(Sprm &sprm) override
Receives a SPRM.
An SPRM: Section, Paragraph and Run Modifier.
Handler for OLE objects.
Definition: OLEHandler.hxx:47
virtual ~OLEHandler() override
Definition: OLEHandler.cxx:59
OUString const & GetDrawAspect() const
Definition: OLEHandler.cxx:265
virtual void lcl_sprm(Sprm &sprm) override
Definition: OLEHandler.cxx:149
virtual void lcl_attribute(Id Name, Value &val) override
Definition: OLEHandler.cxx:64
css::uno::Reference< css::io::XInputStream > m_xInputStream
Definition: OLEHandler.hxx:59
OUString getCLSID() const
Get the CLSID of the OLE object, in case we can find one based on m_sProgId.
Definition: OLEHandler.cxx:239
OUString m_aURL
The stream URL right after the import of the raw data.
Definition: OLEHandler.hxx:53
OLEHandler(DomainMapper &rDomainMapper)
Definition: OLEHandler.cxx:51
const css::uno::Reference< css::drawing::XShape > & getShape() const
Definition: OLEHandler.hxx:70
void importStream(const css::uno::Reference< css::uno::XComponentContext > &xComponentContext, const css::uno::Reference< css::text::XTextDocument > &xTextDocument, const css::uno::Reference< css::text::XTextContent > &xOLE)
In case of a valid CLSID, import the native data to the previously created empty OLE object.
Definition: OLEHandler.cxx:200
css::text::WrapTextMode m_nWrapMode
Definition: OLEHandler.hxx:55
css::uno::Reference< css::graphic::XGraphic > getReplacement() const
Definition: OLEHandler.cxx:139
OUString const & GetVisAreaWidth() const
Definition: OLEHandler.cxx:270
css::uno::Reference< css::drawing::XShape > m_xShape
Definition: OLEHandler.hxx:57
css::awt::Size getSize() const
Definition: OLEHandler.cxx:132
OUString const & GetVisAreaHeight() const
Definition: OLEHandler.cxx:275
OUString copyOLEOStream(css::uno::Reference< css::text::XTextDocument > const &xTextDocument)
Definition: OLEHandler.cxx:280
def text(shape, orig_st)
sal_uInt32 Id