Branch data Line data Source code
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 _DOCXATTRIBUTEOUTPUT_HXX_
21 : : #define _DOCXATTRIBUTEOUTPUT_HXX_
22 : :
23 : : #include "attributeoutputbase.hxx"
24 : : #include "fields.hxx"
25 : : #include "IMark.hxx"
26 : : #include "docxexport.hxx"
27 : :
28 : : #include <sax/fshelper.hxx>
29 : : #include <sax/fastattribs.hxx>
30 : : #include <vcl/vclenum.hxx>
31 : :
32 : : #include <fldbas.hxx>
33 : :
34 : : #include <vector>
35 : : #include <boost/scoped_ptr.hpp>
36 : : #include <oox/export/vmlexport.hxx>
37 : :
38 : : class SwGrfNode;
39 : : class SdrObject;
40 : :
41 : : namespace docx { class FootnotesList; }
42 : : namespace oox { namespace drawingml { class DrawingML; } }
43 : :
44 : 9 : struct FieldInfos
45 : : {
46 : : const SwField* pField;
47 : : const ::sw::mark::IFieldmark* pFieldmark;
48 : : ww::eField eType;
49 : : bool bOpen;
50 : : bool bClose;
51 : : String sCmd;
52 : 3 : FieldInfos() : pField(NULL), pFieldmark(NULL), eType(ww::eUNKNOWN), bOpen(false), bClose(false){}
53 : : };
54 : :
55 : : enum DocxColBreakStatus
56 : : {
57 : : COLBRK_NONE,
58 : : COLBRK_POSTPONE,
59 : : COLBRK_WRITE
60 : : };
61 : :
62 : : /// The class that has handlers for various resource types when exporting as DOCX.
63 : : class DocxAttributeOutput : public AttributeOutputBase, public oox::vml::VMLTextExport
64 : : {
65 : : public:
66 : : /// Export the state of RTL/CJK.
67 : : virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript );
68 : :
69 : : /// Start of the paragraph.
70 : : virtual void StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo );
71 : :
72 : : /// End of the paragraph.
73 : : virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner );
74 : :
75 : : /// Empty paragraph.
76 : : virtual void EmptyParagraph();
77 : :
78 : : /// Called before we start outputting the attributes.
79 : : virtual void StartParagraphProperties( const SwTxtNode& rNode );
80 : :
81 : : /// Called after we end outputting the attributes.
82 : : virtual void EndParagraphProperties();
83 : :
84 : : /// Start of the text run.
85 : : virtual void StartRun( const SwRedlineData* pRedlineData, bool bSingleEmptyRun = false );
86 : :
87 : : /// End of the text run.
88 : : virtual void EndRun();
89 : :
90 : : /// Called before we start outputting the attributes.
91 : : virtual void StartRunProperties();
92 : :
93 : : /// Called after we end outputting the attributes.
94 : : virtual void EndRunProperties( const SwRedlineData* pRedlineData );
95 : :
96 : : virtual void FootnoteEndnoteRefTag();
97 : :
98 : : virtual void SectFootnoteEndnotePr();
99 : :
100 : : virtual void WritePostitFieldReference();
101 : :
102 : : virtual void WritePostitFieldStart();
103 : :
104 : : virtual void WritePostitFieldEnd();
105 : :
106 : : /// Output text (inside a run).
107 : : virtual void RunText( const String& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8 );
108 : :
109 : : /// Output text (without markup).
110 : : virtual void RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet );
111 : :
112 : : /// Output ruby start.
113 : : virtual void StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby );
114 : :
115 : : /// Output ruby end.
116 : : virtual void EndRuby();
117 : :
118 : : /// Output URL start.
119 : : virtual bool StartURL( const String& rUrl, const String& rTarget );
120 : :
121 : : /// Output URL end.
122 : : virtual bool EndURL();
123 : :
124 : : virtual void FieldVanish( const String& rTxt, ww::eField eType );
125 : :
126 : : /// Output redlining.
127 : : ///
128 : : /// The common attribute that can be among the run properties.
129 : : virtual void Redline( const SwRedlineData* pRedline );
130 : :
131 : : /// Output redlining.
132 : : ///
133 : : /// Start of the tag that encloses the run, fills the info according to
134 : : /// the value of m_pRedlineData.
135 : : void StartRedline( const SwRedlineData* pRedlineData );
136 : :
137 : : /// Output redlining.
138 : : ///
139 : : /// End of the tag that encloses the run.
140 : : void EndRedline();
141 : :
142 : : virtual void FormatDrop( const SwTxtNode& rNode, const SwFmtDrop& rSwFmtDrop, sal_uInt16 nStyle, ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner );
143 : :
144 : : /// Output style.
145 : : virtual void ParagraphStyle( sal_uInt16 nStyle );
146 : :
147 : : virtual void TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
148 : : virtual void TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
149 : : virtual void TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
150 : : virtual void TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
151 : : virtual void TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
152 : : virtual void TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
153 : : virtual void TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
154 : : virtual void TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
155 : : virtual void TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
156 : : virtual void TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t pNodeInfo );
157 : : virtual void TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner );
158 : : virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
159 : : virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
160 : : virtual void TableRowEnd( sal_uInt32 nDepth = 1 );
161 : :
162 : : /// Start of the styles table.
163 : : virtual void StartStyles();
164 : :
165 : : /// End of the styles table.
166 : : virtual void EndStyles( sal_uInt16 nNumberOfStyles );
167 : :
168 : : /// Write default style.
169 : : virtual void DefaultStyle( sal_uInt16 nStyle );
170 : :
171 : : /// Start of a style in the styles table.
172 : : virtual void StartStyle( const String& rName, bool bPapFmt,
173 : : sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nWwId, sal_uInt16 nId,
174 : : bool bAutoUpdate );
175 : :
176 : : /// End of a style in the styles table.
177 : : virtual void EndStyle();
178 : :
179 : : /// Start of (paragraph or run) properties of a style.
180 : : virtual void StartStyleProperties( bool bParProp, sal_uInt16 nStyle );
181 : :
182 : : /// End of (paragraph or run) properties of a style.
183 : : virtual void EndStyleProperties( bool bParProp );
184 : :
185 : : /// Numbering rule and Id.
186 : : virtual void OutlineNumbering( sal_uInt8 nLvl, const SwNumFmt &rNFmt, const SwFmt &rFmt );
187 : :
188 : : /// Page break
189 : : /// As a paragraph property - the paragraph should be on the next page.
190 : : virtual void PageBreakBefore( bool bBreak );
191 : :
192 : : /// Write a section break
193 : : /// msword::ColumnBreak or msword::PageBreak
194 : : virtual void SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectionInfo = NULL );
195 : :
196 : : /// Start of the section properties.
197 : : virtual void StartSection();
198 : :
199 : : /// End of the section properties.
200 : : virtual void EndSection();
201 : :
202 : : /// Protection of forms.
203 : : virtual void SectionFormProtection( bool bProtected );
204 : :
205 : : /// Numbering of the lines in the document.
206 : : virtual void SectionLineNumbering( sal_uLong nRestartNo, const SwLineNumberInfo& rLnNumInfo );
207 : :
208 : : /// Has different headers/footers for the title page.
209 : : virtual void SectionTitlePage();
210 : :
211 : : /// Description of the page borders.
212 : : virtual void SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmFmt* pFirstPageFmt );
213 : :
214 : : /// Columns populated from right/numbers on the right side?
215 : : virtual void SectionBiDi( bool bBiDi );
216 : :
217 : : /// The style of the page numbers.
218 : : ///
219 : : /// nPageRestartNumberr being 0 means no restart.
220 : : virtual void SectionPageNumbering( sal_uInt16 nNumType, sal_uInt16 nPageRestartNumber );
221 : :
222 : : /// The type of breaking.
223 : : virtual void SectionType( sal_uInt8 nBreakCode );
224 : :
225 : : /// Start the font.
226 : : void StartFont( const String& rFamilyName ) const;
227 : :
228 : : /// End the font.
229 : : void EndFont() const;
230 : :
231 : : /// Alternate name for the font.
232 : : void FontAlternateName( const String& rName ) const;
233 : :
234 : : /// Font charset.
235 : : void FontCharset( sal_uInt8 nCharSet, rtl_TextEncoding nEncoding ) const;
236 : :
237 : : /// Font family.
238 : : void FontFamilyType( FontFamily eFamily ) const;
239 : :
240 : : /// Font pitch.
241 : : void FontPitchType( FontPitch ePitch ) const;
242 : :
243 : : /// Definition of a numbering instance.
244 : : virtual void NumberingDefinition( sal_uInt16 nId, const SwNumRule &rRule );
245 : :
246 : : /// Start of the abstract numbering definition instance.
247 : : virtual void StartAbstractNumbering( sal_uInt16 nId );
248 : :
249 : : /// End of the abstract numbering definition instance.
250 : : virtual void EndAbstractNumbering();
251 : :
252 : : /// All the numbering level information.
253 : : virtual void NumberingLevel( sal_uInt8 nLevel,
254 : : sal_uInt16 nStart,
255 : : sal_uInt16 nNumberingType,
256 : : SvxAdjust eAdjust,
257 : : const sal_uInt8 *pNumLvlPos,
258 : : sal_uInt8 nFollow,
259 : : const wwFont *pFont,
260 : : const SfxItemSet *pOutSet,
261 : : sal_Int16 nIndentAt,
262 : : sal_Int16 nFirstLineIndex,
263 : : sal_Int16 nListTabPos,
264 : : const String &rNumberingString );
265 : :
266 : : void WriteField_Impl( const SwField* pFld, ww::eField eType, const String& rFldCmd, sal_uInt8 nMode );
267 : : void WriteFormData_Impl( const ::sw::mark::IFieldmark& rFieldmark );
268 : :
269 : : void WriteBookmarks_Impl( std::vector< rtl::OUString >& rStarts, std::vector< rtl::OUString >& rEnds );
270 : :
271 : : private:
272 : : /// Initialize the structures where we are going to collect some of the paragraph properties.
273 : : ///
274 : : /// Some of the properties have to be collected from more sources, and are
275 : : /// actually not written between StartParagraphProperties and
276 : : /// EndParagraphProperties. They are output in this method, which is
277 : : /// supposed to be called just before outputting </rPr> whenever it is done.
278 : : void InitCollectedParagraphProperties();
279 : :
280 : : /// Output what we collected during the run properties output.
281 : : ///
282 : : /// @see WriteCollectedParagrapProperties().
283 : : void WriteCollectedParagraphProperties();
284 : :
285 : : /// Initialize the structures where we are going to collect some of the run properties.
286 : : ///
287 : : /// This is an equivalent of InitCollectedParagraphProperties(), resp.
288 : : /// WriteCollectectedParagraphProperties().
289 : : ///
290 : : /// @see InitCollectedParagraphProperties().
291 : : void InitCollectedRunProperties();
292 : :
293 : : /// Output what we collected during the run properties output.
294 : : ///
295 : : /// @see InitCollectedRunProperies(), WriteCollectedParagraphProperties()
296 : : void WriteCollectedRunProperties();
297 : :
298 : : /// Output graphic fly frames.
299 : : void FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size& rSize );
300 : : void WriteOLE2Obj( const SdrObject* pSdrObj, const SwOLENode& rNode, const Size& rSize );
301 : : bool WriteOLEChart( const SdrObject* pSdrObj, const Size& rSize );
302 : : bool WriteOLEMath( const SdrObject* pSdrObj, const SwOLENode& rNode, const Size& rSize );
303 : :
304 : : void InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
305 : : void StartTable( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
306 : : void StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
307 : : void StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
308 : : void TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
309 : : void EndTableCell( );
310 : : void EndTableRow( );
311 : : void EndTable();
312 : :
313 : : /// End cell, row, and even the entire table if necessary.
314 : : void FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool bForceEmptyParagraph = false );
315 : :
316 : : void WriteFFData( const FieldInfos& rInfos );
317 : : protected:
318 : :
319 : : /// Output frames - the implementation.
320 : : virtual void OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point& rNdTopLeft );
321 : :
322 : : /// Sfx item Sfx item RES_CHRATR_CASEMAP
323 : : virtual void CharCaseMap( const SvxCaseMapItem& rCaseMap );
324 : :
325 : : /// Sfx item Sfx item RES_CHRATR_COLOR
326 : : virtual void CharColor( const SvxColorItem& rColor);
327 : :
328 : : /// Sfx item Sfx item RES_CHRATR_CONTOUR
329 : : virtual void CharContour( const SvxContourItem& rContour );
330 : :
331 : : /// Sfx item RES_CHRATR_CROSSEDOUT
332 : : virtual void CharCrossedOut( const SvxCrossedOutItem& rCrossedOut );
333 : :
334 : : /// Sfx item RES_CHRATR_ESCAPEMENT
335 : : virtual void CharEscapement( const SvxEscapementItem& rEscapement );
336 : :
337 : : /// Sfx item RES_CHRATR_FONT
338 : : virtual void CharFont( const SvxFontItem& rFont );
339 : :
340 : : /// Sfx item RES_CHRATR_FONTSIZE
341 : : virtual void CharFontSize( const SvxFontHeightItem& rFontSize );
342 : :
343 : : /// Sfx item RES_CHRATR_KERNING
344 : : virtual void CharKerning( const SvxKerningItem& rKerning );
345 : :
346 : : /// Sfx item RES_CHRATR_LANGUAGE
347 : : virtual void CharLanguage( const SvxLanguageItem& rLanguage );
348 : :
349 : : /// Sfx item RES_CHRATR_POSTURE
350 : : virtual void CharPosture( const SvxPostureItem& rPosture );
351 : :
352 : : /// Sfx item RES_CHRATR_SHADOWED
353 : : virtual void CharShadow( const SvxShadowedItem& rShadow );
354 : :
355 : : /// Sfx item RES_CHRATR_UNDERLINE
356 : : virtual void CharUnderline( const SvxUnderlineItem& rUnderline );
357 : :
358 : : /// Sfx item RES_CHRATR_WEIGHT
359 : : virtual void CharWeight( const SvxWeightItem& rWeight );
360 : :
361 : : /// Sfx item RES_CHRATR_AUTOKERN
362 : : virtual void CharAutoKern( const SvxAutoKernItem& );
363 : :
364 : : /// Sfx item RES_CHRATR_BLINK
365 : : virtual void CharAnimatedText( const SvxBlinkItem& rBlink );
366 : :
367 : : /// Sfx item RES_CHRATR_BACKGROUND
368 : : virtual void CharBackground( const SvxBrushItem& rBrush );
369 : :
370 : : /// Sfx item RES_CHRATR_CJK_FONT
371 : : virtual void CharFontCJK( const SvxFontItem& rFont );
372 : :
373 : : /// Sfx item RES_CHRATR_CJK_FONTSIZE
374 : 0 : virtual void CharFontSizeCJK( const SvxFontHeightItem& rFontSize ) { CharFontSize( rFontSize ); }
375 : :
376 : : /// Sfx item RES_CHRATR_CJK_LANGUAGE
377 : 60 : virtual void CharLanguageCJK( const SvxLanguageItem& rLanguageItem ) { CharLanguage( rLanguageItem ); }
378 : :
379 : : /// Sfx item RES_CHRATR_CJK_POSTURE
380 : : virtual void CharPostureCJK( const SvxPostureItem& rPosture );
381 : :
382 : : /// Sfx item RES_CHRATR_CJK_WEIGHT
383 : : virtual void CharWeightCJK( const SvxWeightItem& rWeight );
384 : :
385 : : /// Sfx item RES_CHRATR_CTL_FONT
386 : : virtual void CharFontCTL( const SvxFontItem& rFont );
387 : :
388 : : /// Sfx item RES_CHRATR_CTL_FONTSIZE
389 : 198 : virtual void CharFontSizeCTL( const SvxFontHeightItem& rFontSize ) { CharFontSize( rFontSize ); }
390 : :
391 : : /// Sfx item RES_CHRATR_CTL_LANGUAGE
392 : 60 : virtual void CharLanguageCTL( const SvxLanguageItem& rLanguageItem ) { CharLanguage( rLanguageItem); }
393 : :
394 : : /// Sfx item RES_CHRATR_CTL_POSTURE
395 : : virtual void CharPostureCTL( const SvxPostureItem& rWeight );
396 : :
397 : : /// Sfx item RES_CHRATR_CTL_WEIGHT
398 : : virtual void CharWeightCTL( const SvxWeightItem& rWeight );
399 : :
400 : : /// Sfx item RES_CHRATR_ROTATE
401 : : virtual void CharRotate( const SvxCharRotateItem& rRotate );
402 : :
403 : : /// Sfx item RES_CHRATR_EMPHASIS_MARK
404 : : virtual void CharEmphasisMark( const SvxEmphasisMarkItem& rEmphasisMark );
405 : :
406 : : /// Sfx item RES_CHRATR_TWO_LINES
407 : : virtual void CharTwoLines( const SvxTwoLinesItem& rTwoLines );
408 : :
409 : : /// Sfx item RES_CHRATR_SCALEW
410 : : virtual void CharScaleWidth( const SvxCharScaleWidthItem& rScaleWidth );
411 : :
412 : : /// Sfx item RES_CHRATR_RELIEF
413 : : virtual void CharRelief( const SvxCharReliefItem& rRelief);
414 : :
415 : : /// Sfx item RES_CHRATR_HIDDEN
416 : : virtual void CharHidden( const SvxCharHiddenItem& rHidden );
417 : :
418 : : /// Sfx item RES_TXTATR_INETFMT
419 : : virtual void TextINetFormat( const SwFmtINetFmt& );
420 : :
421 : : /// Sfx item RES_TXTATR_CHARFMT
422 : : virtual void TextCharFormat( const SwFmtCharFmt& );
423 : :
424 : : /// Sfx item RES_TXTATR_FTN
425 : : virtual void TextFootnote_Impl( const SwFmtFtn& );
426 : :
427 : : /// Output the footnote/endnote reference (if there's one to output).
428 : : void FootnoteEndnoteReference();
429 : :
430 : : /// Sfx item RES_PARATR_LINESPACING
431 : : virtual void ParaLineSpacing_Impl( short nSpace, short nMulti );
432 : :
433 : : /// Sfx item RES_PARATR_ADJUST
434 : : virtual void ParaAdjust( const SvxAdjustItem& rAdjust );
435 : :
436 : : /// Sfx item RES_PARATR_SPLIT
437 : : virtual void ParaSplit( const SvxFmtSplitItem& rSplit );
438 : :
439 : : /// Sfx item RES_PARATR_WIDOWS
440 : : virtual void ParaWidows( const SvxWidowsItem& rWidows );
441 : :
442 : : /// Sfx item RES_PARATR_TABSTOP
443 : : virtual void ParaTabStop( const SvxTabStopItem& rTabStop );
444 : :
445 : : /// Sfx item RES_PARATR_HYPHENZONE
446 : : virtual void ParaHyphenZone( const SvxHyphenZoneItem& );
447 : :
448 : : /// Sfx item RES_PARATR_NUMRULE
449 : : virtual void ParaNumRule_Impl( const SwTxtNode *pTxtNd, sal_Int32 nLvl, sal_Int32 nNumId );
450 : :
451 : : /// Sfx item RES_PARATR_SCRIPTSPACE
452 : : virtual void ParaScriptSpace( const SfxBoolItem& );
453 : :
454 : : /// Sfx item RES_PARATR_VERTALIGN
455 : : virtual void ParaVerticalAlign( const SvxParaVertAlignItem& rAlign );
456 : :
457 : : /// Sfx item RES_PARATR_SNAPTOGRID
458 : : virtual void ParaSnapToGrid( const SvxParaGridItem& );
459 : :
460 : : /// Sfx item RES_FRM_SIZE
461 : : virtual void FormatFrameSize( const SwFmtFrmSize& );
462 : :
463 : : /// Sfx item RES_PAPER_BIN
464 : : virtual void FormatPaperBin( const SvxPaperBinItem& );
465 : :
466 : : /// Sfx item RES_LR_SPACE
467 : : virtual void FormatLRSpace( const SvxLRSpaceItem& rLRSpace );
468 : :
469 : : /// Sfx item RES_UL_SPACE
470 : : virtual void FormatULSpace( const SvxULSpaceItem& rULSpace );
471 : :
472 : : /// Sfx item RES_SURROUND
473 : : virtual void FormatSurround( const SwFmtSurround& );
474 : :
475 : : /// Sfx item RES_VERT_ORIENT
476 : : virtual void FormatVertOrientation( const SwFmtVertOrient& );
477 : :
478 : : /// Sfx item RES_HORI_ORIENT
479 : : virtual void FormatHorizOrientation( const SwFmtHoriOrient& );
480 : :
481 : : /// Sfx item RES_ANCHOR
482 : : virtual void FormatAnchor( const SwFmtAnchor& );
483 : :
484 : : /// Sfx item RES_BACKGROUND
485 : : virtual void FormatBackground( const SvxBrushItem& );
486 : :
487 : : /// Sfx item RES_BOX
488 : : virtual void FormatBox( const SvxBoxItem& );
489 : :
490 : : /// Sfx item RES_COL
491 : : virtual void FormatColumns_Impl( sal_uInt16 nCols, const SwFmtCol & rCol, bool bEven, SwTwips nPageSize );
492 : :
493 : : /// Sfx item RES_KEEP
494 : : virtual void FormatKeep( const SvxFmtKeepItem& );
495 : :
496 : : /// Sfx item RES_TEXTGRID
497 : : virtual void FormatTextGrid( const SwTextGridItem& );
498 : :
499 : : /// Sfx item RES_LINENUMBER
500 : : virtual void FormatLineNumbering( const SwFmtLineNumber& );
501 : :
502 : : /// Sfx item RES_FRAMEDIR
503 : : virtual void FormatFrameDirection( const SvxFrameDirectionItem& );
504 : :
505 : : /// Write the expanded field
506 : : virtual void WriteExpand( const SwField* pFld );
507 : :
508 : : virtual void RefField( const SwField& rFld, const String& rRef );
509 : : virtual void HiddenField( const SwField& rFld );
510 : : virtual void SetField( const SwField& rFld, ww::eField eType, const String& rCmd );
511 : : virtual void PostitField( const SwField* pFld );
512 : : virtual bool DropdownField( const SwField* pFld );
513 : :
514 : : virtual bool AnalyzeURL( const String& rURL, const String& rTarget, String* pLinkURL, String* pMark );
515 : :
516 : : /// Reference to the export, where to get the data from
517 : : DocxExport &m_rExport;
518 : :
519 : : /// Fast serializer to output the data
520 : : ::sax_fastparser::FSHelperPtr m_pSerializer;
521 : :
522 : : /// DrawingML access
523 : : oox::drawingml::DrawingML &m_rDrawingML;
524 : :
525 : : private:
526 : :
527 : : void DoWriteBookmarks( );
528 : : void WritePostponedGraphic();
529 : : void WritePostponedMath();
530 : : void WriteCommentRanges();
531 : :
532 : : void StartField_Impl( FieldInfos& rInfos, bool bWriteRun = sal_False );
533 : : void DoWriteCmd( String& rCmd );
534 : : void CmdField_Impl( FieldInfos& rInfos );
535 : : void EndField_Impl( FieldInfos& rInfos );
536 : :
537 : : ::sax_fastparser::FastAttributeList *m_pFontsAttrList, *m_pEastAsianLayoutAttrList;
538 : : ::sax_fastparser::FastAttributeList *m_pCharLangAttrList;
539 : : ::sax_fastparser::FastAttributeList *m_pSectionSpacingAttrList;
540 : : ::sax_fastparser::FastAttributeList *m_pParagraphSpacingAttrList;
541 : : ::sax_fastparser::FastAttributeList *m_pHyperlinkAttrList;
542 : : ::sax_fastparser::FastAttributeList *m_pFlyAttrList;
543 : :
544 : : ::docx::FootnotesList *m_pFootnotesList;
545 : : ::docx::FootnotesList *m_pEndnotesList;
546 : : int m_footnoteEndnoteRefTag;
547 : :
548 : : boost::scoped_ptr< const WW8_SepInfo > m_pSectionInfo;
549 : :
550 : : /// Redline data to remember in the text run.
551 : : const SwRedlineData *m_pRedlineData;
552 : :
553 : : /// Id of the redline
554 : : sal_Int32 m_nRedlineId;
555 : :
556 : : /// Flag indicating that the section properties are being written
557 : : bool m_bOpenedSectPr;
558 : :
559 : : /// Field data to remember in the text run
560 : : std::vector< FieldInfos > m_Fields;
561 : : String m_sFieldBkm;
562 : : sal_Int32 m_nNextMarkId;
563 : :
564 : : /// Bookmarks to output
565 : : std::vector<rtl::OString> m_rMarksStart;
566 : : std::vector<rtl::OString> m_rMarksEnd;
567 : :
568 : : /// Is there a postit start to output?
569 : : bool m_bPostitStart;
570 : : /// Is there a postit end to output?
571 : : bool m_bPostitEnd;
572 : :
573 : : /// Maps of the bookmarks ids
574 : : std::map<rtl::OString, sal_uInt16> m_rOpenedMarksIds;
575 : :
576 : : /// The current table helper
577 : : SwWriteTable *m_pTableWrt;
578 : :
579 : : /// Remember if we are in an open cell, or not.
580 : : bool m_bTableCellOpen;
581 : :
582 : : /// Remember the current table depth.
583 : : sal_uInt32 m_nTableDepth;
584 : :
585 : : bool m_bParagraphOpened;
586 : :
587 : : // Remember that a column break has to be opened at the
588 : : // beginning of the next paragraph
589 : : DocxColBreakStatus m_nColBreakStatus;
590 : :
591 : : const sw::Frame *m_pParentFrame;
592 : : // close of hyperlink needed
593 : : bool m_closeHyperlinkInThisRun;
594 : : bool m_closeHyperlinkInPreviousRun;
595 : : bool m_startedHyperlink;
596 : :
597 : : struct PostponedGraphic
598 : : {
599 : 0 : PostponedGraphic( const SwGrfNode* n, Size s ) : grfNode( n ), size( s ) {};
600 : : const SwGrfNode* grfNode;
601 : : Size size;
602 : : };
603 : : std::list< PostponedGraphic >* m_postponedGraphic;
604 : : const SwOLENode* m_postponedMath;
605 : : std::vector< const SwPostItField* > m_postitFields;
606 : : unsigned int m_postitFieldsMaxId;
607 : : int m_anchorId;
608 : :
609 : : public:
610 : : DocxAttributeOutput( DocxExport &rExport, ::sax_fastparser::FSHelperPtr pSerializer, oox::drawingml::DrawingML* pDrawingML );
611 : :
612 : : virtual ~DocxAttributeOutput();
613 : :
614 : : /// Return the right export class.
615 : : virtual DocxExport& GetExport();
616 : 285 : const DocxExport& GetExport() const { return const_cast< DocxAttributeOutput* >( this )->GetExport(); }
617 : :
618 : : /// For eg. the output of the styles, we need to switch the serializer to an other one.
619 : 234 : void SetSerializer( ::sax_fastparser::FSHelperPtr pSerializer ) { m_pSerializer = pSerializer; }
620 : :
621 : : /// Occasionnaly need to use this serializer from the outside
622 : 0 : ::sax_fastparser::FSHelperPtr GetSerializer( ) { return m_pSerializer; }
623 : :
624 : : /// Do we have any footnotes?
625 : : bool HasFootnotes() const;
626 : :
627 : : /// Do we have any endnotes?
628 : : bool HasEndnotes() const;
629 : :
630 : : /// Output the content of the footnotes.xml resp. endnotes.xml
631 : : void FootnotesEndnotes( bool bFootnotes );
632 : :
633 : : /// writes the footnotePr/endnotePr (depending on tag) section
634 : : void WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr fs, int tag, const SwEndNoteInfo& info, int listtag );
635 : :
636 : : bool HasPostitFields() const;
637 : : void WritePostitFields();
638 : :
639 : : /// VMLTextExport
640 : : virtual void WriteOutliner(const OutlinerParaObject& rParaObj);
641 : : virtual oox::drawingml::DrawingML& GetDrawingML();
642 : : };
643 : :
644 : : #endif // _DOCXATTRIBUTEOUTPUT_HXX_
645 : :
646 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|