LibreOffice Module sw (master) 1
escher.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_ESCHER_HXX
21#define INCLUDED_SW_SOURCE_FILTER_WW8_ESCHER_HXX
22
24#include <svx/svdtrans.hxx>
25#include "wrtww8.hxx"
26
27const sal_uInt32 nInlineHack = 0x00010001;
28class SwFrameFormat;
29// #i30669#
32
34{
35public:
36 void WriteData(EscherEx& rEx) const override;
37 void SetAnchoring(const SwFrameFormat& rFormat);
38
65 static bool ConvertPosition( SwFormatHoriOrient& _iorHoriOri,
66 SwFormatVertOrient& _iorVertOri,
67 const SwFrameFormat& _rFrameFormat );
68
69private:
72 sal_uInt32 mnXAlign;
73 sal_uInt32 mnYAlign;
74 sal_uInt32 mnXRelTo;
75 sal_uInt32 mnYRelTo;
76
77};
78
80{
81public:
82 explicit SwEscherExGlobal();
83 virtual ~SwEscherExGlobal() override;
84
85private:
87 virtual SvStream* ImplQueryPictureStream() override;
88
89private:
90 std::shared_ptr< SvStream > mxPicStrm;
91};
92
94{
95private:
96 void Init();
97protected:
101
102 virtual sal_Int32 WriteFlyFrameAttr(const SwFrameFormat& rFormat, MSO_SPT eShapeType,
103 EscherPropertyContainer& rPropOpt);
104 void WriteBrushAttr(const SvxBrushItem &rBrush,
105 EscherPropertyContainer& rPropOpt);
107 ShapeFlag nShapeFlags, const Graphic &rGraphic, const SdrObject &rObj,
108 sal_uInt32 nShapeId, const css::awt::Rectangle* pVisArea );
109 static void WriteGrfAttr(const SwNoTextNode& rNd, const SwFrameFormat& rFormat, EscherPropertyContainer& rPropOpt);
110
111 sal_Int32 DrawModelToEmu(sal_Int32 nVal) const
112 { return BigMulDiv(nVal, mnEmuMul, mnEmuDiv); }
113
114 static sal_Int32 ToFract16(sal_Int32 nVal, sal_uInt32 nMax);
115
116 virtual void SetPicId(const SdrObject &, sal_uInt32, EscherPropertyContainer &);
118
119public:
120 SwBasicEscherEx(SvStream* pStrm, WW8Export& rWrt);
121 sal_Int32 WriteGrfFlyFrame(const SwFrameFormat& rFormat, sal_uInt32 nShapeId);
122 //For i120928,to export graphic of bullet
123 void WriteGrfBullet(const Graphic&);
124 sal_Int32 WriteOLEFlyFrame(const SwFrameFormat& rFormat, sal_uInt32 nShapeId);
125 void WriteEmptyFlyFrame(const SwFrameFormat& rFormat, sal_uInt32 nShapeId);
126 virtual void WriteFrameExtraData(const SwFrameFormat&);
127 virtual void WritePictures();
128 virtual ~SwBasicEscherEx() override;
129 //i120927,this function is added to export hyperlink info,such as graphic/frame/OLE
130 bool IsRelUrl() const;
131 OUString GetBasePath() const;
132 OUString BuildFileName(sal_uInt16& rnLevel, bool& rbRel, const OUString& rUrl);
133 void WriteHyperlinkWithinFly( SvMemoryStream& rStrm, const SwFormatURL* pINetFormatArg);
135
136private:
139};
140
142{
143private:
144 std::vector<sal_uLong> m_aFollowShpIds;
148
149 sal_uInt32 GetFlyShapeId(const SwFrameFormat& rFormat,
150 unsigned int nHdFtIndex, DrawObjPointerVector &rPVec);
151 void MakeZOrderArrAndFollowIds(std::vector<DrawObj>& rSrcArr,
152 DrawObjPointerVector& rDstArr);
153
154 sal_Int32 WriteFlyFrame(const DrawObj &rObj, sal_uInt32 &rShapeId,
155 DrawObjPointerVector &rPVec);
156 sal_Int32 WriteTextFlyFrame(const DrawObj &rObj, sal_uInt32 nShapeId,
157 sal_uInt32 nTextBox, DrawObjPointerVector &rPVec);
158 void WriteOCXControl(const SwFrameFormat& rFormat,sal_uInt32 nShapeId);
159 virtual sal_Int32 WriteFlyFrameAttr(const SwFrameFormat& rFormat, MSO_SPT eShapeType,
160 EscherPropertyContainer& rPropOpt) override;
161
162 virtual sal_uInt32 QueryTextID(
163 const css::uno::Reference< css::drawing::XShape > &, sal_uInt32) override;
164 virtual void SetPicId(const SdrObject &rSdrObj, sal_uInt32 nShapeId,
165 EscherPropertyContainer &rPropOpt) override;
166public:
167 SwEscherEx( SvStream* pStrm, WW8Export& rWW8Wrt );
168 virtual ~SwEscherEx() override;
169 void FinishEscher();
170 virtual void WritePictures() override;
171
172 virtual void WriteFrameExtraData(const SwFrameFormat& rFormat) override;
173
174 EscherExHostAppData* StartShape(const css::uno::Reference< css::drawing::XShape > &, const tools::Rectangle*) override {return &m_aHostData;}
175private:
176 SwEscherEx(const SwEscherEx&) = delete;
177 SwEscherEx &operator=(const SwEscherEx&) = delete;
178};
179
180#endif
181
182/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void WritePictures()
Definition: wrtw8esh.cxx:2164
SwBasicEscherEx(const SwBasicEscherEx &)=delete
sal_Int32 WriteOLEFlyFrame(const SwFrameFormat &rFormat, sal_uInt32 nShapeId)
Definition: wrtw8esh.cxx:1779
void WriteHyperlinkWithinFly(SvMemoryStream &rStrm, const SwFormatURL *pINetFormatArg)
Definition: wrtw8esh.cxx:167
void WriteOLEPicture(EscherPropertyContainer &rPropOpt, ShapeFlag nShapeFlags, const Graphic &rGraphic, const SdrObject &rObj, sal_uInt32 nShapeId, const css::awt::Rectangle *pVisArea)
Definition: wrtw8esh.cxx:2883
virtual void SetPicId(const SdrObject &, sal_uInt32, EscherPropertyContainer &)
Definition: wrtw8esh.cxx:1765
SvStream * mpEscherStrm
Definition: escher.hxx:99
void WriteEmptyFlyFrame(const SwFrameFormat &rFormat, sal_uInt32 nShapeId)
Definition: wrtw8esh.cxx:1534
SdrLayerID GetInvisibleHellId() const
Definition: wrtw8esh.cxx:2159
WW8Export & mrWrt
Definition: escher.hxx:98
tools::Long mnEmuMul
Definition: escher.hxx:100
static sal_Int32 ToFract16(sal_Int32 nVal, sal_uInt32 nMax)
Definition: wrtw8esh.cxx:2138
bool IsRelUrl() const
Definition: wrtw8esh.cxx:103
tools::Long mnEmuDiv
Definition: escher.hxx:100
SwBasicEscherEx & operator=(const SwBasicEscherEx &)=delete
sal_Int32 DrawModelToEmu(sal_Int32 nVal) const
Definition: escher.hxx:111
SwBasicEscherEx(SvStream *pStrm, WW8Export &rWrt)
Definition: wrtw8esh.cxx:1518
OUString BuildFileName(sal_uInt16 &rnLevel, bool &rbRel, const OUString &rUrl)
Definition: wrtw8esh.cxx:132
sal_Int32 WriteGrfFlyFrame(const SwFrameFormat &rFormat, sal_uInt32 nShapeId)
Definition: wrtw8esh.cxx:1605
virtual ~SwBasicEscherEx() override
Definition: wrtw8esh.cxx:1524
void WriteBrushAttr(const SvxBrushItem &rBrush, EscherPropertyContainer &rPropOpt)
Definition: wrtw8esh.cxx:1838
static void WriteGrfAttr(const SwNoTextNode &rNd, const SwFrameFormat &rFormat, EscherPropertyContainer &rPropOpt)
Definition: wrtw8esh.cxx:1665
virtual sal_Int32 WriteFlyFrameAttr(const SwFrameFormat &rFormat, MSO_SPT eShapeType, EscherPropertyContainer &rPropOpt)
Definition: wrtw8esh.cxx:1881
virtual void WriteFrameExtraData(const SwFrameFormat &)
Definition: wrtw8esh.cxx:1528
OUString GetBasePath() const
Definition: wrtw8esh.cxx:114
void PreWriteHyperlinkWithinFly(const SwFrameFormat &rFormat, EscherPropertyContainer &rPropOpt)
Definition: wrtw8esh.cxx:275
void WriteGrfBullet(const Graphic &)
Definition: wrtw8esh.cxx:1568
virtual SvStream * ImplQueryPictureStream() override
Override to create a new memory stream for picture data.
Definition: wrtw8esh.cxx:1510
std::shared_ptr< SvStream > mxPicStrm
Definition: escher.hxx:90
virtual ~SwEscherExGlobal() override
Definition: wrtw8esh.cxx:1506
SwEscherEx(const SwEscherEx &)=delete
virtual void SetPicId(const SdrObject &rSdrObj, sal_uInt32 nShapeId, EscherPropertyContainer &rPropOpt) override
Definition: wrtw8esh.cxx:1770
void WriteOCXControl(const SwFrameFormat &rFormat, sal_uInt32 nShapeId)
Definition: wrtw8esh.cxx:2904
EscherExHostAppData m_aHostData
Definition: escher.hxx:145
virtual ~SwEscherEx() override
Definition: wrtw8esh.cxx:2310
sal_uInt32 GetFlyShapeId(const SwFrameFormat &rFormat, unsigned int nHdFtIndex, DrawObjPointerVector &rPVec)
Definition: wrtw8esh.cxx:2961
virtual sal_Int32 WriteFlyFrameAttr(const SwFrameFormat &rFormat, MSO_SPT eShapeType, EscherPropertyContainer &rPropOpt) override
Definition: wrtw8esh.cxx:2055
SwEscherEx(SvStream *pStrm, WW8Export &rWW8Wrt)
Definition: wrtw8esh.cxx:2177
std::vector< sal_uLong > m_aFollowShpIds
Definition: escher.hxx:144
SwEscherEx & operator=(const SwEscherEx &)=delete
sal_Int32 WriteTextFlyFrame(const DrawObj &rObj, sal_uInt32 nShapeId, sal_uInt32 nTextBox, DrawObjPointerVector &rPVec)
Definition: wrtw8esh.cxx:2829
EscherExHostAppData * StartShape(const css::uno::Reference< css::drawing::XShape > &, const tools::Rectangle *) override
Definition: escher.hxx:174
virtual void WritePictures() override
Definition: wrtw8esh.cxx:1486
void FinishEscher()
Definition: wrtw8esh.cxx:2314
sal_Int32 WriteFlyFrame(const DrawObj &rObj, sal_uInt32 &rShapeId, DrawObjPointerVector &rPVec)
Definition: wrtw8esh.cxx:2726
WinwordAnchoring m_aWinwordAnchoring
Definition: escher.hxx:146
virtual void WriteFrameExtraData(const SwFrameFormat &rFormat) override
Definition: wrtw8esh.cxx:2714
virtual sal_uInt32 QueryTextID(const css::uno::Reference< css::drawing::XShape > &, sal_uInt32) override
Definition: wrtw8esh.cxx:2980
void MakeZOrderArrAndFollowIds(std::vector< DrawObj > &rSrcArr, DrawObjPointerVector &rDstArr)
Definition: wrtw8esh.cxx:2935
WW8_WrPlcTextBoxes * m_pTextBxs
Definition: escher.hxx:147
Style of a layout element.
Definition: frmfmt.hxx:62
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
Definition: ndnotxt.hxx:30
Exporter of the binary Word file formats.
Definition: wrtww8.hxx:995
sal_uInt32 mnXRelTo
Definition: escher.hxx:74
static bool ConvertPosition(SwFormatHoriOrient &_iorHoriOri, SwFormatVertOrient &_iorVertOri, const SwFrameFormat &_rFrameFormat)
method to perform conversion of positioning attributes with the help of corresponding layout informat...
Definition: wrtw8esh.cxx:2376
sal_uInt32 mnYAlign
Definition: escher.hxx:73
void SetAnchoring(const SwFrameFormat &rFormat)
Definition: wrtw8esh.cxx:2572
sal_uInt32 mnYRelTo
Definition: escher.hxx:75
sal_uInt32 mnGroupShapeBooleanProperties
Definition: escher.hxx:71
sal_uInt32 mnXAlign
Definition: escher.hxx:72
void WriteData(EscherEx &rEx) const override
Definition: wrtw8esh.cxx:1424
const sal_uInt32 nInlineHack
Definition: escher.hxx:27
ShapeFlag
MSO_SPT
long Long
SVXCORE_DLLPUBLIC tools::Long BigMulDiv(tools::Long nVal, tools::Long nMul, tools::Long nDiv)
std::vector< DrawObj * > DrawObjPointerVector
Definition: wrtww8.hxx:361