1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 _WW8ATTRIBUTEOUTPUT_HXX_
21 #define _WW8ATTRIBUTEOUTPUT_HXX_
23 #include "attributeoutputbase.hxx"
26 class WW8AttributeOutput
: public AttributeOutputBase
29 /// Export the state of RTL/CJK.
30 virtual void RTLAndCJKState( bool bIsRTL
, sal_uInt16 nScript
);
32 /// Start of the paragraph.
33 virtual void StartParagraph( ww8::WW8TableNodeInfo::Pointer_t
/*pTextNodeInfo*/ ) {}
35 /// End of the paragraph.
36 virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner
);
38 /// Called before we start outputting the attributes.
39 virtual void StartParagraphProperties( const SwTxtNode
& /*rNode*/ ) {}
41 /// Called after we end outputting the attributes.
42 virtual void EndParagraphProperties() {}
45 virtual void EmptyParagraph();
47 /// Start of the text run.
49 virtual void StartRun( const SwRedlineData
* pRedlineData
, bool bSingleEmptyRun
= false );
51 /// End of the text run.
53 /// No-op for binary filters.
54 virtual void EndRun() {}
56 /// Before we start outputting the attributes.
57 virtual void StartRunProperties();
59 /// After we end outputting the attributes.
60 virtual void EndRunProperties( const SwRedlineData
* pRedlineData
);
63 virtual void RunText( const String
& rText
, rtl_TextEncoding eCharSet
);
65 /// Output text (without markup).
66 virtual void RawText( const String
& rText
, bool bForceUnicode
, rtl_TextEncoding eCharSet
);
68 /// Output ruby start.
69 virtual void StartRuby( const SwTxtNode
& rNode
, xub_StrLen nPos
, const SwFmtRuby
& rRuby
);
72 virtual void EndRuby();
75 virtual bool StartURL( const String
&rUrl
, const String
&rTarget
);
78 virtual bool EndURL();
80 virtual void FieldVanish( const String
& rTxt
, ww::eField eType
);
83 virtual void Redline( const SwRedlineData
* pRedline
);
85 virtual void FormatDrop( const SwTxtNode
& rNode
, const SwFmtDrop
&rSwFmtDrop
, sal_uInt16 nStyle
, ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo
, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner
);
87 /// Output FKP (Formatted disK Page) - necessary for binary formats only.
88 /// FIXME having it in AttributeOutputBase is probably a hack, it
89 /// should be in WW8AttributeOutput only...
90 virtual void OutputFKP();
93 virtual void ParagraphStyle( sal_uInt16 nStyle
);
95 virtual void TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo
);
96 virtual void TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo
);
97 virtual void TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo
);
98 virtual void TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo
);
99 virtual void TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo
);
100 virtual void TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo
);
101 virtual void TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo
);
102 virtual void TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo
);
103 virtual void TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo
);
104 virtual void TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t pNodeInfo
);
105 virtual void TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner
);
106 virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner
);
107 virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner
);
108 virtual void TableRowEnd( sal_uInt32 nDepth
= 1 );
110 /// Start of the styles table.
111 virtual void StartStyles();
113 /// End of the styles table.
114 virtual void EndStyles( sal_uInt16 nNumberOfStyles
);
116 /// Write default style.
117 virtual void DefaultStyle( sal_uInt16 nStyle
);
119 /// Start of a style in the styles table.
120 virtual void StartStyle( const String
& rName
, bool bPapFmt
,
121 sal_uInt16 nBase
, sal_uInt16 nNext
, sal_uInt16 nWwIdi
, sal_uInt16 nId
,
124 /// End of a style in the styles table.
125 virtual void EndStyle();
127 /// Start of (paragraph or run) properties of a style.
128 virtual void StartStyleProperties( bool bParProp
, sal_uInt16 nStyle
);
130 /// End of (paragraph or run) properties of a style.
131 virtual void EndStyleProperties( bool bParProp
);
133 /// Numbering rule and Id.
134 virtual void OutlineNumbering( sal_uInt8 nLvl
, const SwNumFmt
&rNFmt
, const SwFmt
&rFmt
);
137 /// As a paragraph property - the paragraph should be on the next page.
138 virtual void PageBreakBefore( bool bBreak
);
140 /// Write a section break
141 /// msword::ColumnBreak or msword::PageBreak
142 virtual void SectionBreak( sal_uInt8 nC
, const WW8_SepInfo
* pSectionInfo
= NULL
);
144 /// Start of the section properties.
145 virtual void StartSection();
147 /// End of the section properties.
149 /// No-op for binary filters.
150 virtual void EndSection() {}
152 /// Protection of forms.
153 virtual void SectionFormProtection( bool bProtected
);
155 /// Numbering of the lines in the document.
156 virtual void SectionLineNumbering( sal_uLong nRestartNo
, const SwLineNumberInfo
& rLnNumInfo
);
158 /// Has different headers/footers for the title page.
159 virtual void SectionTitlePage();
161 /// Description of the page borders.
162 virtual void SectionPageBorders( const SwFrmFmt
* pFmt
, const SwFrmFmt
* pFirstPageFmt
);
164 /// Columns populated from right/numbers on the right side?
165 virtual void SectionBiDi( bool bBiDi
);
167 /// The style of the page numbers.
169 /// nPageRestartNumberr being 0 means no restart.
170 virtual void SectionPageNumbering( sal_uInt16 nNumType
, sal_uInt16 nPageRestartNumber
);
172 /// The type of breaking.
173 virtual void SectionType( sal_uInt8 nBreakCode
);
175 /// Special header/footer flags, needed for old versions only.
176 virtual void SectionWW6HeaderFooterFlags( sal_uInt8 nHeadFootFlags
);
178 /// Definition of a numbering instance.
179 virtual void NumberingDefinition( sal_uInt16 nId
, const SwNumRule
&rRule
);
181 /// All the numbering level information.
182 virtual void NumberingLevel( sal_uInt8 nLevel
,
184 sal_uInt16 nNumberingType
,
186 const sal_uInt8
*pNumLvlPos
,
189 const SfxItemSet
*pOutSet
,
191 sal_Int16 nFirstLineIndex
,
192 sal_Int16 nListTabPos
,
193 const String
&rNumberingString
,
194 const SvxBrushItem
* pBrush
= 0); //For i120928,transfer graphic of bullet
197 /// Output frames - the implementation.
198 void OutputFlyFrame_Impl( const sw::Frame
& rFmt
, const Point
& rNdTopLeft
);
200 /// Sfx item Sfx item RES_CHRATR_CASEMAP
201 virtual void CharCaseMap( const SvxCaseMapItem
& );
203 /// Sfx item Sfx item RES_CHRATR_COLOR
204 virtual void CharColor( const SvxColorItem
& );
206 /// Sfx item Sfx item RES_CHRATR_CONTOUR
207 virtual void CharContour( const SvxContourItem
& );
209 /// Sfx item RES_CHRATR_CROSSEDOUT
210 virtual void CharCrossedOut( const SvxCrossedOutItem
& rHt
);
212 /// Sfx item RES_CHRATR_ESCAPEMENT
213 virtual void CharEscapement( const SvxEscapementItem
& );
215 /// Sfx item RES_CHRATR_FONT
216 virtual void CharFont( const SvxFontItem
& );
218 /// Sfx item RES_CHRATR_FONTSIZE
219 virtual void CharFontSize( const SvxFontHeightItem
& );
221 /// Sfx item RES_CHRATR_KERNING
222 virtual void CharKerning( const SvxKerningItem
& );
224 /// Sfx item RES_CHRATR_LANGUAGE
225 virtual void CharLanguage( const SvxLanguageItem
& );
227 /// Sfx item RES_CHRATR_POSTURE
228 virtual void CharPosture( const SvxPostureItem
& );
230 /// Sfx item RES_CHRATR_SHADOWED
231 virtual void CharShadow( const SvxShadowedItem
& );
233 /// Sfx item RES_CHRATR_UNDERLINE
234 virtual void CharUnderline( const SvxUnderlineItem
& );
236 /// Sfx item RES_CHRATR_WEIGHT
237 virtual void CharWeight( const SvxWeightItem
& );
239 /// Sfx item RES_CHRATR_AUTOKERN
240 virtual void CharAutoKern( const SvxAutoKernItem
& );
242 /// Sfx item RES_CHRATR_BLINK
243 virtual void CharAnimatedText( const SvxBlinkItem
& );
245 /// Sfx item RES_CHRATR_BACKGROUND
246 virtual void CharBackground( const SvxBrushItem
& );
248 /// Sfx item RES_CHRATR_CJK_FONT
249 virtual void CharFontCJK( const SvxFontItem
& );
251 /// Sfx item RES_CHRATR_CJK_FONTSIZE
252 virtual void CharFontSizeCJK( const SvxFontHeightItem
& rHt
) { CharFontSize( rHt
); }
254 /// Sfx item RES_CHRATR_CJK_LANGUAGE
255 virtual void CharLanguageCJK( const SvxLanguageItem
& rHt
) { CharLanguage( rHt
); }
257 /// Sfx item RES_CHRATR_CJK_POSTURE
258 virtual void CharPostureCJK( const SvxPostureItem
& rHt
) { CharPosture( rHt
); }
260 /// Sfx item RES_CHRATR_CJK_WEIGHT
261 virtual void CharWeightCJK( const SvxWeightItem
& rHt
) { CharWeight( rHt
); }
263 /// Sfx item RES_CHRATR_CTL_FONT
264 virtual void CharFontCTL( const SvxFontItem
& );
266 /// Sfx item RES_CHRATR_CTL_FONTSIZE
267 virtual void CharFontSizeCTL( const SvxFontHeightItem
& rHt
) { CharFontSize( rHt
); }
269 /// Sfx item RES_CHRATR_CTL_LANGUAGE
270 virtual void CharLanguageCTL( const SvxLanguageItem
& rHt
) { CharLanguage( rHt
); }
272 /// Sfx item RES_CHRATR_CTL_POSTURE
273 virtual void CharPostureCTL( const SvxPostureItem
& );
275 /// Sfx item RES_CHRATR_CTL_WEIGHT
276 virtual void CharWeightCTL( const SvxWeightItem
& );
278 /// Sfx item RES_CHRATR_ROTATE
279 virtual void CharRotate( const SvxCharRotateItem
& );
281 /// Sfx item RES_CHRATR_EMPHASIS_MARK
282 virtual void CharEmphasisMark( const SvxEmphasisMarkItem
& rHt
);
284 /// Sfx item RES_CHRATR_TWO_LINES
285 virtual void CharTwoLines( const SvxTwoLinesItem
& );
287 /// Sfx item RES_CHRATR_SCALEW
288 virtual void CharScaleWidth( const SvxCharScaleWidthItem
& );
290 /// Sfx item RES_CHRATR_RELIEF
291 virtual void CharRelief( const SvxCharReliefItem
& );
293 /// Sfx item RES_CHRATR_HIDDEN
294 virtual void CharHidden( const SvxCharHiddenItem
& );
296 /// Sfx item RES_TXTATR_INETFMT
297 virtual void TextINetFormat( const SwFmtINetFmt
& );
299 /// Sfx item RES_TXTATR_CHARFMT
300 virtual void TextCharFormat( const SwFmtCharFmt
& );
302 /// Sfx item RES_TXTATR_FTN
303 virtual void TextFootnote_Impl( const SwFmtFtn
& );
305 /// Sfx item RES_PARATR_LINESPACING
306 virtual void ParaLineSpacing_Impl( short nSpace
, short nMulti
);
308 /// Sfx item RES_PARATR_ADJUST
309 virtual void ParaAdjust( const SvxAdjustItem
& rHt
);
311 /// Sfx item RES_PARATR_SPLIT
312 virtual void ParaSplit( const SvxFmtSplitItem
& );
314 /// Sfx item RES_PARATR_WIDOWS
315 virtual void ParaWidows( const SvxWidowsItem
& rHt
);
317 /// Sfx item RES_PARATR_TABSTOP
318 virtual void ParaTabStop( const SvxTabStopItem
& rHt
);
320 /// Sfx item RES_PARATR_HYPHENZONE
321 virtual void ParaHyphenZone( const SvxHyphenZoneItem
& );
323 /// Sfx item RES_PARATR_NUMRULE
324 virtual void ParaNumRule_Impl( const SwTxtNode
*pTxtNd
, sal_Int32 nLvl
, sal_Int32 nNumId
);
326 /// Sfx item RES_PARATR_SCRIPTSPACE
327 virtual void ParaScriptSpace( const SfxBoolItem
& );
329 /// Sfx item RES_PARATR_VERTALIGN
330 virtual void ParaVerticalAlign( const SvxParaVertAlignItem
& );
332 /// Sfx item RES_PARATR_SNAPTOGRID
333 virtual void ParaSnapToGrid( const SvxParaGridItem
& );
335 /// Sfx item RES_FRM_SIZE
336 virtual void FormatFrameSize( const SwFmtFrmSize
& );
338 /// Sfx item RES_PAPER_BIN
339 virtual void FormatPaperBin( const SvxPaperBinItem
& );
341 /// Sfx item RES_LR_SPACE
342 virtual void FormatLRSpace( const SvxLRSpaceItem
& );
344 /// Sfx item RES_UL_SPACE
345 virtual void FormatULSpace( const SvxULSpaceItem
& rHt
);
347 /// Sfx item RES_SURROUND
348 virtual void FormatSurround( const SwFmtSurround
& );
350 /// Sfx item RES_VERT_ORIENT
351 virtual void FormatVertOrientation( const SwFmtVertOrient
& );
353 /// Sfx item RES_HORI_ORIENT
354 virtual void FormatHorizOrientation( const SwFmtHoriOrient
& );
356 /// Sfx item RES_ANCHOR
357 virtual void FormatAnchor( const SwFmtAnchor
& );
359 /// Sfx item RES_BACKGROUND
360 virtual void FormatBackground( const SvxBrushItem
& );
362 /// Sfx item RES_FILL_STYLE
363 virtual void FormatFillStyle( const XFillStyleItem
& );
365 /// Sfx item RES_FILL_GRADIENT
366 virtual void FormatFillGradient( const XFillGradientItem
& );
369 virtual void FormatBox( const SvxBoxItem
& );
372 virtual void FormatColumns_Impl( sal_uInt16 nCols
, const SwFmtCol
& rCol
, bool bEven
, SwTwips nPageSize
);
374 /// Sfx item RES_KEEP
375 virtual void FormatKeep( const SvxFmtKeepItem
& );
377 /// Sfx item RES_TEXTGRID
378 virtual void FormatTextGrid( const SwTextGridItem
& );
380 /// Sfx item RES_LINENUMBER
381 virtual void FormatLineNumbering( const SwFmtLineNumber
& );
383 /// Sfx item RES_FRAMEDIR
384 virtual void FormatFrameDirection( const SvxFrameDirectionItem
& );
386 /// Write the expanded field
387 virtual void WriteExpand( const SwField
* pFld
);
389 virtual void RefField ( const SwField
& rFld
, const String
& rRef
);
390 virtual void HiddenField( const SwField
& rFld
);
391 virtual void SetField( const SwField
& rFld
, ww::eField eType
, const String
& rCmd
);
392 virtual void PostitField( const SwField
* pFld
);
393 virtual bool DropdownField( const SwField
* pFld
);
394 virtual bool PlaceholderField( const SwField
* pFld
);
396 virtual void WritePostitFieldStart();
398 virtual bool AnalyzeURL( const String
& rURL
, const String
& rTarget
, String
* pLinkURL
, String
* pMark
);
400 /// Reference to the export, where to get the data from
401 WW8Export
&m_rWW8Export
;
403 /// For output of styles.
405 /// We have to remember these positions between the StartStyle() and
407 sal_uInt16 nPOPosStdLen1
, nPOPosStdLen2
;
409 /// For output of styles.
411 /// We have to remember this position between StartStyleProperties() and
412 /// EndStyleProperties().
413 sal_uInt16 m_nStyleStartSize
, m_nStyleLenPos
;
415 /// For output of styles.
417 /// Used between StartStyles() and EndStyles().
418 sal_uLong m_nStyAnzPos
;
420 /// For output of run properties.
422 /// We have to remember the number of field results, and do not export end
423 /// of the field results if we were forced to split text.
424 sal_uInt16 m_nFieldResults
;
427 WW8AttributeOutput( WW8Export
&rWW8Export
) : AttributeOutputBase(), m_rWW8Export( rWW8Export
) {}
428 virtual ~WW8AttributeOutput() {}
430 /// Return the right export class.
431 virtual WW8Export
& GetExport() { return m_rWW8Export
; }
432 const WW8Export
& GetExport() const { return m_rWW8Export
; }
435 /// Output the bold etc. attributes
436 void OutputWW8Attribute( sal_uInt8 nId
, bool bVal
);
438 /// Output the bold etc. attributes, the Complex Text Layout version
439 void OutputWW8AttributeCTL( sal_uInt8 nId
, bool bVal
);
443 #endif // _WW8ATTRIBUTEOUTPUT_HXX_
445 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */