1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
3  *
4  *  The Contents of this file are made available subject to the terms of
5  *  either of the following licenses
6  *
7  *         - GNU Lesser General Public License Version 2.1
8  *         - Sun Industry Standards Source License Version 1.1
9  *
10  *  Sun Microsystems Inc., October, 2000
11  *
12  *  GNU Lesser General Public License Version 2.1
13  *  =============================================
14  *  Copyright 2000 by Sun Microsystems, Inc.
15  *  901 San Antonio Road, Palo Alto, CA 94303, USA
16  *
17  *  This library is free software; you can redistribute it and/or
18  *  modify it under the terms of the GNU Lesser General Public
19  *  License version 2.1, as published by the Free Software Foundation.
20  *
21  *  This library is distributed in the hope that it will be useful,
22  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
23  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24  *  Lesser General Public License for more details.
25  *
26  *  You should have received a copy of the GNU Lesser General Public
27  *  License along with this library; if not, write to the Free Software
28  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29  *  MA  02111-1307  USA
30  *
31  *
32  *  Sun Industry Standards Source License Version 1.1
33  *  =================================================
34  *  The contents of this file are subject to the Sun Industry Standards
35  *  Source License Version 1.1 (the "License"); You may not use this file
36  *  except in compliance with the License. You may obtain a copy of the
37  *  License at http://www.openoffice.org/license.html.
38  *
39  *  Software provided under this License is provided on an "AS IS" basis,
40  *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
41  *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
42  *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
43  *  See the License for the specific provisions governing your rights and
44  *  obligations concerning the Software.
45  *
46  *  The Initial Developer of the Original Code is: IBM Corporation
47  *
48  *  Copyright: 2008 by IBM Corporation
49  *
50  *  All Rights Reserved.
51  *
52  *  Contributor(s): _______________________________________
53  *
54  *
55  ************************************************************************/
56 /**
57  * @file
58  * For LWP filter architecture prototype
59  * The file declares structures and enums used by Lwp-Drawing-Module
60  */
61 
62 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPSDWDRAWHEADER_HXX
63 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPSDWDRAWHEADER_HXX
64 
65 #include <config_lgpl.h>
66 #include <sal/types.h>
67 #include <vector>
68 
69 const sal_uInt8 DRAW_FACESIZE = 32;
70 const double THRESHOLD = 0.0001;
71 
72 enum DrawObjectType
73 {
74     OT_UNDEFINED   = 0,
75 
76     OT_SELECT      = 0,
77     OT_HAND        = 1,
78     OT_LINE        = 2,
79     OT_PERPLINE    = 3,
80     OT_POLYLINE    = 4,
81     OT_POLYGON     = 5,
82     OT_RECT        = 6,
83     OT_SQUARE      = 7,
84     OT_RNDRECT     = 8,
85     OT_RNDSQUARE   = 9,
86     OT_OVAL        = 10,
87     OT_CIRCLE      = 11,
88     OT_ARC         = 12,
89     OT_TEXT        = 13,
90     OT_GROUP       = 14,
91     OT_CHART       = 15,
92     OT_METAFILE    = 16,
93     OT_METAFILEIMG = 17,
94     OT_BITMAP      = 18,
95     OT_TEXTART     = 19,
96     OT_BIGBITMAP   = 20
97 };
98 
99 enum DrawFillType
100 {
101     FT_TRANSPARENT    = 0,
102     FT_VLTGRAY        = 1,
103     FT_LTGRAY         = 2,
104     FT_GRAY           = 3,
105     FT_DKGRAY         = 4,
106     FT_SOLID          = 5,
107     FT_HORZHATCH      = 6,
108     FT_VERTHATCH      = 7,
109     FT_FDIAGHATCH     = 8,
110     FT_BDIAGHATCH     = 9,
111     FT_CROSSHATCH     = 10,
112     FT_DIAGCROSSHATCH = 11,
113     FT_PATTERN        = 12
114 };
115 
116 enum DrawLineStyle
117 {
118     LS_SOLID       = 0,
119     LS_DASH        = 1,
120     LS_DOT         = 2,
121     LS_DASHDOT     = 3,
122     LS_DASHDOTDOT  = 4,
123     LS_NULL        = 5,
124     LS_INSIDEFRAME = 6
125 };
126 
127 // Text Attributes as stored in Draw files V1.2 and earlier
128 enum DrawTextAttribute
129 {
130     TA_BOLD           = 0x0001, /* bolded font */
131     TA_ITALIC         = 0x0002, /* italic font */
132     TA_UNDERLINE      = 0x0004, /* underlined font */
133     TA_WORDUNDERLINE  = 0x0008, /* broken underline */
134     TA_ALLCAPS        = 0x0010, /* capitalized font */
135     TA_SMALLCAPS      = 0x0020, /* all small capital letters */
136     TA_DOUBLEUNDER    = 0x0040, /* double underline */
137     TA_STRIKETHRU     = 0x0080, /* strikethru */
138     TA_SUPERSCRIPT    = 0x0100, /* superscript */
139     TA_SUBSCRIPT      = 0x0200  /* subscript */
140 };
141 
142 enum DrawArrowHead
143 {
144     AH_ARROW_NONE = 0,
145     AH_ARROW_FULLARROW = 1,
146     AH_ARROW_HALFARROW = 2,
147     AH_ARROW_LINEARROW = 3,
148     AH_ARROW_INVFULLARROW = 4,
149     AH_ARROW_INVHALFARROW = 5,
150     AH_ARROW_INVLINEARROW = 6,
151     AH_ARROW_TEE = 7,
152     AH_ARROW_SQUARE = 8,
153     AH_ARROW_CIRCLE = 9
154 };
155 
156 struct SdwPoint
157 {
158     sal_Int16 x;
159     sal_Int16 y;
SdwPointSdwPoint160     SdwPoint()
161         : x(0)
162         , y(0)
163     {
164     }
165 };
166 
167 struct SdwColor
168 {
169     sal_uInt8 nR;
170     sal_uInt8 nG;
171     sal_uInt8 nB;
172     sal_uInt8 unused;
SdwColorSdwColor173     SdwColor()
174         : nR(0)
175         , nG(0)
176         , nB(0)
177         , unused(0)
178     {
179     }
180 };
181 
182 struct SdwClosedObjStyleRec
183 {
184     sal_uInt8 nLineWidth = 0;
185     sal_uInt8 nLineStyle = 0;
186     SdwColor aPenColor;
187     SdwColor aForeColor;
188     SdwColor aBackColor;
189     sal_uInt16 nFillType = 0;
190     sal_uInt8 pFillPattern[8] = {};
191     SdwClosedObjStyleRec() = default;
192 };
193 
194 struct SdwDrawObjHeader
195 {
196     sal_uInt16 nRecLen;
197     sal_Int16 nLeft;
198     sal_Int16 nTop;
199     sal_Int16 nRight;
200     sal_Int16 nBottom;
SdwDrawObjHeaderSdwDrawObjHeader201     SdwDrawObjHeader()
202         : nRecLen(0)
203         , nLeft(0)
204         , nTop(0)
205         , nRight(0)
206         , nBottom(0)
207     {
208     }
209 };
210 
211 struct SdwLineRecord
212 {
213     sal_Int16 nStartX;
214     sal_Int16 nStartY;
215     sal_Int16 nEndX;
216     sal_Int16 nEndY;
217     sal_uInt8 nLineWidth;
218     sal_uInt8 nLineEnd;
219     sal_uInt8 nLineStyle;
220     SdwColor aPenColor;
SdwLineRecordSdwLineRecord221     SdwLineRecord()
222         : nStartX(0)
223         , nStartY(0)
224         , nEndX(0)
225         , nEndY(0)
226         , nLineWidth(0)
227         , nLineEnd(0)
228         , nLineStyle(0)
229     {
230     }
231 };
232 
233 struct SdwPolyLineRecord
234 {
235     sal_uInt8 nLineWidth;
236     sal_uInt8 nLineEnd;
237     sal_uInt8 nLineStyle;
238     SdwColor aPenColor;
239     sal_uInt16 nNumPoints;
SdwPolyLineRecordSdwPolyLineRecord240     SdwPolyLineRecord()
241         : nLineWidth(0)
242         , nLineEnd(0)
243         , nLineStyle(0)
244         , nNumPoints(0)
245     {
246     }
247 };
248 
249 struct SdwArcRecord
250 {
251     sal_uInt8 nLineWidth;
252     sal_uInt8 nLineEnd;
253     sal_uInt8 nLineStyle;
254     SdwColor aPenColor;
SdwArcRecordSdwArcRecord255     SdwArcRecord()
256         : nLineWidth(0)
257         , nLineEnd(0)
258         , nLineStyle(0)
259     {
260     }
261 };
262 
263 struct SdwTextBoxRecord
264 {
265     sal_Int16 nTextWidth;
266     sal_Int16 nTextHeight;
267     sal_Int16 nTextSize;
268     SdwColor aTextColor;
269     sal_uInt8 tmpTextFaceName[DRAW_FACESIZE];
270     sal_uInt16 nTextAttrs;
271     sal_uInt16 nTextCharacterSet;
272     sal_Int16 nTextRotation;
273     sal_Int16 nTextExtraSpacing;
274     sal_uInt8* pTextString;
SdwTextBoxRecordSdwTextBoxRecord275     SdwTextBoxRecord()
276         : nTextWidth(0)
277         , nTextHeight(0)
278         , nTextSize(0)
279         , tmpTextFaceName{}
280         , nTextAttrs(0)
281         , nTextCharacterSet(0)
282         , nTextRotation(0)
283         , nTextExtraSpacing(0)
284         , pTextString(nullptr)
285     {
286     }
287 };
288 
289 struct SdwFMPATH
290 {
291     sal_uInt16 n;
292     std::vector<SdwPoint> aPts;
SdwFMPATHSdwFMPATH293     SdwFMPATH()
294         : n(0)
295     {
296     }
297 };
298 
299 struct SdwTextArt : public SdwTextBoxRecord
300 {
301     sal_uInt8 nIndex;
302     sal_Int16 nRotation;
303     sal_uInt16 nTextLen;
304     SdwFMPATH aPath[2];
SdwTextArtSdwTextArt305     SdwTextArt()
306         : nIndex(0)
307         , nRotation(0)
308         , nTextLen(0)
309     {
310     }
311 };
312 
313 struct SdwBmpRecord
314 {
315     sal_uInt16 nTranslation;
316     sal_uInt16 nRotation;
317     sal_uInt32 nFileSize;
SdwBmpRecordSdwBmpRecord318     SdwBmpRecord()
319         : nTranslation(0)
320         , nRotation(0)
321         , nFileSize(0)
322     {
323     }
324 };
325 
326 struct BmpInfoHeader
327 {
328     sal_uInt32 nHeaderLen;
329     sal_uInt16 nWidth;
330     sal_uInt16 nHeight;
331     sal_uInt16 nPlanes;
332     sal_uInt16 nBitCount;
333 };
334 
335 struct BmpInfoHeader2
336 {
337     sal_uInt32 nHeaderLen;
338     sal_uInt32 nWidth;
339     sal_uInt32 nHeight;
340     sal_uInt16 nPlanes;
341     sal_uInt16 nBitCount;
342 };
343 
344 struct DrawingOffsetAndScale
345 {
346     double fOffsetX;
347     double fOffsetY;
348     double fScaleX;
349     double fScaleY;
350     double fLeftMargin;
351     double fTopMargin;
352 
DrawingOffsetAndScaleDrawingOffsetAndScale353     DrawingOffsetAndScale()
354     {
355         fOffsetX = 0.00;
356         fOffsetY = 0.00;
357         fScaleX = 1.00;
358         fScaleY = 1.00;
359         fLeftMargin = 0.00;
360         fTopMargin = 0.00;
361     }
362 };
363 
364 #endif
365 
366 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
367