android: Update app-specific/MIME type icons
[LibreOffice.git] / sw / source / filter / ww8 / rtfattributeoutput.hxx
blob6e5a3c77cd2c8b8ba8fdd4120cdd7979c543808d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SW_SOURCE_FILTER_WW8_RTFATTRIBUTEOUTPUT_HXX
21 #define INCLUDED_SW_SOURCE_FILTER_WW8_RTFATTRIBUTEOUTPUT_HXX
23 #include <memory>
24 #include <com/sun/star/drawing/FillStyle.hpp>
26 #include "attributeoutputbase.hxx"
27 #include "rtfstringbuffer.hxx"
29 #include <wrtswtbl.hxx>
31 #include <rtl/strbuf.hxx>
32 #include <editeng/boxitem.hxx>
34 #include <optional>
36 class SwGrfNode;
37 class SwOLENode;
38 class SwFlyFrameFormat;
39 class RtfExport;
41 /// The class that has handlers for various resource types when exporting as RTF
42 class RtfAttributeOutput : public AttributeOutputBase
44 friend class RtfStringBufferValue;
45 friend class SaveRunState;
47 public:
48 /// Export the state of RTL/CJK.
49 void RTLAndCJKState(bool bIsRTL, sal_uInt16 nScript) override;
51 /// Start of the paragraph.
52 sal_Int32 StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo,
53 bool bGenerateParaId) override;
55 /// End of the paragraph.
56 void EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner) override;
58 /// Empty paragraph.
59 void EmptyParagraph() override;
61 /// Called in order to output section breaks.
62 void SectionBreaks(const SwNode& rNode) override;
64 /// Called before we start outputting the attributes.
65 void StartParagraphProperties() override;
67 /// Called after we end outputting the attributes.
68 void EndParagraphProperties(const SfxItemSet& rParagraphMarkerProperties,
69 const SwRedlineData* pRedlineData,
70 const SwRedlineData* pRedlineParagraphMarkerDeleted,
71 const SwRedlineData* pRedlineParagraphMarkerInserted) override;
73 /// Start of the text run.
74 void StartRun(const SwRedlineData* pRedlineData, sal_Int32 nPos,
75 bool bSingleEmptyRun = false) override;
77 /// End of the text run.
78 void EndRun(const SwTextNode* pNode, sal_Int32 nPos, sal_Int32 nLen,
79 bool bLastRun = false) override;
81 /// Called before we start outputting the attributes.
82 void StartRunProperties() override;
84 /// Called after we end outputting the attributes.
85 void EndRunProperties(const SwRedlineData* pRedlineData) override;
87 /// Output text (inside a run).
88 void RunText(const OUString& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8,
89 const OUString& rSymbolFont = OUString()) override;
91 // Access to (anyway) private buffers, used by the sdr exporter
92 OStringBuffer& RunText();
93 OString MoveCharacterProperties(bool aAutoWriteRtlLtr = false);
95 /// Output text (without markup).
96 void RawText(const OUString& rText, rtl_TextEncoding eCharSet) override;
98 /// Output ruby start.
99 void StartRuby(const SwTextNode& rNode, sal_Int32 nPos, const SwFormatRuby& rRuby) override;
101 /// Output ruby end.
102 void EndRuby(const SwTextNode& rNode, sal_Int32 nPos) override;
104 /// Output URL start.
105 bool StartURL(const OUString& rUrl, const OUString& rTarget) override;
107 /// Output URL end.
108 bool EndURL(bool isAtEndOfParagraph) override;
110 void FieldVanish(const OUString& rText, ww::eField eType,
111 OUString const* pBookmarkName) override;
113 /// Output redlining.
115 /// The common attribute that can be among the run properties.
116 void Redline(const SwRedlineData* pRedline) override;
118 void FormatDrop(const SwTextNode& rNode, const SwFormatDrop& rSwFormatDrop, sal_uInt16 nStyle,
119 ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo,
120 ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner) override;
122 /// Output style.
123 void ParagraphStyle(sal_uInt16 nStyle) override;
125 void TableInfoCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
126 void TableInfoRow(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
127 void TableDefinition(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
128 void TablePositioning(SwFrameFormat* pFlyFormat);
129 void
130 TableDefaultBorders(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
131 void TableBackgrounds(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
132 void TableRowRedline(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
133 void TableCellRedline(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
134 void TableHeight(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
135 void TableCanSplit(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
136 void TableBidi(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
137 void TableVerticalCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
138 void TableNodeInfoInner(ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner) override;
139 void TableOrientation(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
140 void TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override;
141 void TableRowEnd(sal_uInt32 nDepth) override;
143 /// Start of the styles table.
144 void StartStyles() override;
146 /// End of the styles table.
147 void EndStyles(sal_uInt16 nNumberOfStyles) override;
149 /// Write default style.
150 void DefaultStyle() override;
152 /// Start of a style in the styles table.
153 void StartStyle(const OUString& rName, StyleType eType, sal_uInt16 nBase, sal_uInt16 nNext,
154 sal_uInt16 nLink, sal_uInt16 nWwId, sal_uInt16 nSlot,
155 bool bAutoUpdate) override;
157 /// End of a style in the styles table.
158 void EndStyle() override;
160 /// Start of (paragraph or run) properties of a style.
161 void StartStyleProperties(bool bParProp, sal_uInt16 nStyle) override;
163 /// End of (paragraph or run) properties of a style.
164 void EndStyleProperties(bool bParProp) override;
166 /// Numbering rule and Id.
167 void OutlineNumbering(sal_uInt8 nLvl) override;
169 /// Page break
170 /// As a paragraph property - the paragraph should be on the next page.
171 void PageBreakBefore(bool bBreak) override;
173 /// Write a section break
174 /// msword::ColumnBreak or msword::PageBreak
175 void SectionBreak(sal_uInt8 nC, bool bBreakAfter, const WW8_SepInfo* pSectionInfo = nullptr,
176 bool bExtraPageBreak = false) override;
178 /// Start of the section properties.
179 void StartSection() override;
181 /// End of the section properties.
182 void EndSection() override;
184 /// Protection of forms.
185 void SectionFormProtection(bool bProtected) override;
187 /// Numbering of the lines in the document.
188 void SectionLineNumbering(sal_uLong nRestartNo, const SwLineNumberInfo& rLnNumInfo) override;
190 /// Has different headers/footers for the title page.
191 void SectionTitlePage() override;
193 /// Description of the page borders.
194 void SectionPageBorders(const SwFrameFormat* pFormat,
195 const SwFrameFormat* pFirstPageFormat) override;
197 /// Columns populated from right/numbers on the right side?
198 void SectionBiDi(bool bBiDi) override;
200 /// The style of the page numbers.
202 void SectionPageNumbering(sal_uInt16 nNumType,
203 const ::std::optional<sal_uInt16>& oPageRestartNumber) override;
205 /// The type of breaking.
206 void SectionType(sal_uInt8 nBreakCode) override;
208 void SectFootnoteEndnotePr() override;
210 void WriteFootnoteEndnotePr(bool bFootnote, const SwEndNoteInfo& rInfo);
212 /// Definition of a numbering instance.
213 void NumberingDefinition(sal_uInt16 nId, const SwNumRule& rRule) override;
215 /// Start of the abstract numbering definition instance.
216 void StartAbstractNumbering(sal_uInt16 nId) override;
218 /// End of the abstract numbering definition instance.
219 void EndAbstractNumbering() override;
221 /// All the numbering level information.
222 void
223 NumberingLevel(sal_uInt8 nLevel, sal_uInt16 nStart, sal_uInt16 nNumberingType,
224 SvxAdjust eAdjust, const sal_uInt8* pNumLvlPos, sal_uInt8 nFollow,
225 const wwFont* pFont, const SfxItemSet* pOutSet, sal_Int16 nIndentAt,
226 sal_Int16 nFirstLineIndex, sal_Int16 nListTabPos,
227 const OUString& rNumberingString,
228 const SvxBrushItem* pBrush) override; //For i120928,to export graphic of bullet
230 void WriteField_Impl(const SwField* pField, ww::eField eType, std::u16string_view rFieldCmd,
231 FieldFlags nMode);
232 void WriteBookmarks_Impl(std::vector<OUString>& rStarts, std::vector<OUString>& rEnds);
233 void WriteAnnotationMarks_Impl(std::vector<OUString>& rStarts, std::vector<OUString>& rEnds);
234 void WriteHeaderFooter_Impl(const SwFrameFormat& rFormat, bool bHeader, const char* pStr,
235 bool bTitlepg);
236 void WriteBookmarkInActParagraph(const OUString& /*rName*/, sal_Int32 /*nFirstRunPos*/,
237 sal_Int32 /*nLastRunPos*/) override{};
239 protected:
240 /// Output frames - the implementation.
241 void OutputFlyFrame_Impl(const ww8::Frame& rFrame, const Point& rNdTopLeft) override;
243 /// Sfx item Sfx item RES_CHRATR_CASEMAP
244 void CharCaseMap(const SvxCaseMapItem& rCaseMap) override;
246 /// Sfx item Sfx item RES_CHRATR_COLOR
247 void CharColor(const SvxColorItem& rColor) override;
249 /// Sfx item Sfx item RES_CHRATR_CONTOUR
250 void CharContour(const SvxContourItem& rContour) override;
252 /// Sfx item RES_CHRATR_CROSSEDOUT
253 void CharCrossedOut(const SvxCrossedOutItem& rCrossedOut) override;
255 /// Sfx item RES_CHRATR_ESCAPEMENT
256 void CharEscapement(const SvxEscapementItem& rEscapement) override;
258 /// Sfx item RES_CHRATR_FONT
259 void CharFont(const SvxFontItem& rFont) override;
261 /// Sfx item RES_CHRATR_FONTSIZE
262 void CharFontSize(const SvxFontHeightItem& rFontSize) override;
264 /// Sfx item RES_CHRATR_KERNING
265 void CharKerning(const SvxKerningItem& rKerning) override;
267 /// Sfx item RES_CHRATR_LANGUAGE
268 void CharLanguage(const SvxLanguageItem& rLanguage) override;
270 /// Sfx item RES_CHRATR_POSTURE
271 void CharPosture(const SvxPostureItem& rPosture) override;
273 /// Sfx item RES_CHRATR_SHADOWED
274 void CharShadow(const SvxShadowedItem& rShadow) override;
276 /// Sfx item RES_CHRATR_UNDERLINE
277 void CharUnderline(const SvxUnderlineItem& rUnderline) override;
279 /// Sfx item RES_CHRATR_WEIGHT
280 void CharWeight(const SvxWeightItem& rWeight) override;
282 /// Sfx item RES_CHRATR_AUTOKERN
283 void CharAutoKern(const SvxAutoKernItem& rAutoKern) override;
285 /// Sfx item RES_CHRATR_BLINK
286 void CharAnimatedText(const SvxBlinkItem& rBlink) override;
288 /// Sfx item RES_CHRATR_BACKGROUND
289 void CharBackground(const SvxBrushItem& rBrush) override;
291 /// Sfx item RES_CHRATR_CJK_FONT
292 void CharFontCJK(const SvxFontItem& rFont) override;
294 /// Sfx item RES_CHRATR_CJK_FONTSIZE
295 void CharFontSizeCJK(const SvxFontHeightItem& rFontSize) override;
297 /// Sfx item RES_CHRATR_CJK_LANGUAGE
298 void CharLanguageCJK(const SvxLanguageItem& rLanguageItem) override;
300 /// Sfx item RES_CHRATR_CJK_POSTURE
301 void CharPostureCJK(const SvxPostureItem& rPosture) override;
303 /// Sfx item RES_CHRATR_CJK_WEIGHT
304 void CharWeightCJK(const SvxWeightItem& rWeight) override;
306 /// Sfx item RES_CHRATR_CTL_FONT
307 void CharFontCTL(const SvxFontItem& rFont) override;
309 /// Sfx item RES_CHRATR_CTL_FONTSIZE
310 void CharFontSizeCTL(const SvxFontHeightItem& rFontSize) override;
312 /// Sfx item RES_CHRATR_CTL_LANGUAGE
313 void CharLanguageCTL(const SvxLanguageItem& rLanguageItem) override;
315 /// Sfx item RES_CHRATR_CTL_POSTURE
316 void CharPostureCTL(const SvxPostureItem& rPosture) override;
318 /// Sfx item RES_CHRATR_CTL_WEIGHT
319 void CharWeightCTL(const SvxWeightItem& rWeight) override;
321 /// Sfx item RES_CHRATR_BidiRTL
322 void CharBidiRTL(const SfxPoolItem& rItem) override;
324 /// Sfx item RES_CHRATR_IdctHint
325 void CharIdctHint(const SfxPoolItem& rItem) override;
327 /// Sfx item RES_CHRATR_ROTATE
328 void CharRotate(const SvxCharRotateItem& rRotate) override;
330 /// Sfx item RES_CHRATR_EMPHASIS_MARK
331 void CharEmphasisMark(const SvxEmphasisMarkItem& rEmphasisMark) override;
333 /// Sfx item RES_CHRATR_TWO_LINES
334 void CharTwoLines(const SvxTwoLinesItem& rTwoLines) override;
336 /// Sfx item RES_CHRATR_SCALEW
337 void CharScaleWidth(const SvxCharScaleWidthItem& rScaleWidth) override;
339 /// Sfx item RES_CHRATR_RELIEF
340 void CharRelief(const SvxCharReliefItem& rRelief) override;
342 /// Sfx item RES_CHRATR_HIDDEN
343 void CharHidden(const SvxCharHiddenItem& rHidden) override;
345 /// Sfx item RES_CHRATR_BOX
346 void CharBorder(const ::editeng::SvxBorderLine* pAllBorder, sal_uInt16 nDist,
347 bool bShadow) override;
349 /// Sfx item RES_CHRATR_HIGHLIGHT
350 void CharHighlight(const SvxBrushItem& rBrush) override;
352 /// Sfx item RES_TXTATR_INETFMT
353 void TextINetFormat(const SwFormatINetFormat& rURL) override;
355 /// Sfx item RES_TXTATR_CHARFMT
356 void TextCharFormat(const SwFormatCharFormat& rCharFormat) override;
358 /// Sfx item RES_TXTATR_FTN
359 void TextFootnote_Impl(const SwFormatFootnote& rFootnote) override;
361 /// Sfx item RES_PARATR_LINESPACING
362 void ParaLineSpacing_Impl(short nSpace, short nMulti) override;
364 /// Sfx item RES_PARATR_ADJUST
365 void ParaAdjust(const SvxAdjustItem& rAdjust) override;
367 /// Sfx item RES_PARATR_SPLIT
368 void ParaSplit(const SvxFormatSplitItem& rSplit) override;
370 /// Sfx item RES_PARATR_WIDOWS
371 void ParaWidows(const SvxWidowsItem& rWidows) override;
373 /// Sfx item RES_PARATR_TABSTOP
374 void ParaTabStop(const SvxTabStopItem& rTabStop) override;
376 /// Sfx item RES_PARATR_HYPHENZONE
377 void ParaHyphenZone(const SvxHyphenZoneItem& rHyphenZone) override;
379 /// Sfx item RES_PARATR_NUMRULE
380 void ParaNumRule_Impl(const SwTextNode* pTextNd, sal_Int32 nLvl, sal_Int32 nNumId) override;
382 /// Sfx item RES_PARATR_SCRIPTSPACE
383 void ParaScriptSpace(const SfxBoolItem& rScriptSpace) override;
385 /// Sfx item RES_PARATR_HANGINGPUNCTUATION
386 void ParaHangingPunctuation(const SfxBoolItem& rItem) override;
388 /// Sfx item RES_PARATR_FORBIDDEN_RULES
389 void ParaForbiddenRules(const SfxBoolItem& rItem) override;
391 /// Sfx item RES_PARATR_VERTALIGN
392 void ParaVerticalAlign(const SvxParaVertAlignItem& rAlign) override;
394 /// Sfx item RES_PARATR_SNAPTOGRID
395 void ParaSnapToGrid(const SvxParaGridItem& rItem) override;
397 /// Sfx item RES_FRM_SIZE
398 void FormatFrameSize(const SwFormatFrameSize& rSize) override;
400 /// Sfx item RES_PAPER_BIN
401 void FormatPaperBin(const SvxPaperBinItem& rItem) override;
403 /// Sfx item RES_MARGIN_FIRSTLINE
404 virtual void FormatFirstLineIndent(const SvxFirstLineIndentItem& rFirstLine) override;
405 /// Sfx item RES_MARGIN_TEXTLEFT
406 virtual void FormatTextLeftMargin(const SvxTextLeftMarginItem& rTextLeftMargin) override;
407 /// Sfx item RES_MARGIN_RIGHT
408 virtual void FormatRightMargin(const SvxRightMarginItem& rRightMargin) override;
410 /// Sfx item RES_LR_SPACE
411 void FormatLRSpace(const SvxLRSpaceItem& rLRSpace) override;
413 /// Sfx item RES_UL_SPACE
414 void FormatULSpace(const SvxULSpaceItem& rULSpace) override;
416 /// Sfx item RES_SURROUND
417 void FormatSurround(const SwFormatSurround& rSurround) override;
419 /// Sfx item RES_VERT_ORIENT
420 void FormatVertOrientation(const SwFormatVertOrient& rFlyVert) override;
422 /// Sfx item RES_HORI_ORIENT
423 void FormatHorizOrientation(const SwFormatHoriOrient& rFlyHori) override;
425 /// Sfx item RES_ANCHOR
426 void FormatAnchor(const SwFormatAnchor& rAnchor) override;
428 /// Sfx item RES_BACKGROUND
429 void FormatBackground(const SvxBrushItem& rBrush) override;
431 /// Sfx item RES_FILL_STYLE
432 void FormatFillStyle(const XFillStyleItem& rFillStyle) override;
434 /// Sfx item RES_FILL_GRADIENT
435 void FormatFillGradient(const XFillGradientItem& rFillGradient) override;
437 /// Sfx item RES_BOX
438 void FormatBox(const SvxBoxItem& rBox) override;
440 /// Sfx item RES_COL
441 void FormatColumns_Impl(sal_uInt16 nCols, const SwFormatCol& rCol, bool bEven,
442 SwTwips nPageSize) override;
444 /// Sfx item RES_KEEP
445 void FormatKeep(const SvxFormatKeepItem& rItem) override;
447 /// Sfx item RES_TEXTGRID
448 void FormatTextGrid(const SwTextGridItem& rItem) override;
450 /// Sfx item RES_LINENUMBER
451 void FormatLineNumbering(const SwFormatLineNumber& rNumbering) override;
453 /// Sfx item RES_FRAMEDIR
454 void FormatFrameDirection(const SvxFrameDirectionItem& rDirection) override;
456 /// Sfx item RES_PARATR_GRABBAG
457 void ParaGrabBag(const SfxGrabBagItem& rItem) override;
459 /// Sfx item RES_CHRATR_GRABBAG
460 void CharGrabBag(const SfxGrabBagItem& rItem) override;
462 /// Sfx item RES_PARATR_OUTLINELEVEL
463 void ParaOutlineLevel(const SfxUInt16Item& rItem) override;
465 /// Write the expanded field
466 void WriteExpand(const SwField* pField) override;
468 void RefField(const SwField& rField, const OUString& rRef) override;
469 void HiddenField(const SwField& rField) override;
470 void SetField(const SwField& rField, ww::eField eType, const OUString& rCmd) override;
471 void PostitField(const SwField* pField) override;
472 bool DropdownField(const SwField* pField) override;
473 bool PlaceholderField(const SwField* pField) override;
475 void SectionRtlGutter(const SfxBoolItem& rRtlGutter) override;
477 void TextLineBreak(const SwFormatLineBreak& rLineBreak) override;
479 private:
480 /// Reference to the export, where to get the data from
481 RtfExport& m_rExport;
483 OStringBuffer m_aTabStop;
485 /// Access to the page style of the previous paragraph.
486 const SwPageDesc* m_pPrevPageDesc;
488 /// Output graphic fly frames.
489 void FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat, const SwGrfNode* pGrfNode);
490 void FlyFrameOLE(const SwFlyFrameFormat* pFlyFrameFormat, SwOLENode& rOLENode,
491 const Size& rSize);
492 void FlyFrameOLEReplacement(const SwFlyFrameFormat* pFlyFrameFormat, SwOLENode& rOLENode,
493 const Size& rSize);
494 /// Math export.
495 bool FlyFrameOLEMath(const SwFlyFrameFormat* pFlyFrameFormat, SwOLENode& rOLENode,
496 const Size& rSize);
499 * Table methods.
501 void InitTableHelper(const ww8::WW8TableNodeInfoInner::Pointer_t& pTableTextNodeInfoInner);
502 void StartTable();
503 void StartTableRow(const ww8::WW8TableNodeInfoInner::Pointer_t& pTableTextNodeInfoInner);
504 void StartTableCell();
505 void TableCellProperties(const ww8::WW8TableNodeInfoInner::Pointer_t& pTableTextNodeInfoInner);
506 void EndTableCell();
507 void EndTableRow();
508 void EndTable();
510 /// End cell, row, and even the entire table if necessary.
511 void FinishTableRowCell(const ww8::WW8TableNodeInfoInner::Pointer_t& pInner);
513 void WriteTextFootnoteNumStr(const SwFormatFootnote& rFootnote);
516 * Current style name and its ID.
518 OUString m_rStyleName;
519 sal_uInt16 m_nStyleId;
521 * Current list ID.
523 sal_uInt16 m_nListId;
525 * This is needed because the call order is: run text, run properties, paragraph properties.
526 * What we need is the opposite.
528 RtfStringBuffer m_aRun;
529 RtfStringBuffer m_aRunText;
531 * This is written after runs.
533 OStringBuffer m_aAfterRuns;
535 * Same for colors and stylesheets: first we just want to output colors,
536 * need to buffer the stylesheet table to output it after the color one.
538 OStringBuffer m_aStylesheet;
540 * This one just holds the style commands in the current style.
542 OStringBuffer m_aStyles;
544 * This is the same as m_aStyles but the contents of it is Assoc.
546 OStringBuffer m_aStylesAssocHich;
547 OStringBuffer m_aStylesAssocDbch;
548 OStringBuffer m_aStylesAssocRtlch;
549 OStringBuffer m_aStylesAssocLtrch;
551 bool m_bIsRTL;
552 sal_uInt16 m_nScript;
553 bool m_bControlLtrRtl;
555 sal_Int32 m_nNextAnnotationMarkId;
556 sal_Int32 m_nCurrentAnnotationMarkId;
557 /// Maps annotation mark names to ID's.
558 std::map<OString, sal_Int32> m_rOpenedAnnotationMarksIds;
561 * The current table helper.
563 std::unique_ptr<SwWriteTable> m_pTableWrt;
566 * Remember if we are in an open cell, or not.
568 bool m_bTableCellOpen;
571 * Remember the current table depth.
573 sal_uInt32 m_nTableDepth;
576 * Remember if we wrote a \cell or not.
578 bool m_bTableAfterCell;
581 * For late output of row definitions.
583 OStringBuffer m_aRowDefs;
586 * Is a column break needed after the next \par?
588 bool m_nColBreakNeeded;
591 * If section breaks should be buffered to m_aSectionBreaks
593 bool m_bBufferSectionBreaks;
594 OStringBuffer m_aSectionBreaks;
597 * If section headers (and footers) should be buffered to
598 * m_aSectionHeaders.
600 bool m_bBufferSectionHeaders;
601 OStringBuffer m_aSectionHeaders;
604 * Support for starting multiple tables at the same cell.
605 * If the current table is the last started one.
607 bool m_bLastTable;
609 * List of already started but not yet defined tables (need to be defined
610 * after the nested tables).
612 std::vector<OString> m_aTables;
614 * If cell info is already output.
616 bool m_bWroteCellInfo;
618 /// If we ended a table row without starting a new one.
619 bool m_bTableRowEnded;
621 /// Number of cells from the table definition, by depth.
622 std::map<sal_uInt32, sal_uInt32> m_aCells;
624 bool m_bIsBeforeFirstParagraph;
626 /// If we're in a paragraph that has a single empty run only.
627 bool m_bSingleEmptyRun;
629 bool m_bInRun;
631 bool m_bInRuby;
633 /// Maps ID's to postit fields, used in atrfstart/end and atnref.
634 std::map<sal_uInt16, const SwPostItField*> m_aPostitFields;
636 /// When exporting fly frames, this holds the real size of the frame.
637 const Size* m_pFlyFrameSize;
639 std::vector<std::pair<OString, OString>> m_aFlyProperties;
641 std::optional<css::drawing::FillStyle> m_oFillStyle;
643 /// If we're in the process of exporting a hyperlink, then its URL.
644 std::stack<OUString> m_aURLs;
646 /// If original file had \sbauto.
647 bool m_bParaBeforeAutoSpacing;
648 /// If m_bParaBeforeAutoSpacing is set, value of \sb.
649 sal_Int32 m_nParaBeforeSpacing;
650 /// If original file had \saauto.
651 bool m_bParaAfterAutoSpacing;
652 /// If m_bParaBeforeAutoSpacing is set, value of \sa.
653 sal_Int32 m_nParaAfterSpacing;
655 editeng::WordPageMargins m_aPageMargins;
657 public:
658 explicit RtfAttributeOutput(RtfExport& rExport);
660 ~RtfAttributeOutput() override;
662 /// Return the right export class.
663 MSWordExportBase& GetExport() override;
665 // These are used by wwFont::WriteRtf()
666 /// Start the font.
667 void StartFont(std::u16string_view rFamilyName) const;
669 /// End the font.
670 void EndFont() const;
672 /// Alternate name for the font.
673 void FontAlternateName(std::u16string_view rName) const;
675 /// Font charset.
676 void FontCharset(sal_uInt8 nCharSet) const;
678 /// Font family.
679 void FontFamilyType(FontFamily eFamily, const wwFont& rFont) const;
681 /// Font pitch.
682 void FontPitchType(FontPitch ePitch) const;
684 void BulletDefinition(int nId, const Graphic& rGraphic, Size aSize) override;
686 /// Handles just the {\shptxt ...} part of a shape export.
687 void writeTextFrame(const ww8::Frame& rFrame, bool bTextBox = false);
689 OStringBuffer& GetTabStop() { return m_aTabStop; }
691 const SwPageDesc* GetPrevPageDesc() const { return m_pPrevPageDesc; }
694 #endif // INCLUDED_SW_SOURCE_FILTER_WW8_RTFATTRIBUTEOUTPUT_HXX
696 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */