LibreOffice Module sw (master) 1
rtfsdrexport.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_SW_SOURCE_FILTER_WW8_RTFSDREXPORT_HXX
21#define INCLUDED_SW_SOURCE_FILTER_WW8_RTFSDREXPORT_HXX
22
24#include <editeng/outlobj.hxx>
25#include <rtl/strbuf.hxx>
26
27#include <map>
28#include <memory>
29
30#include "wrtww8.hxx"
31
32class RtfExport;
34class SwFrameFormat;
35
37class RtfSdrExport final : public EscherEx
38{
40
42
44
46 sal_uInt32 m_nShapeType;
47
50
52 OStringBuffer m_aShapeStyle;
53
54 std::map<OString, OString> m_aShapeProps;
55
57 std::unique_ptr<bool[]> m_pShapeTypeWritten;
58
59 bool m_bInGroup = false;
60
61public:
62 explicit RtfSdrExport(RtfExport& rExport);
63 ~RtfSdrExport() override;
64
68 void AddSdrObject(const SdrObject& rObj);
69
71 static bool isTextBox(const SwFrameFormat& rFrameFormat);
73 void WriteOutliner(const OutlinerParaObject& rParaObj, TextTypes eType);
74
75private:
80 sal_Int32 StartShape();
81
86 void EndShape(sal_Int32 nShapeElement);
87
88 void Commit(EscherPropertyContainer& rProps, const tools::Rectangle& rRect) override;
89
90 void OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance = 0) override;
91 void CloseContainer() override;
92
93 sal_uInt32 EnterGroup(const OUString& rShapeName, const tools::Rectangle* pBoundRect) override;
94 void LeaveGroup() override;
95
96 void AddShape(sal_uInt32 nShapeType, ShapeFlag nShapeFlags, sal_uInt32 nShapeId = 0) override;
97
99 void AddLineDimensions(const tools::Rectangle& rRectangle);
100
102 void AddRectangleDimensions(OStringBuffer& rBuffer, const tools::Rectangle& rRectangle);
103
105 void impl_writeGraphic();
106};
107
108#endif // INCLUDED_SW_SOURCE_FILTER_WW8_RTFSDREXPORT_HXX
109
110/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void EndShape(sal_uInt16 nShapeType, sal_uInt32 nShapeID)
virtual EscherExHostAppData * StartShape(const css::uno::Reference< css::drawing::XShape > &rShape, const tools::Rectangle *pChildAnchor)
The class that has handlers for various resource types when exporting as RTF.
The class that does all the actual RTF export-related work.
Definition: rtfexport.hxx:37
Handles export of drawings using RTF markup.
void AddRectangleDimensions(OStringBuffer &rBuffer, const tools::Rectangle &rRectangle)
Add position and size to the OStringBuffer.
~RtfSdrExport() override
RtfExport & m_rExport
sal_Int32 StartShape()
void EndShape(sal_Int32 nShapeElement)
sal_uInt32 m_nShapeType
Remember the shape type.
void Commit(EscherPropertyContainer &rProps, const tools::Rectangle &rRect) override
sal_uInt32 EnterGroup(const OUString &rShapeName, const tools::Rectangle *pBoundRect) override
void CloseContainer() override
void WriteOutliner(const OutlinerParaObject &rParaObj, TextTypes eType)
Write editeng text, e.g. shape or comment.
void LeaveGroup() override
OStringBuffer m_aShapeStyle
Remember style, the most important shape attribute ;-)
ShapeFlag m_nShapeFlags
Remember the shape flags.
RtfSdrExport(RtfExport &rExport)
std::map< OString, OString > m_aShapeProps
const SdrObject * m_pSdrObject
void AddSdrObject(const SdrObject &rObj)
Export the sdr object as Sdr.
std::unique_ptr< bool[]> m_pShapeTypeWritten
Remember which shape types we had already written.
void impl_writeGraphic()
Exports the pib property of the shape.
static bool isTextBox(const SwFrameFormat &rFrameFormat)
Is this a standalone TextFrame, or used as a TextBox of a shape?
void AddShape(sal_uInt32 nShapeType, ShapeFlag nShapeFlags, sal_uInt32 nShapeId=0) override
void AddLineDimensions(const tools::Rectangle &rRectangle)
Add starting and ending point of a line to the m_pShapeAttrList.
RtfAttributeOutput & m_rAttrOutput
void OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance=0) override
Style of a layout element.
Definition: frmfmt.hxx:72
ShapeFlag
TextTypes
Definition: wrtww8.hxx:157