xref: /trunk/main/sw/source/filter/html/htmlfly.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _HTMLFLY_HXX
25 #define _HTMLFLY_HXX
26 
27 #include <tools/solar.h>
28 #include <tools/string.hxx>
29 
30 #ifndef _SVARRAY_H
31 #include <svl/svarray.hxx>
32 #endif
33 
34 class SdrObject;
35 class SwFrmFmt;
36 class SwNodeIndex;
37 class SwPosFlyFrm;
38 
39 // ACHTUNG: Die Werte dieses Enumgs gehen direkt in die
40 // Augabe Tabelle!!!
41 enum SwHTMLFrmType
42 {
43 	HTML_FRMTYPE_TABLE,
44 	HTML_FRMTYPE_TABLE_CAP,
45 	HTML_FRMTYPE_MULTICOL,
46 	HTML_FRMTYPE_EMPTY,
47 	HTML_FRMTYPE_TEXT,
48 	HTML_FRMTYPE_GRF,
49 	HTML_FRMTYPE_PLUGIN,
50 	HTML_FRMTYPE_APPLET,
51 	HTML_FRMTYPE_IFRAME,
52 	HTML_FRMTYPE_OLE,
53 	HTML_FRMTYPE_MARQUEE,
54 	HTML_FRMTYPE_CONTROL,
55 	HTML_FRMTYPE_DRAW,
56 	HTML_FRMTYPE_END
57 };
58 
59 #define HTML_OUT_TBLNODE 	0x00
60 #define HTML_OUT_GRFNODE	0x01
61 #define HTML_OUT_OLENODE	0x02
62 #define HTML_OUT_DIV		0x03
63 #define HTML_OUT_MULTICOL	0x04
64 #define HTML_OUT_SPACER		0x05
65 #define HTML_OUT_CONTROL	0x06
66 #define HTML_OUT_AMARQUEE	0x07
67 #define HTML_OUT_MARQUEE	0x08
68 #define HTML_OUT_GRFFRM		0x09
69 #define HTML_OUT_OLEGRF		0x0a
70 #define HTML_OUT_SPAN		0x0b
71 #define HTML_OUT_MASK		0x0f
72 
73 #define HTML_POS_PREFIX		0x00
74 #define HTML_POS_BEFORE		0x10
75 #define HTML_POS_INSIDE		0x20
76 #define HTML_POS_ANY		0x30
77 #define HTML_POS_MASK		0x30
78 
79 #define HTML_CNTNR_NONE		0x00
80 #define HTML_CNTNR_SPAN		0x40
81 #define HTML_CNTNR_DIV		0x80
82 #define HTML_CNTNR_MASK		0xc0
83 
84 
85 const sal_uInt16 MAX_FRMTYPES = HTML_FRMTYPE_END;
86 const sal_uInt16 MAX_BROWSERS = 4;
87 
88 extern sal_uInt8 aHTMLOutFrmPageFlyTable[MAX_FRMTYPES][MAX_BROWSERS];
89 extern sal_uInt8 aHTMLOutFrmParaFrameTable[MAX_FRMTYPES][MAX_BROWSERS];
90 extern sal_uInt8 aHTMLOutFrmParaPrtAreaTable[MAX_FRMTYPES][MAX_BROWSERS];
91 extern sal_uInt8 aHTMLOutFrmParaOtherTable[MAX_FRMTYPES][MAX_BROWSERS];
92 extern sal_uInt8 aHTMLOutFrmAsCharTable[MAX_FRMTYPES][MAX_BROWSERS];
93 
94 class SwHTMLPosFlyFrm
95 {
96 	const SwFrmFmt 		*pFrmFmt;		// der Rahmen
97 	const SdrObject		*pSdrObject;	// ggf. Sdr-Objekt
98 	SwNodeIndex 		*pNdIdx;		// Node-Index
99 	sal_uInt32 				nOrdNum;		// Aus SwPosFlyFrm
100 	xub_StrLen			nCntntIdx;		// seine Position im Content
101 	sal_uInt8				nOutputMode;	// Ausgabe-Infos
102 
103 public:
104 
105 	SwHTMLPosFlyFrm( const SwPosFlyFrm& rPosFly,
106 					 const SdrObject *pSdrObj, sal_uInt8 nOutMode );
107 
operator ==(const SwHTMLPosFlyFrm &) const108 	sal_Bool operator==( const SwHTMLPosFlyFrm& ) const { return sal_False; }
109 	sal_Bool operator<( const SwHTMLPosFlyFrm& ) const;
110 
GetFmt() const111 	const SwFrmFmt& GetFmt() const { return *pFrmFmt; }
GetSdrObject() const112 	const SdrObject *GetSdrObject() const { return pSdrObject; }
113 
GetNdIndex() const114 	const SwNodeIndex& GetNdIndex() const { return *pNdIdx; }
115 
GetCntntIndex() const116 	xub_StrLen GetCntntIndex() const 	{ return nCntntIdx; }
117 
GetOutMode() const118 	sal_uInt8 GetOutMode() const { return nOutputMode; }
119 
GetOutFn(sal_uInt8 nMode)120 	static sal_uInt8 GetOutFn( sal_uInt8 nMode ) { return nMode & HTML_OUT_MASK; }
GetOutPos(sal_uInt8 nMode)121 	static sal_uInt8 GetOutPos( sal_uInt8 nMode ) { return nMode & HTML_POS_MASK; }
GetOutCntnr(sal_uInt8 nMode)122 	static sal_uInt8 GetOutCntnr( sal_uInt8 nMode ) { return nMode & HTML_CNTNR_MASK; }
123 
GetOutFn() const124 	sal_uInt8 GetOutFn() const { return nOutputMode & HTML_OUT_MASK; }
GetOutPos() const125 	sal_uInt8 GetOutPos() const { return nOutputMode & HTML_POS_MASK; }
GetOutCntnr() const126 	sal_uInt8 GetOutCntnr() const { return nOutputMode & HTML_CNTNR_MASK; }
127 };
128 
129 typedef SwHTMLPosFlyFrm *SwHTMLPosFlyFrmPtr;
130 SV_DECL_PTRARR_SORT( SwHTMLPosFlyFrms, SwHTMLPosFlyFrmPtr, 10, 10 )
131 
132 
133 #endif
134