This repository has been archived by the owner on Aug 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathwordtypes.h
317 lines (286 loc) · 8.09 KB
/
wordtypes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
/*
* wordtypes.h
* Copyright (C) 1998-2004 A.J. van Os; Released under GPL
*
* Description:
* Typedefs for the interpretation of MS Word files
*/
#if !defined(__wordtypes_h)
#define __wordtypes_h 1
#include <time.h>
#if defined(__riscos)
#include "DeskLib:Font.h"
#include "DeskLib:Wimp.h"
#endif /* __riscos */
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned int UINT;
typedef unsigned long ULONG;
#if defined(__riscos)
typedef struct diagram_tag {
drawfile_info tInfo;
window_handle tMainWindow;
window_handle tScaleWindow;
menu_ptr pSaveMenu;
long lXleft; /* In DrawUnits */
long lYtop; /* In DrawUnits */
size_t tMemorySize;
int iScaleFactorCurr; /* In percentage */
int iScaleFactorTemp; /* In percentage */
char szFilename[19+1];
} diagram_type;
#else
typedef struct diagram_tag {
FILE *pOutFile;
long lXleft; /* In DrawUnits */
long lYtop; /* In DrawUnits */
} diagram_type;
typedef UCHAR drawfile_fontref;
#endif /* __riscos */
typedef struct output_tag {
char *szStorage;
long lStringWidth; /* In millipoints */
size_t tStorageSize;
size_t tNextFree;
USHORT usFontStyle;
USHORT usFontSize;
UCHAR ucFontColor;
drawfile_fontref tFontRef;
struct output_tag *pPrev;
struct output_tag *pNext;
} output_type;
/* Types of conversion */
typedef enum conversion_tag {
conversion_unknown = 0,
conversion_text,
conversion_draw,
conversion_ps,
conversion_xml,
conversion_pdf,
conversion_fmt_text
} conversion_type;
/* Types of encoding */
typedef enum encoding_tag {
encoding_neutral = 100,
encoding_latin_1 = 801,
encoding_latin_2 = 802,
encoding_cyrillic = 805,
encoding_utf_8 = 1601
} encoding_type;
/* Font translation table entry */
typedef struct font_table_tag {
USHORT usFontStyle;
UCHAR ucWordFontNumber;
UCHAR ucFFN;
UCHAR ucEmphasis;
UCHAR ucInUse;
char szWordFontname[65];
char szOurFontname[33];
} font_table_type;
/* Options */
typedef enum image_level_tag {
level_gs_special = 0,
level_no_images,
level_ps_2,
level_ps_3,
level_default = level_ps_2
} image_level_enum;
typedef struct options_tag {
int iParagraphBreak;
conversion_type eConversionType;
BOOL bHideHiddenText;
BOOL bRemoveRemovedText;
BOOL bUseLandscape;
encoding_type eEncoding;
int iPageHeight; /* In points */
int iPageWidth; /* In points */
image_level_enum eImageLevel;
#if defined(__riscos)
BOOL bAutofiletypeAllowed;
int iScaleFactor; /* As a percentage */
#endif /* __riscos */
} options_type;
/* Property Set Storage */
typedef struct pps_tag {
ULONG ulSB;
ULONG ulSize;
} pps_type;
typedef struct pps_info_tag {
pps_type tWordDocument; /* Text stream */
pps_type tData; /* Data stream */
pps_type tTable; /* Table stream */
pps_type tSummaryInfo; /* Summary Information */
pps_type tDocSummaryInfo;/* Document Summary Information */
pps_type t0Table; /* Table 0 stream */
pps_type t1Table; /* Table 1 stream */
} pps_info_type;
/* Record of data block information */
typedef struct data_block_tag {
ULONG ulFileOffset;
ULONG ulDataPos;
ULONG ulLength;
} data_block_type;
/* Record of text block information */
typedef struct text_block_tag {
ULONG ulFileOffset;
ULONG ulCharPos;
ULONG ulLength;
BOOL bUsesUnicode; /* This block uses 16 bits per character */
USHORT usPropMod;
} text_block_type;
/* Record of the document block information */
typedef struct document_block_tag {
time_t tCreateDate; /* Unix timestamp */
time_t tRevisedDate; /* Unix timestamp */
USHORT usDefaultTabWidth; /* In twips */
UCHAR ucHdrFtrSpecification;
} document_block_type;
/* Record of table-row block information */
typedef struct row_block_tag {
ULONG ulFileOffsetStart;
ULONG ulFileOffsetEnd;
ULONG ulCharPosStart;
ULONG ulCharPosEnd;
short asColumnWidth[TABLE_COLUMN_MAX+1]; /* In twips */
UCHAR ucNumberOfColumns;
UCHAR ucBorderInfo;
} row_block_type;
/* Various level types */
typedef enum level_type_tag {
level_type_none = 0,
level_type_outline,
level_type_numbering,
level_type_sequence,
level_type_pause
} level_type_enum;
typedef enum list_id_tag {
no_list = 0,
text_list,
footnote_list,
hdrftr_list,
macro_list,
annotation_list,
endnote_list,
textbox_list,
hdrtextbox_list,
end_of_lists
} list_id_enum;
/* Linked list of style description information */
typedef struct style_block_tag {
ULONG ulFileOffset; /* The style start with this character */
list_id_enum eListID;/* The fileoffset is in this list */
BOOL bNumPause;
BOOL bNoRestart; /* Don't restart by more significant levels */
USHORT usIstd; /* Current style */
USHORT usIstdNext; /* Next style unless overruled */
USHORT usStartAt; /* Number at the start of a list */
USHORT usBeforeIndent; /* Vertical indent before paragraph in twips */
USHORT usAfterIndent; /* Vertical indent after paragraph in twips */
USHORT usListIndex; /* Before Word 8 this field was not filled */
USHORT usListChar; /* Character for an itemized list (Unicode) */
short sLeftIndent; /* Left indentation in twips */
short sLeftIndent1; /* First line left indentation in twips */
short sRightIndent; /* Right indentation in twips */
UCHAR ucAlignment;
UCHAR ucNFC; /* Number format code */
UCHAR ucNumLevel;
UCHAR ucListLevel; /* Before Word 8 this field was not filled */
char szListChar[4]; /* Character for an itemized list */
} style_block_type;
/* Font description information */
typedef struct font_block_tag {
ULONG ulFileOffset;
USHORT usFontStyle;
USHORT usFontSize;
UCHAR ucFontNumber;
UCHAR ucFontColor;
} font_block_type;
/* Picture description information */
typedef struct picture_block_tag {
ULONG ulFileOffset;
ULONG ulFileOffsetPicture;
ULONG ulPictureOffset;
} picture_block_type;
/* Section description information */
typedef struct section_block_tag {
BOOL bNewPage;
USHORT usNeedPrevLvl; /* Print previous level numbers */
USHORT usHangingIndent;
UCHAR aucNFC[9]; /* Number format code */
UCHAR ucHdrFtrSpecification; /* Which headers/footers Word < 8 */
} section_block_type;
/* Header/footer description information */
typedef struct hdrftr_block_tag {
output_type *pText;
long lHeight; /* In DrawUnits */
} hdrftr_block_type;
/* Footnote description information */
typedef struct footnote_block_tag {
char *szText;
} footnote_block_type;
/* List description information */
typedef struct list_block_tag {
ULONG ulStartAt; /* Number at the start of a list */
BOOL bNoRestart; /* Don't restart by more significant levels */
USHORT usListChar; /* Character for an itemized list (Unicode) */
short sLeftIndent; /* Left indentation in twips */
UCHAR ucNFC; /* Number format code */
} list_block_type;
/* Types of images */
typedef enum imagetype_tag {
imagetype_is_unknown = 0,
imagetype_is_external,
imagetype_is_emf,
imagetype_is_wmf,
imagetype_is_pict,
imagetype_is_jpeg,
imagetype_is_png,
imagetype_is_dib
} imagetype_enum;
/* Types of compression */
typedef enum compression_tag {
compression_unknown = 0,
compression_none,
compression_rle4,
compression_rle8,
compression_jpeg,
compression_zlib
} compression_enum;
/* Image information */
typedef struct imagedata_tag {
/* The type of the image */
imagetype_enum eImageType;
/* Information from the Word document */
size_t tPosition;
size_t tLength;
int iHorSizeScaled; /* Size in points */
int iVerSizeScaled; /* Size in points */
/* Information from the image */
int iWidth; /* Size in pixels */
int iHeight; /* Size in pixels */
int iComponents; /* Number of color components */
UINT uiBitsPerComponent; /* Bits per color component */
BOOL bAdobe; /* Image includes Adobe comment marker */
compression_enum eCompression; /* Type of compression */
BOOL bColorImage; /* Is color image */
int iColorsUsed; /* 0 = uses the maximum number of colors */
UCHAR aucPalette[256][3]; /* RGB palette */
} imagedata_type;
typedef enum row_info_tag {
found_nothing,
found_a_cell,
found_not_a_cell,
found_end_of_row,
found_not_end_of_row
} row_info_enum;
typedef enum notetype_tag {
notetype_is_footnote,
notetype_is_endnote,
notetype_is_unknown
} notetype_enum;
typedef enum image_info_tag {
image_no_information,
image_minimal_information,
image_full_information
} image_info_enum;
#endif /* __wordtypes_h */