Update ooo320-m1
[ooovba.git] / sw / source / filter / html / wrthtml.hxx
blob477dd11dd562d3780a595b754c22cc8c55d81d44
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: wrthtml.hxx,v $
10 * $Revision: 1.18 $
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 ************************************************************************/
30 #ifndef _WRTHTML_HXX
31 #define _WRTHTML_HXX
34 #include <com/sun/star/container/XIndexContainer.hpp>
35 #include <com/sun/star/form/XForm.hpp>
36 #include <vcl/field.hxx>
37 #define _SVSTDARR_STRINGSDTOR
38 #define _SVSTDARR_STRINGSSORTDTOR
39 #define _SVSTDARR_ULONGS
40 #include <svtools/svstdarr.hxx>
41 #include <i18npool/lang.h>
42 #include <tools/stream.hxx>
44 #include "shellio.hxx"
45 #include "wrt_fn.hxx"
47 // einige Forward Deklarationen
48 class Color;
49 class SwFrmFmt;
50 class SwFlyFrmFmt;
51 class SwDrawFrmFmt;
52 class SwFmtINetFmt;
53 class SwFmtVertOrient;
54 class SwFmtFtn;
55 class SwStartNode;
56 class SwTableNode;
57 class SwPageDesc;
58 class SwNodeIndex;
59 class ImageMap;
60 class SwNumRule;
61 class SdrObject;
62 class SvxBrushItem;
63 class SvxFontItem;
64 class SwHTMLNumRuleInfo;
65 class SwHTMLPosFlyFrms;
66 class SwHTMLTxtFtns;
68 extern SwAttrFnTab aHTMLAttrFnTab;
70 //#define HTML_PARSPACE ((MM50 * 7) / 10)
71 #define HTML_PARSPACE (MM50)
73 // Flags fuer die Ausgabe von Rahmen aller Art
74 // BORDER geht nur bei OutHTML_Image
75 // ANYSIZE gibt an, ob auch VAR_SIZE und MIN_SIZE angaben exportiert werden
76 // ABSSIZE gibt an, ob Abstand und Umrandung ignoriert werden sollen
77 const sal_uInt32 HTML_FRMOPT_ALIGN = 1<<0;
78 const sal_uInt32 HTML_FRMOPT_S_ALIGN = 1<<1;
80 const sal_uInt32 HTML_FRMOPT_WIDTH = 1<<2;
81 const sal_uInt32 HTML_FRMOPT_HEIGHT = 1<<3;
82 const sal_uInt32 HTML_FRMOPT_SIZE = HTML_FRMOPT_WIDTH|HTML_FRMOPT_HEIGHT;
83 const sal_uInt32 HTML_FRMOPT_S_WIDTH = 1<<4;
84 const sal_uInt32 HTML_FRMOPT_S_HEIGHT = 1<<5;
85 const sal_uInt32 HTML_FRMOPT_S_SIZE = HTML_FRMOPT_S_WIDTH|HTML_FRMOPT_S_HEIGHT;
86 const sal_uInt32 HTML_FRMOPT_ANYSIZE = 1<<6;
87 const sal_uInt32 HTML_FRMOPT_ABSSIZE = 1<<7;
88 const sal_uInt32 HTML_FRMOPT_MARGINSIZE = 1<<8;
90 const sal_uInt32 HTML_FRMOPT_SPACE = 1<<9;
91 const sal_uInt32 HTML_FRMOPT_S_SPACE = 1<<10;
93 const sal_uInt32 HTML_FRMOPT_BORDER = 1<<11;
94 const sal_uInt32 HTML_FRMOPT_S_BORDER = 1<<12;
95 const sal_uInt32 HTML_FRMOPT_S_NOBORDER = 1<<13;
97 const sal_uInt32 HTML_FRMOPT_S_BACKGROUND = 1<<14;
99 const sal_uInt32 HTML_FRMOPT_NAME = 1<<15;
100 const sal_uInt32 HTML_FRMOPT_ALT = 1<<16;
101 const sal_uInt32 HTML_FRMOPT_BRCLEAR = 1<<17;
102 const sal_uInt32 HTML_FRMOPT_S_PIXSIZE = 1<<18;
103 const sal_uInt32 HTML_FRMOPT_ID = 1<<19;
104 const sal_uInt32 HTML_FRMOPT_DIR = 1<<20;
107 const sal_uInt32 HTML_FRMOPTS_GENIMG_ALL =
108 HTML_FRMOPT_ALT |
109 HTML_FRMOPT_SIZE |
110 HTML_FRMOPT_ABSSIZE |
111 HTML_FRMOPT_NAME;
112 const sal_uInt32 HTML_FRMOPTS_GENIMG_CNTNR = HTML_FRMOPTS_GENIMG_ALL;
113 const sal_uInt32 HTML_FRMOPTS_GENIMG =
114 HTML_FRMOPTS_GENIMG_ALL |
115 HTML_FRMOPT_ALIGN |
116 HTML_FRMOPT_SPACE |
117 HTML_FRMOPT_BRCLEAR;
119 #define HTMLMODE_BLOCK_SPACER 0x00010000
120 #define HTMLMODE_FLOAT_FRAME 0x00020000
121 #define HTMLMODE_VERT_SPACER 0x00040000
122 #define HTMLMODE_NBSP_IN_TABLES 0x00080000
123 #define HTMLMODE_LSPACE_IN_NUMBUL 0x00100000
124 #define HTMLMODE_NO_BR_AT_PAREND 0x00200000
125 #define HTMLMODE_PRINT_EXT 0x00400000
126 #define HTMLMODE_ABS_POS_FLY 0x00800000
127 #define HTMLMODE_ABS_POS_DRAW 0x01000000
128 #define HTMLMODE_FLY_MARGINS 0x02000000
129 #define HTMLMODE_BORDER_NONE 0x04000000
130 #define HTMLMODE_FONT_GENERIC 0x08000000
131 #define HTMLMODE_FRSTLINE_IN_NUMBUL 0x10000000
132 #define HTMLMODE_NO_CONTROL_CENTERING 0x20000000
134 #define HTML_DLCOLL_DD 0x4000
135 #define HTML_DLCOLL_DT 0x8000
137 #define CSS1_FMT_ISTAG (USHRT_MAX)
138 #define CSS1_FMT_CMPREF (USHRT_MAX-1)
139 #define CSS1_FMT_SPECIAL (USHRT_MAX-1)
141 // Die folgenden Flags bestimmen nur, welche Descriptoren, Tags, Optionen etc.
142 // ausgegeben werden ...
143 // bit 0,1,2
144 #define CSS1_OUTMODE_SPAN_NO_ON 0x0000U
145 #define CSS1_OUTMODE_SPAN_TAG_ON 0x0001U
146 #define CSS1_OUTMODE_STYLE_OPT_ON 0x0002U
147 #define CSS1_OUTMODE_RULE_ON 0x0003U
148 #define CSS1_OUTMODE_SPAN_TAG1_ON 0x0004U
149 #define CSS1_OUTMODE_ANY_ON 0x0007U
151 // bit 3,4,5
152 #define CSS1_OUTMODE_SPAN_NO_OFF 0x0000U
153 #define CSS1_OUTMODE_SPAN_TAG_OFF ((sal_uInt16)(0x0001U << 3))
154 #define CSS1_OUTMODE_STYLE_OPT_OFF ((sal_uInt16)(0x0002U << 3))
155 #define CSS1_OUTMODE_RULE_OFF ((sal_uInt16)(0x0003U << 3))
156 #define CSS1_OUTMODE_SPAN_TAG1_OFF ((sal_uInt16)(0x0004U << 3))
157 #define CSS1_OUTMODE_ANY_OFF ((sal_uInt16)(0x0007U << 3))
159 #define CSS1_OUTMODE_ONOFF(a) (CSS1_OUTMODE_##a##_ON|CSS1_OUTMODE_##a##_OFF)
160 #define CSS1_OUTMODE_SPAN_TAG CSS1_OUTMODE_ONOFF(SPAN_TAG)
161 #define CSS1_OUTMODE_STYLE_OPT CSS1_OUTMODE_ONOFF(STYLE_OPT)
162 #define CSS1_OUTMODE_RULE CSS1_OUTMODE_ONOFF(RULE)
163 #define CSS1_OUTMODE_SPAN_TAG1 CSS1_OUTMODE_ONOFF(TAG1)
165 // Die folgenden Flags legen fest, was ausgegeben wird
166 // bit 6,7,8,9
167 #define CSS1_OUTMODE_TEMPLATE 0x0000U
168 #define CSS1_OUTMODE_BODY ((sal_uInt16)(0x0001U << 6))
169 #define CSS1_OUTMODE_PARA ((sal_uInt16)(0x0002U << 6))
170 #define CSS1_OUTMODE_HINT ((sal_uInt16)(0x0003U << 6))
171 #define CSS1_OUTMODE_FRAME ((sal_uInt16)(0x0004U << 6))
172 #define CSS1_OUTMODE_TABLE ((sal_uInt16)(0x0005U << 6))
173 #define CSS1_OUTMODE_TABLEBOX ((sal_uInt16)(0x0006U << 6))
174 #define CSS1_OUTMODE_DROPCAP ((sal_uInt16)(0x0007U << 6))
175 #define CSS1_OUTMODE_SECTION ((sal_uInt16)(0x0008U << 6))
176 #define CSS1_OUTMODE_SOURCE ((sal_uInt16)(0x000fU << 6))
178 // bit 10
179 #define CSS1_OUTMODE_ENCODE ((sal_uInt16)(0x0001U << 10))
181 // bit 11,12,13
182 // don't care about script
183 #define CSS1_OUTMODE_ANY_SCRIPT 0x0000U
184 // no cjk or ctl items
185 #define CSS1_OUTMODE_WESTERN ((sal_uInt16)(0x0001U << 11))
186 // no western or ctl items
187 #define CSS1_OUTMODE_CJK ((sal_uInt16)(0x0002U << 11))
188 // no western or cjk items
189 #define CSS1_OUTMODE_CTL ((sal_uInt16)(0x0003U << 11))
190 // no western, cjk or ctl items
191 #define CSS1_OUTMODE_NO_SCRIPT ((sal_uInt16)(0x0004U << 11))
192 #define CSS1_OUTMODE_SCRIPT ((sal_uInt16)(0x0007U << 11))
194 // der HTML-Writer
195 struct HTMLControl;
196 SV_DECL_PTRARR_SORT_DEL( HTMLControls, HTMLControl*, 1, 1 )
197 SV_DECL_PTRARR( INetFmts, SwFmtINetFmt*, 1, 1 )
199 struct SwHTMLFmtInfo;
200 SV_DECL_PTRARR_SORT_DEL( SwHTMLFmtInfos, SwHTMLFmtInfo*, 1, 1 )
202 class IDocumentStylePoolAccess;
204 class SwHTMLWriter : public Writer
206 SwHTMLPosFlyFrms *pHTMLPosFlyFrms;
207 SwHTMLNumRuleInfo *pNumRuleInfo;// aktuelle Numerierung
208 SwHTMLNumRuleInfo *pNextNumRuleInfo;
209 sal_uInt32 nHTMLMode; // Beschreibung der Export-Konfiguration
211 FieldUnit eCSS1Unit;
213 sal_uInt16 OutHeaderAttrs();
214 const SwPageDesc *MakeHeader( sal_uInt16& rHeaderAtrs );
215 void GetControls();
217 void AddLinkTarget( const String& rURL );
218 void CollectLinkTargets();
220 protected:
221 ULONG WriteStream();
223 public:
224 #if defined(UNX)
225 static const sal_Char sNewLine; // nur \012 oder \015
226 #else
227 static const sal_Char __FAR_DATA sNewLine[]; // \015\012
228 #endif
230 SvStringsDtor aImgMapNames; // geschriebene Image Maps
231 SvStringsSortDtor aImplicitMarks;// implizite Stprungmarken
232 SvStringsDtor aOutlineMarks; // geschriebene Image Maps
233 SvStringsSortDtor aNumRuleNames;// Names of exported num rules
234 SvStringsSortDtor aScriptParaStyles;// script dependent para styles
235 SvStringsSortDtor aScriptTextStyles;// script dependent text styles
236 SvULongs aOutlineMarkPoss;
237 HTMLControls aHTMLControls; // die zu schreibenden ::com::sun::star::form::Forms
238 SwHTMLFmtInfos aChrFmtInfos;
239 SwHTMLFmtInfos aTxtCollInfos;
240 INetFmts aINetFmts; // die "offenen" INet-Attribute
241 SwHTMLTxtFtns *pFootEndNotes;
243 String aCSS1Selector; // der Selektor eines Styles
244 String aNonConvertableCharacters;
245 String aBulletGrfs[MAXLEVEL]; // die Grafiken fuer Listen
247 ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > *pxFormComps; // die aktuelle Form
249 SwDoc *pTemplate; // die HTML-Vorlage
250 Color *pDfltColor; // default Farbe
251 SwNodeIndex *pStartNdIdx; // Index des ersten Absatz
252 const SwPageDesc *pCurrPageDesc;// Die aktuelle Seiten-Vorlage
253 const SwFmtFtn *pFmtFtn;
255 sal_uInt32 aFontHeights[7]; // die Font-Hoehen 1-7
257 sal_uInt32 nWarn; // Result-Code fuer Warnungen
258 sal_uInt32 nLastLFPos; // letzte Position eines LF
260 sal_uInt16 nLastParaToken; // fuers Absaetze zusammenhalten
261 sal_Int32 nBkmkTabPos; // akt. Position in der Bookmark-Tabelle
262 sal_uInt16 nImgMapCnt; // zum eindeutig
263 sal_uInt16 nFormCntrlCnt;
264 sal_uInt16 nEndNote;
265 sal_uInt16 nFootNote;
266 sal_Int32 nLeftMargin; // linker Einzug (z.B. aus Listen)
267 sal_Int32 nDfltLeftMargin; // die dafaults, der nicht geschrieben
268 sal_Int32 nDfltRightMargin; // werden muessen (aus der Vorlage)
269 short nFirstLineIndent; // Erstzeilen-Einzug (aus Listen)
270 short nDfltFirstLineIndent; // nicht zu schreibender default
271 sal_uInt16 nDfltTopMargin; // die defaults, der nicht geschrieben
272 sal_uInt16 nDfltBottomMargin; // werden muessen (aus der Vorlage)
273 sal_uInt16 nIndentLvl; // wie weit ist eingerueckt?
274 xub_StrLen nWhishLineLen; // wie lang darf eine Zeile werden?
275 sal_uInt16 nDefListLvl; // welcher DL-Level existiert gerade
276 sal_Int32 nDefListMargin; // Wie weit wird in DL eingerueckt
277 sal_uInt16 nHeaderFooterSpace;
278 sal_uInt16 nTxtAttrsToIgnore;
279 sal_uInt16 nExportMode;
280 sal_uInt16 nCSS1OutMode;
281 sal_uInt16 nCSS1Script; // contains default script (that's the one
282 // that is not contained in class names)
283 sal_uInt16 nDirection; // the current direction
285 rtl_TextEncoding eDestEnc;
286 LanguageType eLang;
288 // Beschreibung der Export-Konfiguration
289 // 0
290 sal_Bool bCfgOutStyles : 1; // Styles exportieren
291 sal_Bool bCfgPreferStyles : 1; // Styles herkoemmlichen Tags vorziehen
292 sal_Bool bCfgFormFeed : 1; // Form-Feeds exportieren
293 sal_Bool bCfgStarBasic : 1; // StarBasic exportieren
294 sal_Bool bCfgCpyLinkedGrfs : 1;
296 // Beschreibung dessen, was exportiert wird
298 sal_Bool bFirstLine : 1; // wird die 1. Zeile ausgegeben ?
299 sal_Bool bTagOn : 1; // Tag an oder aus/Attr-Start oder -Ende
301 // Die folgenden beiden Flags geben an, wir Attribute exportiert werden:
302 // bTxtAttr bOutOpts
303 // 0 0 Style-Sheets
304 // 1 0 Hints: Jedes Attribut wird als eignes Tag
305 // geschrieben und es gibt ein End-Tag
306 // 0 1 (Absatz-)Attribute: Das Attribut wird als Option
307 // eines bereits geschrieben Tags exportiert. Es
308 // gibt kein End-Tag.
309 sal_Bool bTxtAttr : 1;
310 // 8
311 sal_Bool bOutOpts : 1;
313 sal_Bool bOutTable : 1; // wird der Tabelleninhalt geschrieben?
314 sal_Bool bOutHeader : 1;
315 sal_Bool bOutFooter : 1;
316 sal_Bool bOutFlyFrame : 1;
318 // Flags fuer Style-Export
320 sal_Bool bFirstCSS1Rule : 1; // wurde schon eine Property ausgegeben
321 sal_Bool bFirstCSS1Property : 1; // wurde schon eine Property ausgegeben
322 sal_Bool bPoolCollTextModified : 1; // die Textkoerper-Vorlage wurde
323 // modifiziert.
324 // 16
325 sal_Bool bCSS1IgnoreFirstPageDesc : 1;
327 // was muss/kann/darf nicht ausgegeben werden?
329 sal_Bool bNoAlign : 1; // HTML-Tag erlaubt kein ALIGN=...
330 sal_Bool bClearLeft : 1; // <BR CLEAR=LEFT> am Absatz-Ende ausg.
331 sal_Bool bClearRight : 1; // <BR CLEAR=RIGHT> am Absatz-Ende ausg.
332 sal_Bool bLFPossible : 1; // ein Zeilenumbruch darf eingef. werden
334 // sonstiges
336 sal_Bool bPreserveForm : 1; // die aktuelle Form beibehalten
338 sal_Bool bCfgNetscape4 : 1; // Netscape4 Hacks
339 // 23
341 SwHTMLWriter( const String& rBaseURL );
342 virtual ~SwHTMLWriter();
344 void Out_SwDoc( SwPaM* ); // schreibe den makierten Bereich
346 // gebe alle an in aktuellen Ansatz stehenden ::com::sun::star::text::Bookmarks aus
347 void OutAnchor( const String& rName );
348 void OutBookmarks();
349 void OutImplicitMark( const String& rMark, const sal_Char *pMarkType );
350 void OutHyperlinkHRefValue( const String& rURL );
352 // gebe die evt. an der akt. Position stehenden FlyFrame aus.
353 sal_Bool OutFlyFrm( ULONG nNdIdx, xub_StrLen nCntntIdx,
354 sal_uInt8 nPos, HTMLOutContext *pContext = 0 );
355 void OutFrmFmt( sal_uInt8 nType, const SwFrmFmt& rFmt,
356 const SdrObject *pSdrObj );
358 void OutForm( sal_Bool bTagOn=sal_True, const SwStartNode *pStNd=0 );
359 void OutHiddenForms();
360 void OutHiddenForm( const ::com::sun::star::uno::Reference<
361 ::com::sun::star::form::XForm > & rForm );
363 void OutForm( sal_Bool bOn, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > & rFormComps );
364 void OutHiddenControls( const ::com::sun::star::uno::Reference<
365 ::com::sun::star::container::XIndexContainer > & rFormComps,
366 const ::com::sun::star::uno::Reference<
367 ::com::sun::star::beans::XPropertySet > & rPropSet );
368 sal_Bool HasControls() const;
370 void OutFootEndNoteInfo();
371 void OutFootEndNotes();
372 String GetFootEndNoteSym( const SwFmtFtn& rFmtFtn );
373 void OutFootEndNoteSym( const SwFmtFtn& rFmtFtn, const String& rNum,
374 sal_uInt16 nScript );
376 #ifdef JAVA_BASIC_IDE
377 void OutBasicModule( const String& rName, const String& rLanguage );
378 #endif
379 void OutBasic();
381 void OutAndSetDefList( sal_uInt16 nNewLvl );
383 void OutStyleSheet( const SwPageDesc& rPageDesc, sal_Bool bUsed=sal_True );
385 inline void OutCSS1_PropertyAscii( const sal_Char *pProp,
386 const sal_Char *pVal );
387 inline void OutCSS1_PropertyAscii( const sal_Char *pProp,
388 const ByteString& rVal );
389 inline void OutCSS1_Property( const sal_Char *pProp, const String& rVal );
390 void OutCSS1_Property( const sal_Char *pProp, const sal_Char *pVal,
391 const String *pSVal );
392 void OutCSS1_UnitProperty( const sal_Char *pProp, long nVal );
393 void OutCSS1_PixelProperty( const sal_Char *pProp, long nVal, sal_Bool bVert );
394 void OutCSS1_SfxItemSet( const SfxItemSet& rItemSet, sal_Bool bDeep=sal_True );
396 // BODY-Tag-Events aus der SFX-Konfigaurion
397 void OutBasicBodyEvents();
399 // BACKGROUND/BGCOLOR-Option
400 void OutBackground( const SvxBrushItem *pBrushItem, String& rEmbGrfNm,
401 sal_Bool bGraphic );
402 void OutBackground( const SfxItemSet& rItemSet, String &rEmbGrfName,
403 sal_Bool bGraphic );
405 void OutLanguage( LanguageType eLang );
406 sal_uInt16 GetHTMLDirection( sal_uInt16 nDir ) const;
407 sal_uInt16 GetHTMLDirection( const SfxItemSet& rItemSet ) const;
408 void OutDirection( sal_uInt16 nDir );
410 // ALT/ALIGN/WIDTH/HEIGHT/HSPACE/VSPACE-Optionen des aktuellen
411 // Frame-Formats ausgeben und ggf. ein <BR CLEAR=...> vorne an
412 // rEndTags anhaengen
413 void OutFrmFmtOptions( const SwFrmFmt& rFrmFmt, const String& rAltTxt,
414 ByteString &rEndTags, sal_uInt32 nFrmOpts );
415 void OutCSS1_TableFrmFmtOptions( const SwFrmFmt& rFrmFmt );
416 void OutCSS1_SectionFmtOptions( const SwFrmFmt& rFrmFmt );
417 void OutCSS1_FrmFmtOptions( const SwFrmFmt& rFrmFmt, sal_uInt32 nFrmOpts,
418 const SdrObject *pSdrObj=0,
419 const SfxItemSet *pItemSet=0 );
420 void OutCSS1_FrmFmtBackground( const SwFrmFmt& rFrmFmt );
422 void ChangeParaToken( sal_uInt16 nNew );
424 void IncIndentLevel() { nIndentLvl++; }
425 void DecIndentLevel() { if ( nIndentLvl ) nIndentLvl--; }
426 void GetIndentString( ByteString& rStr, sal_uInt16 nIncLvl=0 );
428 xub_StrLen GetLineLen() { return (xub_StrLen)(Strm().Tell()-nLastLFPos); }
429 void OutNewLine( sal_Bool bCheck=sal_False );
431 // fuer HTMLSaveData
432 SwPaM* GetEndPaM() { return pOrigPam; }
433 void SetEndPaM( SwPaM* pPam ) { pOrigPam = pPam; }
435 sal_uInt32 ToPixel( sal_uInt32 nVal ) const;
437 sal_uInt16 GuessFrmType( const SwFrmFmt& rFrmFmt,
438 const SdrObject*& rpStrObj );
439 sal_uInt16 GuessOLENodeFrmType( const SwNode& rNd );
441 void CollectFlyFrms();
443 sal_uInt16 GetHTMLFontSize( sal_uInt32 nFontHeight ) const;
445 // Die aktuelle Numerierungs-Information holen.
446 SwHTMLNumRuleInfo& GetNumInfo() { return *pNumRuleInfo; }
448 // Die Numerierungs-Information des naechsten Absatz holen. Sie
449 // muss noch nicht vorhanden sein!
450 SwHTMLNumRuleInfo *GetNextNumInfo() { return pNextNumRuleInfo; }
452 // Die Numerierungs-Information des naechsten Absatz setzen.
453 void SetNextNumInfo( SwHTMLNumRuleInfo *pNxt ) { pNextNumRuleInfo=pNxt; }
455 // Die Numerierungs-Information des naeschten Absatz fuellen.
456 void FillNextNumInfo();
458 // Die Numerierungs-Information des naeschten Absatz loeschen.
459 void ClearNextNumInfo();
461 static const SdrObject *GetHTMLControl( const SwDrawFrmFmt& rFmt );
462 static const SdrObject *GetMarqueeTextObj( const SwDrawFrmFmt& rFmt );
463 static sal_uInt16 GetCSS1Selector( const SwFmt *pFmt, ByteString& rToken,
464 String& rClass, sal_uInt16& rRefPoolId,
465 String *pPseudo=0 );
467 static const SwFmt *GetTemplateFmt( sal_uInt16 nPoolId, IDocumentStylePoolAccess* /*SwDoc*/ pTemplate );
468 static const SwFmt *GetParentFmt( const SwFmt& rFmt, sal_uInt16 nDeep );
470 static void SubtractItemSet( SfxItemSet& rItemSet,
471 const SfxItemSet& rRefItemSet,
472 sal_Bool bSetDefaults,
473 sal_Bool bClearSame = sal_True,
474 const SfxItemSet *pRefScriptItemSet=0 );
475 static sal_Bool HasScriptDependentItems( const SfxItemSet& rItemSet,
476 sal_Bool bCheckDropCap );
478 static void GetEEAttrsFromDrwObj( SfxItemSet& rItemSet,
479 const SdrObject *pObj,
480 sal_Bool bSetDefaults );
482 static sal_uInt16 GetDefListLvl( const String& rNm, sal_uInt16 nPoolId );
484 sal_uInt32 GetHTMLMode() const { return nHTMLMode; }
485 sal_Bool IsHTMLMode( sal_uInt32 nMode ) const { return (nHTMLMode & nMode) != 0; }
487 inline sal_Bool IsCSS1Source( sal_uInt16 n ) const;
488 inline sal_Bool IsCSS1Script( sal_uInt16 n ) const;
490 static const sal_Char *GetNumFormat( sal_uInt16 nFmt );
491 static void PrepareFontList( const SvxFontItem& rFontItem, String& rNames,
492 sal_Unicode cQuote, sal_Bool bGeneric );
493 static sal_uInt16 GetCSS1ScriptForScriptType( sal_uInt16 nScriptType );
494 static sal_uInt16 GetLangWhichIdFromScript( sal_uInt16 nScript );
496 FieldUnit GetCSS1Unit() const { return eCSS1Unit; }
499 inline sal_Bool SwHTMLWriter::IsCSS1Source( sal_uInt16 n ) const
501 return n == (nCSS1OutMode & CSS1_OUTMODE_SOURCE);
504 inline sal_Bool SwHTMLWriter::IsCSS1Script( sal_uInt16 n ) const
506 sal_uInt16 nScript = (nCSS1OutMode & CSS1_OUTMODE_SCRIPT);
507 return CSS1_OUTMODE_ANY_SCRIPT == nScript || n == nScript;
510 inline void SwHTMLWriter::OutCSS1_PropertyAscii( const sal_Char *pProp,
511 const sal_Char *pVal )
513 OutCSS1_Property( pProp, pVal, 0 );
516 inline void SwHTMLWriter::OutCSS1_PropertyAscii( const sal_Char *pProp,
517 const ByteString& rVal )
519 OutCSS1_Property( pProp, rVal.GetBuffer(), 0 );
522 inline void SwHTMLWriter::OutCSS1_Property( const sal_Char *pProp,
523 const String& rVal )
525 OutCSS1_Property( pProp, 0, &rVal );
528 // Struktur speichert die aktuellen Daten des Writers zwischen, um
529 // einen anderen Dokument-Teil auszugeben, wie z.B. Header/Footer
530 // Mit den beiden USHORTs im CTOR wird ein neuer PaM erzeugt und auf
531 // die Position im Dokument gesetzt.
532 // Im Destructor werden alle Daten wieder restauriert und der angelegte
533 // Pam wieder geloescht.
535 struct HTMLSaveData
537 SwHTMLWriter& rWrt;
538 SwPaM* pOldPam, *pOldEnd;
539 SwHTMLNumRuleInfo *pOldNumRuleInfo; // Owner = this
540 SwHTMLNumRuleInfo *pOldNextNumRuleInfo; // Owner = HTML-Writer
541 sal_uInt16 nOldDefListLvl;
542 sal_uInt16 nOldDirection;
543 sal_Bool bOldWriteAll : 1;
544 sal_Bool bOldOutHeader : 1;
545 sal_Bool bOldOutFooter : 1;
546 sal_Bool bOldOutFlyFrame : 1;
547 const SwFlyFrmFmt* pOldFlyFmt;
549 HTMLSaveData( SwHTMLWriter&, ULONG nStt, ULONG nEnd,
550 sal_Bool bSaveNum=sal_True,
551 const SwFrmFmt *pFrmFmt=0 );
552 ~HTMLSaveData();
556 // einige Funktions-Deklarationen
557 Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFmt,
558 sal_Bool bInCntnr );
559 Writer& OutHTML_FrmFmtOLENodeGrf( Writer& rWrt, const SwFrmFmt& rFmt,
560 sal_Bool bInCntnr );
562 Writer& OutHTML_SwTxtNode( Writer&, const SwCntntNode& );
563 Writer& OutHTML_SwTblNode( Writer& , SwTableNode &, const SwFrmFmt *,
564 const String* pCaption=0, sal_Bool bTopCaption=sal_False );
566 Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, const SwDrawFrmFmt& rFmt,
567 const SdrObject& rSdrObj, sal_Bool bInCntnr );
568 Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt, const SwDrawFrmFmt& rFmt,
569 const SdrObject& rSdrObj );
571 Writer& OutHTML_HeaderFooter( Writer& rWrt, const SwFrmFmt& rFrmFmt,
572 sal_Bool bHeader );
574 Writer& OutHTML_Image( Writer&, const SwFrmFmt& rFmt,
575 const String& rGrfName, const String& rAlternateTxt,
576 const Size& rRealSize, sal_uInt32 nFrmOpts,
577 const sal_Char *pMarkType = 0,
578 const ImageMap *pGenImgMap = 0 );
579 Writer& OutHTML_BulletImage( Writer& rWrt, const sal_Char *pTag,
580 const SvxBrushItem* pBrush, String &rGrfName,
581 const Size &rSize,
582 const SwFmtVertOrient* pVertOrient );
584 Writer& OutHTML_SwFmtFld( Writer& rWrt, const SfxPoolItem& rHt );
585 Writer& OutHTML_SwFmtFtn( Writer& rWrt, const SfxPoolItem& rHt );
586 Writer& OutHTML_INetFmt( Writer&, const SwFmtINetFmt& rINetFmt, sal_Bool bOn );
588 Writer& OutCSS1_BodyTagStyleOpt( Writer& rWrt, const SfxItemSet& rItemSet,
589 String aEmbBGGrfName );
590 Writer& OutCSS1_ParaTagStyleOpt( Writer& rWrt, const SfxItemSet& rItemSet );
592 Writer& OutCSS1_HintSpanTag( Writer& rWrt, const SfxPoolItem& rHt );
593 Writer& OutCSS1_HintStyleOpt( Writer& rWrt, const SfxPoolItem& rHt );
595 Writer& OutCSS1_TableBGStyleOpt( Writer& rWrt, const SfxPoolItem& rHt );
596 Writer& OutCSS1_NumBulListStyleOpt( Writer& rWrt, const SwNumRule& rNumRule,
597 sal_uInt8 nLevel );
599 Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt,
600 const SwHTMLNumRuleInfo& rInfo );
601 Writer& OutHTML_NumBulListEnd( SwHTMLWriter& rWrt,
602 const SwHTMLNumRuleInfo& rNextInfo );
605 #endif // _WRTHTML_HXX