merge the formfield patch from ooo-build
[ooovba.git] / sw / source / filter / ww8 / ww8attributeoutput.hxx
blob608dfc17d2193f83a69f5812fa2b95ca8ad65518
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile$
10 * $Revision$
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _WW8ATTRIBUTEOUTPUT_HXX_
32 #define _WW8ATTRIBUTEOUTPUT_HXX_
34 #include "attributeoutputbase.hxx"
35 #include "wrtww8.hxx"
37 class WW8AttributeOutput : public AttributeOutputBase
39 public:
40 /// Export the state of RTL/CJK.
41 virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript );
43 /// Start of the paragraph.
44 virtual void StartParagraph( ww8::WW8TableNodeInfo::Pointer_t /*pTextNodeInfo*/ ) {}
46 /// End of the paragraph.
47 virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner );
49 /// Called before we start outputting the attributes.
50 virtual void StartParagraphProperties( const SwTxtNode& /*rNode*/ ) {}
52 /// Called after we end outputting the attributes.
53 virtual void EndParagraphProperties() {}
55 /// Empty paragraph.
56 virtual void EmptyParagraph();
58 /// Start of the text run.
59 ///
60 /// No-op for binary filters.
61 virtual void StartRun( const SwRedlineData* /*pRedlineData*/ ) {}
63 /// End of the text run.
64 ///
65 /// No-op for binary filters.
66 virtual void EndRun() {}
68 /// Before we start outputting the attributes.
69 virtual void StartRunProperties();
71 /// After we end outputting the attributes.
72 virtual void EndRunProperties( const SwRedlineData* pRedlineData );
74 /// Output text.
75 virtual void RunText( const String& rText, rtl_TextEncoding eCharSet );
77 /// Output text (without markup).
78 virtual void RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet );
80 /// Output ruby start.
81 virtual void StartRuby( const SwTxtNode& rNode, const SwFmtRuby& rRuby );
83 /// Output ruby end.
84 virtual void EndRuby();
86 /// Output URL start.
87 virtual bool StartURL( const String &rUrl, const String &rTarget );
89 /// Output URL end.
90 virtual bool EndURL();
92 virtual void FieldVanish( const String& rTxt, ww::eField eType );
94 /// Output redlining.
95 virtual void Redline( const SwRedlineData* pRedline );
97 virtual void FormatDrop( const SwTxtNode& rNode, const SwFmtDrop &rSwFmtDrop, USHORT nStyle, ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner );
99 /// Output FKP (Formatted disK Page) - necessary for binary formats only.
100 /// FIXME having it in AttributeOutputBase is probably a hack, it
101 /// should be in WW8AttributeOutput only...
102 virtual void OutputFKP();
104 /// Output style.
105 virtual void ParagraphStyle( USHORT nStyle );
107 virtual void TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo );
109 virtual void TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo );
111 virtual void TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo );
113 virtual void TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo );
115 virtual void TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo );
117 virtual void TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo );
119 virtual void TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo );
121 virtual void TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo );
123 virtual void TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo );
125 virtual void TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t pNodeInfo );
127 virtual void TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner );
129 virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
131 virtual void TableRowEnd( sal_uInt32 nDepth = 1 );
133 /// Start of the styles table.
134 virtual void StartStyles();
136 /// End of the styles table.
137 virtual void EndStyles( USHORT nNumberOfStyles );
139 /// Write default style.
140 virtual void DefaultStyle( USHORT nStyle );
142 /// Start of a style in the styles table.
143 virtual void StartStyle( const String& rName, bool bPapFmt,
144 USHORT nBase, USHORT nNext, USHORT nWwIdi, USHORT nId );
146 /// End of a style in the styles table.
147 virtual void EndStyle();
149 /// Start of (paragraph or run) properties of a style.
150 virtual void StartStyleProperties( bool bParProp, USHORT nStyle );
152 /// End of (paragraph or run) properties of a style.
153 virtual void EndStyleProperties( bool bParProp );
155 /// Numbering rule and Id.
156 virtual void OutlineNumbering( BYTE nLvl, const SwNumFmt &rNFmt, const SwFmt &rFmt );
158 /// Page break
159 /// As a paragraph property - the paragraph should be on the next page.
160 virtual void PageBreakBefore( bool bBreak );
162 /// Write a section break
163 /// msword::ColumnBreak or msword::PageBreak
164 virtual void SectionBreak( BYTE nC, const WW8_SepInfo* pSectionInfo = NULL );
166 /// Start of the section properties.
167 virtual void StartSection();
169 /// End of the section properties.
171 /// No-op for binary filters.
172 virtual void EndSection() {}
174 /// Protection of forms.
175 virtual void SectionFormProtection( bool bProtected );
177 /// Numbering of the lines in the document.
178 virtual void SectionLineNumbering( ULONG nRestartNo, const SwLineNumberInfo& rLnNumInfo );
180 /// Has different headers/footers for the title page.
181 virtual void SectionTitlePage();
183 /// Description of the page borders.
184 virtual void SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmFmt* pFirstPageFmt );
186 /// Columns populated from right/numbers on the right side?
187 virtual void SectionBiDi( bool bBiDi );
189 /// The style of the page numbers.
191 /// nPageRestartNumberr being 0 means no restart.
192 virtual void SectionPageNumbering( USHORT nNumType, USHORT nPageRestartNumber );
194 /// The type of breaking.
195 virtual void SectionType( BYTE nBreakCode );
197 /// Special header/footer flags, needed for old versions only.
198 virtual void SectionWW6HeaderFooterFlags( BYTE nHeadFootFlags );
200 /// Definition of a numbering instance.
201 virtual void NumberingDefinition( USHORT nId, const SwNumRule &rRule );
203 /// All the numbering level information.
204 virtual void NumberingLevel( BYTE nLevel,
205 USHORT nStart,
206 USHORT nNumberingType,
207 SvxAdjust eAdjust,
208 const BYTE *pNumLvlPos,
209 BYTE nFollow,
210 const wwFont *pFont,
211 const SfxItemSet *pOutSet,
212 sal_Int16 nIndentAt,
213 sal_Int16 nFirstLineIndex,
214 sal_Int16 nListTabPos,
215 const String &rNumberingString );
217 protected:
218 /// Output frames - the implementation.
219 void OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point& rNdTopLeft );
221 /// Sfx item Sfx item RES_CHRATR_CASEMAP
222 virtual void CharCaseMap( const SvxCaseMapItem& );
224 /// Sfx item Sfx item RES_CHRATR_COLOR
225 virtual void CharColor( const SvxColorItem& );
227 /// Sfx item Sfx item RES_CHRATR_CONTOUR
228 virtual void CharContour( const SvxContourItem& );
230 /// Sfx item RES_CHRATR_CROSSEDOUT
231 virtual void CharCrossedOut( const SvxCrossedOutItem& rHt );
233 /// Sfx item RES_CHRATR_ESCAPEMENT
234 virtual void CharEscapement( const SvxEscapementItem& );
236 /// Sfx item RES_CHRATR_FONT
237 virtual void CharFont( const SvxFontItem& );
239 /// Sfx item RES_CHRATR_FONTSIZE
240 virtual void CharFontSize( const SvxFontHeightItem& );
242 /// Sfx item RES_CHRATR_KERNING
243 virtual void CharKerning( const SvxKerningItem& );
245 /// Sfx item RES_CHRATR_LANGUAGE
246 virtual void CharLanguage( const SvxLanguageItem& );
248 /// Sfx item RES_CHRATR_POSTURE
249 virtual void CharPosture( const SvxPostureItem& );
251 /// Sfx item RES_CHRATR_SHADOWED
252 virtual void CharShadow( const SvxShadowedItem& );
254 /// Sfx item RES_CHRATR_UNDERLINE
255 virtual void CharUnderline( const SvxUnderlineItem& );
257 /// Sfx item RES_CHRATR_WEIGHT
258 virtual void CharWeight( const SvxWeightItem& );
260 /// Sfx item RES_CHRATR_AUTOKERN
261 virtual void CharAutoKern( const SvxAutoKernItem& );
263 /// Sfx item RES_CHRATR_BLINK
264 virtual void CharAnimatedText( const SvxBlinkItem& );
266 /// Sfx item RES_CHRATR_BACKGROUND
267 virtual void CharBackground( const SvxBrushItem& );
269 /// Sfx item RES_CHRATR_CJK_FONT
270 virtual void CharFontCJK( const SvxFontItem& );
272 /// Sfx item RES_CHRATR_CJK_FONTSIZE
273 virtual void CharFontSizeCJK( const SvxFontHeightItem& rHt ) { CharFontSize( rHt ); }
275 /// Sfx item RES_CHRATR_CJK_LANGUAGE
276 virtual void CharLanguageCJK( const SvxLanguageItem& rHt ) { CharLanguage( rHt ); }
278 /// Sfx item RES_CHRATR_CJK_POSTURE
279 virtual void CharPostureCJK( const SvxPostureItem& rHt ) { CharPosture( rHt ); }
281 /// Sfx item RES_CHRATR_CJK_WEIGHT
282 virtual void CharWeightCJK( const SvxWeightItem& rHt ) { CharWeight( rHt ); }
284 /// Sfx item RES_CHRATR_CTL_FONT
285 virtual void CharFontCTL( const SvxFontItem& );
287 /// Sfx item RES_CHRATR_CTL_FONTSIZE
288 virtual void CharFontSizeCTL( const SvxFontHeightItem& rHt ) { CharFontSize( rHt ); }
290 /// Sfx item RES_CHRATR_CTL_LANGUAGE
291 virtual void CharLanguageCTL( const SvxLanguageItem& rHt ) { CharLanguage( rHt ); }
293 /// Sfx item RES_CHRATR_CTL_POSTURE
294 virtual void CharPostureCTL( const SvxPostureItem& );
296 /// Sfx item RES_CHRATR_CTL_WEIGHT
297 virtual void CharWeightCTL( const SvxWeightItem& );
299 /// Sfx item RES_CHRATR_ROTATE
300 virtual void CharRotate( const SvxCharRotateItem& );
302 /// Sfx item RES_CHRATR_EMPHASIS_MARK
303 virtual void CharEmphasisMark( const SvxEmphasisMarkItem& rHt );
305 /// Sfx item RES_CHRATR_TWO_LINES
306 virtual void CharTwoLines( const SvxTwoLinesItem& );
308 /// Sfx item RES_CHRATR_SCALEW
309 virtual void CharScaleWidth( const SvxCharScaleWidthItem& );
311 /// Sfx item RES_CHRATR_RELIEF
312 virtual void CharRelief( const SvxCharReliefItem& );
314 /// Sfx item RES_CHRATR_HIDDEN
315 virtual void CharHidden( const SvxCharHiddenItem& );
317 /// Sfx item RES_TXTATR_INETFMT
318 virtual void TextINetFormat( const SwFmtINetFmt& );
320 /// Sfx item RES_TXTATR_CHARFMT
321 virtual void TextCharFormat( const SwFmtCharFmt& );
323 /// Sfx item RES_TXTATR_FTN
324 virtual void TextFootnote_Impl( const SwFmtFtn& );
326 /// Sfx item RES_PARATR_LINESPACING
327 virtual void ParaLineSpacing_Impl( short nSpace, short nMulti );
329 /// Sfx item RES_PARATR_ADJUST
330 virtual void ParaAdjust( const SvxAdjustItem& rHt );
332 /// Sfx item RES_PARATR_SPLIT
333 virtual void ParaSplit( const SvxFmtSplitItem& );
335 /// Sfx item RES_PARATR_WIDOWS
336 virtual void ParaWidows( const SvxWidowsItem& rHt );
338 /// Sfx item RES_PARATR_TABSTOP
339 virtual void ParaTabStop( const SvxTabStopItem& rHt );
341 /// Sfx item RES_PARATR_HYPHENZONE
342 virtual void ParaHyphenZone( const SvxHyphenZoneItem& );
344 /// Sfx item RES_PARATR_NUMRULE
345 virtual void ParaNumRule_Impl( const SwTxtNode *pTxtNd, sal_Int32 nLvl, sal_Int32 nNumId );
347 /// Sfx item RES_PARATR_SCRIPTSPACE
348 virtual void ParaScriptSpace( const SfxBoolItem& );
350 /// Sfx item RES_PARATR_VERTALIGN
351 virtual void ParaVerticalAlign( const SvxParaVertAlignItem& );
353 /// Sfx item RES_PARATR_SNAPTOGRID
354 virtual void ParaSnapToGrid( const SvxParaGridItem& );
356 /// Sfx item RES_FRM_SIZE
357 virtual void FormatFrameSize( const SwFmtFrmSize& );
359 /// Sfx item RES_PAPER_BIN
360 virtual void FormatPaperBin( const SvxPaperBinItem& );
362 /// Sfx item RES_LR_SPACE
363 virtual void FormatLRSpace( const SvxLRSpaceItem& );
365 /// Sfx item RES_UL_SPACE
366 virtual void FormatULSpace( const SvxULSpaceItem& rHt );
368 /// Sfx item RES_SURROUND
369 virtual void FormatSurround( const SwFmtSurround& );
371 /// Sfx item RES_VERT_ORIENT
372 virtual void FormatVertOrientation( const SwFmtVertOrient& );
374 /// Sfx item RES_HORI_ORIENT
375 virtual void FormatHorizOrientation( const SwFmtHoriOrient& );
377 /// Sfx item RES_ANCHOR
378 virtual void FormatAnchor( const SwFmtAnchor& );
380 /// Sfx item RES_BACKGROUND
381 virtual void FormatBackground( const SvxBrushItem& );
383 /// Sfx item RES_BOX
384 virtual void FormatBox( const SvxBoxItem& );
386 /// Sfx item RES_COL
387 virtual void FormatColumns_Impl( USHORT nCols, const SwFmtCol & rCol, bool bEven, SwTwips nPageSize );
389 /// Sfx item RES_KEEP
390 virtual void FormatKeep( const SvxFmtKeepItem& );
392 /// Sfx item RES_TEXTGRID
393 virtual void FormatTextGrid( const SwTextGridItem& );
395 /// Sfx item RES_LINENUMBER
396 virtual void FormatLineNumbering( const SwFmtLineNumber& );
398 /// Sfx item RES_FRAMEDIR
399 virtual void FormatFrameDirection( const SvxFrameDirectionItem& );
401 /// Write the expanded field
402 virtual void WriteExpand( const SwField* pFld );
404 virtual void RefField ( const SwField& rFld, const String& rRef );
405 virtual void HiddenField( const SwField& rFld );
406 virtual void SetField( const SwField& rFld, ww::eField eType, const String& rCmd );
407 virtual void PostitField( const SwField* pFld );
408 virtual bool DropdownField( const SwField* pFld );
410 virtual bool AnalyzeURL( const String& rURL, const String& rTarget, String* pLinkURL, String* pMark );
412 /// Reference to the export, where to get the data from
413 WW8Export &m_rWW8Export;
415 /// For output of styles.
417 /// We have to remember these positions between the StartStyle() and
418 /// EndStyle().
419 USHORT nPOPosStdLen1, nPOPosStdLen2;
421 /// For output of styles.
423 /// We have to remember this position between StartStyleProperties() and
424 /// EndStyleProperties().
425 USHORT m_nStyleStartSize, m_nStyleLenPos;
427 /// For output of styles.
429 /// Used between StartStyles() and EndStyles().
430 ULONG m_nStyAnzPos;
432 /// For output of run properties.
434 /// We have to remember the number of field results, and do not export end
435 /// of the field results if we were forced to split text.
436 USHORT m_nFieldResults;
438 public:
439 WW8AttributeOutput( WW8Export &rWW8Export ) : AttributeOutputBase(), m_rWW8Export( rWW8Export ) {}
440 virtual ~WW8AttributeOutput() {}
442 /// Return the right export class.
443 virtual MSWordExportBase& GetExport() { return m_rWW8Export; }
445 protected:
446 /// Output the bold etc. attributes
447 void OutputWW8Attribute( BYTE nId, bool bVal );
449 /// Output the bold etc. attributes, the Complex Text Layout version
450 void OutputWW8AttributeCTL( BYTE nId, bool bVal );
454 #endif // _WW8ATTRIBUTEOUTPUT_HXX_
456 /* vi:set tabstop=4 shiftwidth=4 expandtab: */