bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / filter / ww8 / docxattributeoutput.hxx
blob85014b9ca97f3c3934d314b8bc1971359419f114
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 _DOCXATTRIBUTEOUTPUT_HXX_
21 #define _DOCXATTRIBUTEOUTPUT_HXX_
23 #include "attributeoutputbase.hxx"
24 #include "fields.hxx"
25 #include "IMark.hxx"
26 #include "docxexport.hxx"
28 #include <sax/fshelper.hxx>
29 #include <sax/fastattribs.hxx>
30 #include <vcl/vclenum.hxx>
31 #include <svx/xenum.hxx>
33 #include <fldbas.hxx>
35 #include <vector>
36 #include <boost/scoped_ptr.hpp>
37 #include <boost/optional.hpp>
38 #include <oox/export/vmlexport.hxx>
40 class SwGrfNode;
41 class SdrObject;
43 namespace docx { class FootnotesList; }
44 namespace oox { namespace drawingml { class DrawingML; } }
46 struct FieldInfos
48 const SwField* pField;
49 const ::sw::mark::IFieldmark* pFieldmark;
50 ww::eField eType;
51 bool bOpen;
52 bool bClose;
53 String sCmd;
54 FieldInfos() : pField(NULL), pFieldmark(NULL), eType(ww::eUNKNOWN), bOpen(false), bClose(false){}
57 enum DocxColBreakStatus
59 COLBRK_NONE,
60 COLBRK_POSTPONE,
61 COLBRK_WRITE
64 /// The class that has handlers for various resource types when exporting as DOCX.
65 class DocxAttributeOutput : public AttributeOutputBase, public oox::vml::VMLTextExport
67 public:
68 /// Export the state of RTL/CJK.
69 virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript );
71 /// Start of the paragraph.
72 virtual void StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo );
74 /// End of the paragraph.
75 virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner );
77 /// Empty paragraph.
78 virtual void EmptyParagraph();
80 /// Called before we start outputting the attributes.
81 virtual void StartParagraphProperties( const SwTxtNode& rNode );
83 /// Called after we end outputting the attributes.
84 virtual void EndParagraphProperties();
86 /// Start of the text run.
87 virtual void StartRun( const SwRedlineData* pRedlineData, bool bSingleEmptyRun = false );
89 /// End of the text run.
90 virtual void EndRun();
92 /// Called before we start outputting the attributes.
93 virtual void StartRunProperties();
95 /// Called after we end outputting the attributes.
96 virtual void EndRunProperties( const SwRedlineData* pRedlineData );
98 virtual void FootnoteEndnoteRefTag();
100 virtual void SectFootnoteEndnotePr();
102 virtual void WritePostitFieldReference();
104 virtual void WritePostitFieldStart();
106 virtual void WritePostitFieldEnd();
108 /// Output text (inside a run).
109 virtual void RunText( const String& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8 );
111 /// Output text (without markup).
112 virtual void RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet );
114 /// Output ruby start.
115 virtual void StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby );
117 /// Output ruby end.
118 virtual void EndRuby();
120 /// Output URL start.
121 virtual bool StartURL( const String& rUrl, const String& rTarget );
123 /// Output URL end.
124 virtual bool EndURL();
126 virtual void FieldVanish( const String& rTxt, ww::eField eType );
128 /// Output redlining.
130 /// The common attribute that can be among the run properties.
131 virtual void Redline( const SwRedlineData* pRedline );
133 /// Output redlining.
135 /// Start of the tag that encloses the run, fills the info according to
136 /// the value of m_pRedlineData.
137 void StartRedline();
139 /// Output redlining.
141 /// End of the tag that encloses the run.
142 void EndRedline();
144 virtual void FormatDrop( const SwTxtNode& rNode, const SwFmtDrop& rSwFmtDrop, sal_uInt16 nStyle, ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner );
146 /// Output style.
147 virtual void ParagraphStyle( sal_uInt16 nStyle );
149 virtual void TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
150 virtual void TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
151 virtual void TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
152 virtual void TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
153 virtual void TableDefaultCellMargins( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
154 virtual void TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
155 virtual void TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
156 virtual void TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
157 virtual void TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
158 virtual void TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
159 virtual void TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t pNodeInfo );
160 virtual void TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner );
161 virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
162 virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
163 virtual void TableRowEnd( sal_uInt32 nDepth = 1 );
165 /// Start of the styles table.
166 virtual void StartStyles();
168 /// End of the styles table.
169 virtual void EndStyles( sal_uInt16 nNumberOfStyles );
171 /// Write default style.
172 virtual void DefaultStyle( sal_uInt16 nStyle );
174 /// Start of a style in the styles table.
175 virtual void StartStyle( const String& rName, bool bPapFmt,
176 sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nWwId, sal_uInt16 nId,
177 bool bAutoUpdate );
179 /// End of a style in the styles table.
180 virtual void EndStyle();
182 /// Start of (paragraph or run) properties of a style.
183 virtual void StartStyleProperties( bool bParProp, sal_uInt16 nStyle );
185 /// End of (paragraph or run) properties of a style.
186 virtual void EndStyleProperties( bool bParProp );
188 /// Numbering rule and Id.
189 virtual void OutlineNumbering( sal_uInt8 nLvl, const SwNumFmt &rNFmt, const SwFmt &rFmt );
191 /// Page break
192 /// As a paragraph property - the paragraph should be on the next page.
193 virtual void PageBreakBefore( bool bBreak );
195 /// Write a section break
196 /// msword::ColumnBreak or msword::PageBreak
197 virtual void SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectionInfo = NULL );
199 /// Start of the section properties.
200 virtual void StartSection();
202 /// End of the section properties.
203 virtual void EndSection();
205 /// Protection of forms.
206 virtual void SectionFormProtection( bool bProtected );
208 /// Numbering of the lines in the document.
209 virtual void SectionLineNumbering( sal_uLong nRestartNo, const SwLineNumberInfo& rLnNumInfo );
211 /// Has different headers/footers for the title page.
212 virtual void SectionTitlePage();
214 /// Description of the page borders.
215 virtual void SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmFmt* pFirstPageFmt );
217 /// Columns populated from right/numbers on the right side?
218 virtual void SectionBiDi( bool bBiDi );
220 /// The style of the page numbers.
222 /// nPageRestartNumberr being 0 means no restart.
223 virtual void SectionPageNumbering( sal_uInt16 nNumType, sal_uInt16 nPageRestartNumber );
225 /// The type of breaking.
226 virtual void SectionType( sal_uInt8 nBreakCode );
228 /// Start the font.
229 void StartFont( const String& rFamilyName ) const;
231 /// End the font.
232 void EndFont() const;
234 /// Alternate name for the font.
235 void FontAlternateName( const String& rName ) const;
237 /// Font charset.
238 void FontCharset( sal_uInt8 nCharSet, rtl_TextEncoding nEncoding ) const;
240 /// Font family.
241 void FontFamilyType( FontFamily eFamily ) const;
243 /// Font pitch.
244 void FontPitchType( FontPitch ePitch ) const;
246 /// Write out the font into the document, if it's an embedded font.
247 void EmbedFont( const OUString& name, FontFamily family, FontPitch pitch, rtl_TextEncoding encoding );
249 /// Definition of a numbering instance.
250 virtual void NumberingDefinition( sal_uInt16 nId, const SwNumRule &rRule );
252 /// Start of the abstract numbering definition instance.
253 virtual void StartAbstractNumbering( sal_uInt16 nId );
255 /// End of the abstract numbering definition instance.
256 virtual void EndAbstractNumbering();
258 /// All the numbering level information.
259 virtual void NumberingLevel( sal_uInt8 nLevel,
260 sal_uInt16 nStart,
261 sal_uInt16 nNumberingType,
262 SvxAdjust eAdjust,
263 const sal_uInt8 *pNumLvlPos,
264 sal_uInt8 nFollow,
265 const wwFont *pFont,
266 const SfxItemSet *pOutSet,
267 sal_Int16 nIndentAt,
268 sal_Int16 nFirstLineIndex,
269 sal_Int16 nListTabPos,
270 const String &rNumberingString,
271 const SvxBrushItem* pBrush = 0 );
273 void WriteField_Impl( const SwField* pFld, ww::eField eType, const String& rFldCmd, sal_uInt8 nMode );
274 void WriteFormData_Impl( const ::sw::mark::IFieldmark& rFieldmark );
276 void WriteBookmarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds );
278 private:
279 /// Initialize the structures where we are going to collect some of the paragraph properties.
281 /// Some of the properties have to be collected from more sources, and are
282 /// actually not written between StartParagraphProperties and
283 /// EndParagraphProperties. They are output in this method, which is
284 /// supposed to be called just before outputting </rPr> whenever it is done.
285 void InitCollectedParagraphProperties();
287 /// Output what we collected during the run properties output.
289 /// @see WriteCollectedParagrapProperties().
290 void WriteCollectedParagraphProperties();
292 /// Initialize the structures where we are going to collect some of the run properties.
294 /// This is an equivalent of InitCollectedParagraphProperties(), resp.
295 /// WriteCollectectedParagraphProperties().
297 /// @see InitCollectedParagraphProperties().
298 void InitCollectedRunProperties();
300 /// Output what we collected during the run properties output.
302 /// @see InitCollectedRunProperies(), WriteCollectedParagraphProperties()
303 void WriteCollectedRunProperties();
305 /// Output graphic fly frames or replacement graphics for OLE nodes.
307 /// For graphic frames, just use the first two parameters, for OLE
308 /// replacement graphics, set the first as 0, and pass the remaining three.
310 /// @see WriteOLE2Obj()
311 void FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size& rSize, const SwFlyFrmFmt* pOLEFrmFmt = 0, SwOLENode* pOLENode = 0);
312 void WriteOLE2Obj( const SdrObject* pSdrObj, SwOLENode& rNode, const Size& rSize, const SwFlyFrmFmt* pFlyFrmFmt);
313 bool WriteOLEChart( const SdrObject* pSdrObj, const Size& rSize );
314 bool WriteOLEMath( const SdrObject* pSdrObj, const SwOLENode& rNode, const Size& rSize );
316 void InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
317 void StartTable( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
318 void StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
319 void StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
320 void TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
321 void EndTableCell( );
322 void EndTableRow( );
323 void EndTable();
325 /// End cell, row, and even the entire table if necessary.
326 void FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool bForceEmptyParagraph = false );
328 void WriteFFData( const FieldInfos& rInfos );
329 void WritePendingPlaceholder();
331 void EmbedFontStyle( const OUString& name, int tag, FontFamily family, FontItalic italic, FontWeight weight,
332 FontPitch pitch, rtl_TextEncoding encoding );
334 protected:
336 /// Output frames - the implementation.
337 virtual void OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point& rNdTopLeft );
339 /// Sfx item Sfx item RES_CHRATR_CASEMAP
340 virtual void CharCaseMap( const SvxCaseMapItem& rCaseMap );
342 /// Sfx item Sfx item RES_CHRATR_COLOR
343 virtual void CharColor( const SvxColorItem& rColor);
345 /// Sfx item Sfx item RES_CHRATR_CONTOUR
346 virtual void CharContour( const SvxContourItem& rContour );
348 /// Sfx item RES_CHRATR_CROSSEDOUT
349 virtual void CharCrossedOut( const SvxCrossedOutItem& rCrossedOut );
351 /// Sfx item RES_CHRATR_ESCAPEMENT
352 virtual void CharEscapement( const SvxEscapementItem& rEscapement );
354 /// Sfx item RES_CHRATR_FONT
355 virtual void CharFont( const SvxFontItem& rFont );
357 /// Sfx item RES_CHRATR_FONTSIZE
358 virtual void CharFontSize( const SvxFontHeightItem& rFontSize );
360 /// Sfx item RES_CHRATR_KERNING
361 virtual void CharKerning( const SvxKerningItem& rKerning );
363 /// Sfx item RES_CHRATR_LANGUAGE
364 virtual void CharLanguage( const SvxLanguageItem& rLanguage );
366 /// Sfx item RES_CHRATR_POSTURE
367 virtual void CharPosture( const SvxPostureItem& rPosture );
369 /// Sfx item RES_CHRATR_SHADOWED
370 virtual void CharShadow( const SvxShadowedItem& rShadow );
372 /// Sfx item RES_CHRATR_UNDERLINE
373 virtual void CharUnderline( const SvxUnderlineItem& rUnderline );
375 /// Sfx item RES_CHRATR_WEIGHT
376 virtual void CharWeight( const SvxWeightItem& rWeight );
378 /// Sfx item RES_CHRATR_AUTOKERN
379 virtual void CharAutoKern( const SvxAutoKernItem& );
381 /// Sfx item RES_CHRATR_BLINK
382 virtual void CharAnimatedText( const SvxBlinkItem& rBlink );
384 /// Sfx item RES_CHRATR_BACKGROUND
385 virtual void CharBackground( const SvxBrushItem& rBrush );
387 /// Sfx item RES_CHRATR_CJK_FONT
388 virtual void CharFontCJK( const SvxFontItem& rFont );
390 /// Sfx item RES_CHRATR_CJK_FONTSIZE
391 virtual void CharFontSizeCJK( const SvxFontHeightItem& rFontSize ) { CharFontSize( rFontSize ); }
393 /// Sfx item RES_CHRATR_CJK_LANGUAGE
394 virtual void CharLanguageCJK( const SvxLanguageItem& rLanguageItem ) { CharLanguage( rLanguageItem ); }
396 /// Sfx item RES_CHRATR_CJK_POSTURE
397 virtual void CharPostureCJK( const SvxPostureItem& rPosture );
399 /// Sfx item RES_CHRATR_CJK_WEIGHT
400 virtual void CharWeightCJK( const SvxWeightItem& rWeight );
402 /// Sfx item RES_CHRATR_CTL_FONT
403 virtual void CharFontCTL( const SvxFontItem& rFont );
405 /// Sfx item RES_CHRATR_CTL_FONTSIZE
406 virtual void CharFontSizeCTL( const SvxFontHeightItem& rFontSize ) { CharFontSize( rFontSize ); }
408 /// Sfx item RES_CHRATR_CTL_LANGUAGE
409 virtual void CharLanguageCTL( const SvxLanguageItem& rLanguageItem ) { CharLanguage( rLanguageItem); }
411 /// Sfx item RES_CHRATR_CTL_POSTURE
412 virtual void CharPostureCTL( const SvxPostureItem& rWeight );
414 /// Sfx item RES_CHRATR_CTL_WEIGHT
415 virtual void CharWeightCTL( const SvxWeightItem& rWeight );
417 /// Sfx item RES_CHRATR_ROTATE
418 virtual void CharRotate( const SvxCharRotateItem& rRotate );
420 /// Sfx item RES_CHRATR_EMPHASIS_MARK
421 virtual void CharEmphasisMark( const SvxEmphasisMarkItem& rEmphasisMark );
423 /// Sfx item RES_CHRATR_TWO_LINES
424 virtual void CharTwoLines( const SvxTwoLinesItem& rTwoLines );
426 /// Sfx item RES_CHRATR_SCALEW
427 virtual void CharScaleWidth( const SvxCharScaleWidthItem& rScaleWidth );
429 /// Sfx item RES_CHRATR_RELIEF
430 virtual void CharRelief( const SvxCharReliefItem& rRelief);
432 /// Sfx item RES_CHRATR_HIDDEN
433 virtual void CharHidden( const SvxCharHiddenItem& rHidden );
435 /// Sfx item RES_TXTATR_INETFMT
436 virtual void TextINetFormat( const SwFmtINetFmt& );
438 /// Sfx item RES_TXTATR_CHARFMT
439 virtual void TextCharFormat( const SwFmtCharFmt& );
441 /// Sfx item RES_TXTATR_FTN
442 virtual void TextFootnote_Impl( const SwFmtFtn& );
444 /// Output the footnote/endnote reference (if there's one to output).
445 void FootnoteEndnoteReference();
447 /// Sfx item RES_PARATR_LINESPACING
448 virtual void ParaLineSpacing_Impl( short nSpace, short nMulti );
450 /// Sfx item RES_PARATR_ADJUST
451 virtual void ParaAdjust( const SvxAdjustItem& rAdjust );
453 /// Sfx item RES_PARATR_SPLIT
454 virtual void ParaSplit( const SvxFmtSplitItem& rSplit );
456 /// Sfx item RES_PARATR_WIDOWS
457 virtual void ParaWidows( const SvxWidowsItem& rWidows );
459 /// Sfx item RES_PARATR_TABSTOP
460 virtual void ParaTabStop( const SvxTabStopItem& rTabStop );
462 /// Sfx item RES_PARATR_HYPHENZONE
463 virtual void ParaHyphenZone( const SvxHyphenZoneItem& );
465 /// Sfx item RES_PARATR_NUMRULE
466 virtual void ParaNumRule_Impl( const SwTxtNode *pTxtNd, sal_Int32 nLvl, sal_Int32 nNumId );
468 /// Sfx item RES_PARATR_SCRIPTSPACE
469 virtual void ParaScriptSpace( const SfxBoolItem& );
471 /// Sfx item RES_PARATR_VERTALIGN
472 virtual void ParaVerticalAlign( const SvxParaVertAlignItem& rAlign );
474 /// Sfx item RES_PARATR_SNAPTOGRID
475 virtual void ParaSnapToGrid( const SvxParaGridItem& );
477 /// Sfx item RES_FRM_SIZE
478 virtual void FormatFrameSize( const SwFmtFrmSize& );
480 /// Sfx item RES_PAPER_BIN
481 virtual void FormatPaperBin( const SvxPaperBinItem& );
483 /// Sfx item RES_LR_SPACE
484 virtual void FormatLRSpace( const SvxLRSpaceItem& rLRSpace );
486 /// Sfx item RES_UL_SPACE
487 virtual void FormatULSpace( const SvxULSpaceItem& rULSpace );
489 /// Sfx item RES_SURROUND
490 virtual void FormatSurround( const SwFmtSurround& );
492 /// Sfx item RES_VERT_ORIENT
493 virtual void FormatVertOrientation( const SwFmtVertOrient& );
495 /// Sfx item RES_HORI_ORIENT
496 virtual void FormatHorizOrientation( const SwFmtHoriOrient& );
498 /// Sfx item RES_ANCHOR
499 virtual void FormatAnchor( const SwFmtAnchor& );
501 /// Sfx item RES_BACKGROUND
502 virtual void FormatBackground( const SvxBrushItem& );
504 /// Sfx item RES_FILL_STYLE
505 virtual void FormatFillStyle( const XFillStyleItem& );
507 /// Sfx item RES_FILL_GRADIENT
508 virtual void FormatFillGradient( const XFillGradientItem& );
510 /// Sfx item RES_BOX
511 virtual void FormatBox( const SvxBoxItem& );
513 /// Sfx item RES_COL
514 virtual void FormatColumns_Impl( sal_uInt16 nCols, const SwFmtCol & rCol, bool bEven, SwTwips nPageSize );
516 /// Sfx item RES_KEEP
517 virtual void FormatKeep( const SvxFmtKeepItem& );
519 /// Sfx item RES_TEXTGRID
520 virtual void FormatTextGrid( const SwTextGridItem& );
522 /// Sfx item RES_LINENUMBER
523 virtual void FormatLineNumbering( const SwFmtLineNumber& );
525 /// Sfx item RES_FRAMEDIR
526 virtual void FormatFrameDirection( const SvxFrameDirectionItem& );
528 /// Write the expanded field
529 virtual void WriteExpand( const SwField* pFld );
531 virtual void RefField( const SwField& rFld, const String& rRef );
532 virtual void HiddenField( const SwField& rFld );
533 virtual void SetField( const SwField& rFld, ww::eField eType, const String& rCmd );
534 virtual void PostitField( const SwField* pFld );
535 virtual bool DropdownField( const SwField* pFld );
536 virtual bool PlaceholderField( const SwField* pFld );
538 virtual bool AnalyzeURL( const String& rURL, const String& rTarget, String* pLinkURL, String* pMark );
540 /// Reference to the export, where to get the data from
541 DocxExport &m_rExport;
543 /// Fast serializer to output the data
544 ::sax_fastparser::FSHelperPtr m_pSerializer;
546 /// DrawingML access
547 oox::drawingml::DrawingML &m_rDrawingML;
549 private:
551 void DoWriteBookmarks( );
552 void WritePostponedGraphic();
553 void WritePostponedMath();
554 void WriteCommentRanges();
556 void StartField_Impl( FieldInfos& rInfos, bool bWriteRun = sal_False );
557 void DoWriteCmd( String& rCmd );
558 void CmdField_Impl( FieldInfos& rInfos );
559 void EndField_Impl( FieldInfos& rInfos );
561 ::sax_fastparser::FastAttributeList *m_pFontsAttrList, *m_pEastAsianLayoutAttrList;
562 ::sax_fastparser::FastAttributeList *m_pCharLangAttrList;
563 ::sax_fastparser::FastAttributeList *m_pSectionSpacingAttrList;
564 ::sax_fastparser::FastAttributeList *m_pParagraphSpacingAttrList;
565 ::sax_fastparser::FastAttributeList *m_pHyperlinkAttrList;
566 ::sax_fastparser::FastAttributeList *m_pFlyAttrList;
567 ::sax_fastparser::FastAttributeList *m_pFlyFillAttrList;
568 ::sax_fastparser::FastAttributeList *m_pFlyWrapAttrList;
569 /// Attributes of the next v:textbox element.
570 ::sax_fastparser::FastAttributeList *m_pTextboxAttrList;
571 /// When exporting fly frames, this holds the real size of the frame.
572 const Size* m_pFlyFrameSize;
574 ::docx::FootnotesList *m_pFootnotesList;
575 ::docx::FootnotesList *m_pEndnotesList;
576 int m_footnoteEndnoteRefTag;
578 boost::scoped_ptr< const WW8_SepInfo > m_pSectionInfo;
580 /// Redline data to remember in the text run.
581 const SwRedlineData *m_pRedlineData;
583 /// Id of the redline
584 sal_Int32 m_nRedlineId;
586 /// Flag indicating that the section properties are being written
587 bool m_bOpenedSectPr;
589 /// Field data to remember in the text run
590 std::vector< FieldInfos > m_Fields;
591 String m_sFieldBkm;
592 sal_Int32 m_nNextMarkId;
594 /// Bookmarks to output
595 std::vector<OString> m_rMarksStart;
596 std::vector<OString> m_rMarksEnd;
598 /// Is there a postit start to output?
599 bool m_bPostitStart;
600 /// Is there a postit end to output?
601 bool m_bPostitEnd;
603 /// Maps of the bookmarks ids
604 std::map<OString, sal_uInt16> m_rOpenedMarksIds;
606 /// Name of the last opened bookmark.
607 OString m_sLastOpenedMark;
609 /// If there are bookmarks around sequence fields, this map contains the
610 /// names of these bookmarks for each sequence.
611 std::map<OUString, std::vector<OString> > m_aSeqMarksNames;
613 /// The current table helper
614 SwWriteTable *m_pTableWrt;
616 /// Remember if we are in an open cell, or not.
617 bool m_bTableCellOpen;
619 /// Remember the current table depth.
620 sal_uInt32 m_nTableDepth;
622 bool m_bParagraphOpened;
624 // Remember that a column break has to be opened at the
625 // beginning of the next paragraph
626 DocxColBreakStatus m_nColBreakStatus;
628 std::vector<sw::Frame> m_aParentFrames;
629 bool m_bTextFrameSyntax;
630 OStringBuffer m_aTextFrameStyle;
631 // close of hyperlink needed
632 bool m_closeHyperlinkInThisRun;
633 bool m_closeHyperlinkInPreviousRun;
634 bool m_startedHyperlink;
636 struct PostponedGraphic
638 PostponedGraphic( const SwGrfNode* n, Size s ) : grfNode( n ), size( s ) {};
639 const SwGrfNode* grfNode;
640 Size size;
642 std::list< PostponedGraphic >* m_postponedGraphic;
643 const SwOLENode* m_postponedMath;
644 const SwField* pendingPlaceholder;
645 std::vector< const SwPostItField* > m_postitFields;
646 unsigned int m_postitFieldsMaxId;
647 int m_anchorId;
648 int m_nextFontId;
649 struct EmbeddedFontRef
651 OString relId;
652 OString fontKey;
654 std::map< OUString, EmbeddedFontRef > fontFilesMap; // font file url to data
656 // Remember first cell (used for for default borders/margins) of each table
657 std::vector<ww8::WW8TableNodeInfoInner::Pointer_t> tableFirstCells;
659 boost::optional<XFillStyle> m_oFillStyle;
661 /// Is fake rotation detected, so rotation with 90 degrees should be ignored in this cell?
662 bool m_bBtLr;
664 public:
665 DocxAttributeOutput( DocxExport &rExport, ::sax_fastparser::FSHelperPtr pSerializer, oox::drawingml::DrawingML* pDrawingML );
667 virtual ~DocxAttributeOutput();
669 /// Return the right export class.
670 virtual DocxExport& GetExport();
671 const DocxExport& GetExport() const { return const_cast< DocxAttributeOutput* >( this )->GetExport(); }
673 /// For eg. the output of the styles, we need to switch the serializer to an other one.
674 void SetSerializer( ::sax_fastparser::FSHelperPtr pSerializer ) { m_pSerializer = pSerializer; }
676 /// Occasionnaly need to use this serializer from the outside
677 ::sax_fastparser::FSHelperPtr GetSerializer( ) { return m_pSerializer; }
679 /// Do we have any footnotes?
680 bool HasFootnotes() const;
682 /// Do we have any endnotes?
683 bool HasEndnotes() const;
685 /// Output the content of the footnotes.xml resp. endnotes.xml
686 void FootnotesEndnotes( bool bFootnotes );
688 /// writes the footnotePr/endnotePr (depending on tag) section
689 void WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr fs, int tag, const SwEndNoteInfo& info, int listtag );
691 bool HasPostitFields() const;
692 void WritePostitFields();
694 /// VMLTextExport
695 virtual void WriteOutliner(const OutlinerParaObject& rParaObj);
696 virtual oox::drawingml::DrawingML& GetDrawingML();
698 void BulletDefinition(int nId, const Graphic& rGraphic, Size aSize) SAL_OVERRIDE;
701 #endif // _DOCXATTRIBUTEOUTPUT_HXX_
703 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */