3 * Copyright (C) 1998-2004 A.J. van Os; Released under GPL
6 * Typedefs for the interpretation of MS Word files
9 #if !defined(__wordtypes_h)
10 #define __wordtypes_h 1
14 #include "DeskLib:Font.h"
15 #include "DeskLib:Wimp.h"
18 typedef unsigned char UCHAR
;
19 typedef unsigned short USHORT
;
20 typedef unsigned int UINT
;
21 typedef unsigned long ULONG
;
24 typedef struct diagram_tag
{
26 window_handle tMainWindow
;
27 window_handle tScaleWindow
;
29 long lXleft
; /* In DrawUnits */
30 long lYtop
; /* In DrawUnits */
32 int iScaleFactorCurr
; /* In percentage */
33 int iScaleFactorTemp
; /* In percentage */
34 char szFilename
[19+1];
37 typedef struct diagram_tag
{
39 long lXleft
; /* In DrawUnits */
40 long lYtop
; /* In DrawUnits */
42 typedef UCHAR drawfile_fontref
;
45 typedef struct output_tag
{
47 long lStringWidth
; /* In millipoints */
53 drawfile_fontref tFontRef
;
54 struct output_tag
*pPrev
;
55 struct output_tag
*pNext
;
58 /* Types of conversion */
59 typedef enum conversion_tag
{
60 conversion_unknown
= 0,
69 /* Types of encoding */
70 typedef enum encoding_tag
{
71 encoding_neutral
= 100,
72 encoding_latin_1
= 801,
73 encoding_latin_2
= 802,
74 encoding_cyrillic
= 805,
78 /* Font translation table entry */
79 typedef struct font_table_tag
{
81 UCHAR ucWordFontNumber
;
85 char szWordFontname
[65];
86 char szOurFontname
[33];
90 typedef enum image_level_tag
{
95 level_default
= level_ps_2
98 typedef struct options_tag
{
100 conversion_type eConversionType
;
101 BOOL bHideHiddenText
;
102 BOOL bRemoveRemovedText
;
104 encoding_type eEncoding
;
105 int iPageHeight
; /* In points */
106 int iPageWidth
; /* In points */
107 image_level_enum eImageLevel
;
108 #if defined(__riscos)
109 BOOL bAutofiletypeAllowed
;
110 int iScaleFactor
; /* As a percentage */
111 #endif /* __riscos */
114 /* Property Set Storage */
115 typedef struct pps_tag
{
119 typedef struct pps_info_tag
{
120 pps_type tWordDocument
; /* Text stream */
121 pps_type tData
; /* Data stream */
122 pps_type tTable
; /* Table stream */
123 pps_type tSummaryInfo
; /* Summary Information */
124 pps_type tDocSummaryInfo
;/* Document Summary Information */
125 pps_type t0Table
; /* Table 0 stream */
126 pps_type t1Table
; /* Table 1 stream */
129 /* Record of data block information */
130 typedef struct data_block_tag
{
136 /* Record of text block information */
137 typedef struct text_block_tag
{
141 BOOL bUsesUnicode
; /* This block uses 16 bits per character */
145 /* Record of the document block information */
146 typedef struct document_block_tag
{
147 time_t tCreateDate
; /* Unix timestamp */
148 time_t tRevisedDate
; /* Unix timestamp */
149 USHORT usDefaultTabWidth
; /* In twips */
150 UCHAR ucHdrFtrSpecification
;
151 } document_block_type
;
153 /* Record of table-row block information */
154 typedef struct row_block_tag
{
155 ULONG ulFileOffsetStart
;
156 ULONG ulFileOffsetEnd
;
157 ULONG ulCharPosStart
;
159 short asColumnWidth
[TABLE_COLUMN_MAX
+1]; /* In twips */
160 UCHAR ucNumberOfColumns
;
164 /* Various level types */
165 typedef enum level_type_tag
{
168 level_type_numbering
,
173 typedef enum list_id_tag
{
186 /* Linked list of style description information */
187 typedef struct style_block_tag
{
188 ULONG ulFileOffset
; /* The style start with this character */
189 list_id_enum eListID
;/* The fileoffset is in this list */
191 BOOL bNoRestart
; /* Don't restart by more significant levels */
192 USHORT usIstd
; /* Current style */
193 USHORT usIstdNext
; /* Next style unless overruled */
194 USHORT usStartAt
; /* Number at the start of a list */
195 USHORT usBeforeIndent
; /* Vertical indent before paragraph in twips */
196 USHORT usAfterIndent
; /* Vertical indent after paragraph in twips */
197 USHORT usListIndex
; /* Before Word 8 this field was not filled */
198 USHORT usListChar
; /* Character for an itemized list (Unicode) */
199 short sLeftIndent
; /* Left indentation in twips */
200 short sLeftIndent1
; /* First line left indentation in twips */
201 short sRightIndent
; /* Right indentation in twips */
203 UCHAR ucNFC
; /* Number format code */
205 UCHAR ucListLevel
; /* Before Word 8 this field was not filled */
206 char szListChar
[4]; /* Character for an itemized list */
209 /* Font description information */
210 typedef struct font_block_tag
{
218 /* Picture description information */
219 typedef struct picture_block_tag
{
221 ULONG ulFileOffsetPicture
;
222 ULONG ulPictureOffset
;
223 } picture_block_type
;
225 /* Section description information */
226 typedef struct section_block_tag
{
228 USHORT usNeedPrevLvl
; /* Print previous level numbers */
229 USHORT usHangingIndent
;
230 UCHAR aucNFC
[9]; /* Number format code */
231 UCHAR ucHdrFtrSpecification
; /* Which headers/footers Word < 8 */
232 } section_block_type
;
234 /* Header/footer description information */
235 typedef struct hdrftr_block_tag
{
237 long lHeight
; /* In DrawUnits */
240 /* Footnote description information */
241 typedef struct footnote_block_tag
{
243 } footnote_block_type
;
245 /* List description information */
246 typedef struct list_block_tag
{
247 ULONG ulStartAt
; /* Number at the start of a list */
248 BOOL bNoRestart
; /* Don't restart by more significant levels */
249 USHORT usListChar
; /* Character for an itemized list (Unicode) */
250 short sLeftIndent
; /* Left indentation in twips */
251 UCHAR ucNFC
; /* Number format code */
254 /* Types of images */
255 typedef enum imagetype_tag
{
256 imagetype_is_unknown
= 0,
257 imagetype_is_external
,
266 /* Types of compression */
267 typedef enum compression_tag
{
268 compression_unknown
= 0,
276 /* Image information */
277 typedef struct imagedata_tag
{
278 /* The type of the image */
279 imagetype_enum eImageType
;
280 /* Information from the Word document */
283 int iHorSizeScaled
; /* Size in points */
284 int iVerSizeScaled
; /* Size in points */
285 /* Information from the image */
286 int iWidth
; /* Size in pixels */
287 int iHeight
; /* Size in pixels */
288 int iComponents
; /* Number of color components */
289 UINT uiBitsPerComponent
; /* Bits per color component */
290 BOOL bAdobe
; /* Image includes Adobe comment marker */
291 compression_enum eCompression
; /* Type of compression */
292 BOOL bColorImage
; /* Is color image */
293 int iColorsUsed
; /* 0 = uses the maximum number of colors */
294 UCHAR aucPalette
[256][3]; /* RGB palette */
297 typedef enum row_info_tag
{
305 typedef enum notetype_tag
{
306 notetype_is_footnote
,
311 typedef enum image_info_tag
{
312 image_no_information
,
313 image_minimal_information
,
314 image_full_information
317 #endif /* __wordtypes_h */