1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SW_SOURCE_FILTER_WW8_DOCXSDREXPORT_HXX
#define INCLUDED_SW_SOURCE_FILTER_WW8_DOCXSDREXPORT_HXX
#include <memory>
#include <rtl/strbuf.hxx>
#include <sax/fshelper.hxx>
#include <nodeoffset.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
namespace rtl
{
template <typename> class Reference;
}
namespace oox::drawingml { class DrawingML; }
class Size;
class SdrObject;
class SvxBoxItem;
namespace ww8
{
class Frame;
}
class SwFrameFormat;
class DocxExport;
/// Helper class, so that the DocxExport::RestoreData() call will always happen.
class ExportDataSaveRestore
{
private:
DocxExport& m_rExport;
public:
ExportDataSaveRestore(DocxExport& rExport, SwNodeOffset nStt, SwNodeOffset nEnd, ww8::Frame const* pParentFrame);
~ExportDataSaveRestore();
};
/// Handles DOCX export of drawings.
class DocxSdrExport
{
struct Impl;
std::unique_ptr<Impl> m_pImpl;
public:
DocxSdrExport(DocxExport& rExport, const sax_fastparser::FSHelperPtr& pSerializer, oox::drawingml::DrawingML* pDrawingML);
~DocxSdrExport();
void setSerializer(const sax_fastparser::FSHelperPtr& pSerializer);
/// When exporting fly frames, this holds the real size of the frame.
const Size* getFlyFrameSize() const;
bool getTextFrameSyntax() const;
bool getDMLTextFrameSyntax() const;
rtl::Reference<sax_fastparser::FastAttributeList>& getFlyAttrList();
/// Attributes of the next v:textbox element.
rtl::Reference<sax_fastparser::FastAttributeList>& getTextboxAttrList();
OStringBuffer& getTextFrameStyle();
/// Set if paragraph sdt open in the current drawing.
void setParagraphSdtOpen(bool bParagraphSdtOpen);
bool IsDrawingOpen() const;
bool IsDMLAndVMLDrawingOpen() const;
bool IsParagraphHasDrawing() const;
void setParagraphHasDrawing(bool bParagraphHasDrawing);
rtl::Reference<sax_fastparser::FastAttributeList>& getFlyFillAttrList();
void setFlyWrapAttrList(rtl::Reference<sax_fastparser::FastAttributeList> const & pAttrList);
/// Attributes of <wps:bodyPr>, used during DML export of text frames.
sax_fastparser::FastAttributeList* getBodyPrAttrList();
rtl::Reference<sax_fastparser::FastAttributeList>& getDashLineStyle();
void startDMLAnchorInline(const SwFrameFormat* pFrameFormat, const Size& rSize);
void endDMLAnchorInline(const SwFrameFormat* pFrameFormat);
/// Writes a drawing as VML data.
void writeVMLDrawing(const SdrObject* sdrObj, const SwFrameFormat& rFrameFormat);
/// Writes a drawing as DML.
void writeDMLDrawing(const SdrObject* pSdrObject, const SwFrameFormat* pFrameFormat, int nAnchorId);
/// Writes shape in both DML and VML format.
void writeDMLAndVMLDrawing(const SdrObject* sdrObj, const SwFrameFormat& rFrameFormat, int nAnchorId);
/// Write <a:effectLst>, the effect list.
void writeDMLEffectLst(const SwFrameFormat& rFrameFormat);
/// Writes a diagram (smartart).
void writeDiagram(const SdrObject* sdrObject, const SwFrameFormat& rFrameFormat, int nDiagramId);
/// Writes text frame in DML format.
void writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAnchorId, bool bTextBoxOnly = false);
/// Writes text frame in VML format.
void writeVMLTextFrame(ww8::Frame const* pParentFrame, bool bTextBoxOnly = false);
/// Is this a standalone TextFrame, or used as a TextBox of a shape?
static bool isTextBox(const SwFrameFormat& rFrameFormat);
/// Writes text from Textbox for <w:framePr>
void writeOnlyTextOfFrame(ww8::Frame const* pParentFrame);
/// Writes the drawingML <a:ln> markup of a box item.
void writeBoxItemLine(const SvxBoxItem& rBox);
};
void AddExtLst(sax_fastparser::FSHelperPtr const& pFS, DocxExport const& rExport,
css::uno::Reference<css::beans::XPropertySet> const& xShape);
#endif // INCLUDED_SW_SOURCE_FILTER_WW8_DOCXSDREXPORT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|