1 /* This file is part of the wvWare 2 project
2    Copyright (C) 2001 Werner Trobin <trobin@kde.org>
3 
4    This library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Library General Public
6    License version 2 as published by the Free Software Foundation.
7 
8    This library is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11    Library General Public License for more details.
12 
13    You should have received a copy of the GNU Library General Public License
14    along with this library; see the file COPYING.LIB.  If not, write to
15    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16    Boston, MA 02111-1307, USA.
17 */
18 
19 // This code is generated from the Microsoft HTML specification of the
20 // WinWord format. Do NOT edit this code, but fix the spec or the script
21 // generating the sources.
22 // For information about the script and the "hidden features" please read
23 // the comments at the begin of the script.
24 
25 // If you find bugs or strange behavior please contact Werner Trobin
26 // <trobin@kde.org>
27 
28 #ifndef WORD95_GENERATED_H
29 #define WORD95_GENERATED_H
30 
31 #include "global.h"
32 #include "sharedptr.h"
33 #include "utilities.h"
34 
35 namespace wvWare {
36 
37 class OLEStreamReader;
38 class OLEStreamWriter;
39 class StyleSheet;
40 class Style;
41 
42 namespace Word95 {
43 
44 
45 /**
46  * Date and Time (internal date format) (DTTM)
47  */
48 struct DTTM {
49     /**
50      * Creates an empty DTTM structure and sets the defaults
51      */
52     DTTM();
53     /**
54      * Simply calls read(...)
55      */
56     DTTM(OLEStreamReader *stream, bool preservePos=false);
57     /**
58      * Simply calls readPtr(...)
59      */
60     DTTM(const U8 *ptr);
61 
62     /**
63      * This method reads the DTTM structure from the stream.
64      * If  preservePos is true we push/pop the position of
65      * the stream to save the state. If it's false the state
66      * of stream will be changed!
67      */
68     bool read(OLEStreamReader *stream, bool preservePos=false);
69 
70     /**
71      * This method reads the struct from a pointer
72      */
73     void readPtr(const U8 *ptr);
74 
75     /**
76      * Same as reading :)
77      */
78     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
79 
80     /**
81      * Set all the fields to the inital value (default is 0)
82      */
83     void clear();
84 
85     /**
86      * Dumps all fields of this structure (for debugging)
87      */
88     void dump() const;
89 
90     /**
91      * Converts the data structure to a string (for debugging)
92      */
93     std::string toString() const;
94 
95     // Data
96     /**
97      * minutes (0-59)
98      */
99     U16 mint:6;
100 
101     /**
102      * hours (0-23)
103      */
104     U16 hr:5;
105 
106     /**
107      * days of month (1-31)
108      */
109     U16 dom:5;
110 
111     /**
112      * months (1-12)
113      */
114     U16 mon:4;
115 
116     /**
117      * years (1900-2411)-1900
118      */
119     U16 yr:9;
120 
121     /**
122      * weekday
123      * Sunday=0
124      * Monday=1
125      * Tuesday=2
126      * Wednesday=3
127      * Thursday=4
128      * Friday=5
129      * Saturday=6
130      */
131     U16 wdy:3;
132 
133 }; // DTTM
134 
135 bool operator==(const DTTM &lhs, const DTTM &rhs);
136 bool operator!=(const DTTM &lhs, const DTTM &rhs);
137 
138 
139 /**
140  * Property Modifier(variant 2) (PRM2)
141  */
142 struct PRM2 {
143     /**
144      * Creates an empty PRM2 structure and sets the defaults
145      */
146     PRM2();
147     /**
148      * Simply calls read(...)
149      */
150     PRM2(OLEStreamReader *stream, bool preservePos=false);
151 
152     /**
153      * This method reads the PRM2 structure from the stream.
154      * If  preservePos is true we push/pop the position of
155      * the stream to save the state. If it's false the state
156      * of stream will be changed!
157      */
158     bool read(OLEStreamReader *stream, bool preservePos=false);
159 
160     /**
161      * Same as reading :)
162      */
163     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
164 
165     /**
166      * Set all the fields to the inital value (default is 0)
167      */
168     void clear();
169 
170     // Data
171     /**
172      * set to 1 for variant 2
173      */
174     U16 fComplex:1;
175 
176     /**
177      * index to a grpprl stored in CLX portion of file.
178      */
179     U16 igrpprl:15;
180 
181 }; // PRM2
182 
183 bool operator==(const PRM2 &lhs, const PRM2 &rhs);
184 bool operator!=(const PRM2 &lhs, const PRM2 &rhs);
185 
186 
187 /**
188  * Property Modifier(variant 1) (PRM)
189  */
190 struct PRM {
191     /**
192      * Creates an empty PRM structure and sets the defaults
193      */
194     PRM();
195     /**
196      * Simply calls read(...)
197      */
198     PRM(OLEStreamReader *stream, bool preservePos=false);
199     /**
200      * Simply calls readPtr(...)
201      */
202     PRM(const U8 *ptr);
203 
204     /**
205      * This method reads the PRM structure from the stream.
206      * If  preservePos is true we push/pop the position of
207      * the stream to save the state. If it's false the state
208      * of stream will be changed!
209      */
210     bool read(OLEStreamReader *stream, bool preservePos=false);
211 
212     /**
213      * This method reads the struct from a pointer
214      */
215     void readPtr(const U8 *ptr);
216 
217     /**
218      * Same as reading :)
219      */
220     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
221 
222     /**
223      * Set all the fields to the inital value (default is 0)
224      */
225     void clear();
226 
227     /**
228      * This method returns a PRM2 created from the current PRM
229      */
230     PRM2 toPRM2() const;
231 
232     // Size of the structure
233     static const unsigned int sizeOf;
234 
235     // Data
236     /**
237      * set to 0 for variant 1
238      */
239     U8 fComplex:1;
240 
241     /**
242      * sprm opcode
243      */
244     U8 sprm:7;
245 
246     /**
247      * sprm's second byte if necessary
248      */
249     U8 val;
250 
251 }; // PRM
252 
253 bool operator==(const PRM &lhs, const PRM &rhs);
254 bool operator!=(const PRM &lhs, const PRM &rhs);
255 
256 
257 /**
258  * Shading Descriptor (SHD)
259  */
260 struct SHD {
261     /**
262      * Creates an empty SHD structure and sets the defaults
263      */
264     SHD();
265     /**
266      * Simply calls read(...)
267      */
268     SHD(OLEStreamReader *stream, bool preservePos=false);
269     /**
270      * Simply calls readPtr(...)
271      */
272     SHD(const U8 *ptr);
273 
274     /**
275      * This method reads the SHD structure from the stream.
276      * If  preservePos is true we push/pop the position of
277      * the stream to save the state. If it's false the state
278      * of stream will be changed!
279      */
280     bool read(OLEStreamReader *stream, bool preservePos=false);
281 
282     /**
283      * This method reads the struct from a pointer
284      */
285     void readPtr(const U8 *ptr);
286 
287     /**
288      * Same as reading :)
289      */
290     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
291 
292     /**
293      * Set all the fields to the inital value (default is 0)
294      */
295     void clear();
296 
297     /**
298      * Dumps all fields of this structure (for debugging)
299      */
300     void dump() const;
301 
302     /**
303      * Converts the data structure to a string (for debugging)
304      */
305     std::string toString() const;
306 
307     // Data
308     /**
309      * foreground color (see chp.ico)
310      */
311     U16 icoFore:5;
312 
313     /**
314      * background color (see chp.ico)
315      */
316     U16 icoBack:5;
317 
318     /**
319      * shading pattern (see ipat table below)
320      * 0 Automatic
321      * 1 Solid
322      * 2 5 Percent
323      * 3 10 Percent
324      * 4 20 Percent
325      * 5 25 Percent
326      * 6 30 Percent
327      * 7 40 Percent
328      * 8 50 Percent
329      * 9 60 Percent
330      * 10 70 Percent
331      * 11 75 Percent
332      * 12 80 Percent
333      * 13 90 Percent
334      * 14 Dark Horizontal
335      * 15 Dark Vertical
336      * 16 Dark Forward Diagonal
337      * 17 Dark Backward Diagonal
338      * 18 Dark Cross
339      * 19 Dark Diagonal Cross
340      * 20 Horizontal
341      * 21 Vertical
342      * 22 Forward Diagonal
343      * 23 Backward Diagonal
344      * 24 Cross
345      * 25 Diagonal Cross
346      * 35 2.5 Percent
347      * 36 7.5 Percent
348      * 37 12.5 Percent
349      * 38 15 Percent
350      * 39 17.5 Percent
351      * 40 22.5 Percent
352      * 41 27.5 Percent
353      * 42 32.5 Percent
354      * 43 35 Percent
355      * 44 37.5 Percent
356      * 45 42.5 Percent
357      * 46 45 Percent
358      * 47 47.5 Percent
359      * 48 52.5 Percent
360      * 49 55 Percent
361      * 50 57.5 Percent
362      * 51 62.5 Percent
363      * 52 65 Percent
364      * 53 67.5 Percent
365      * 54 72.5 Percent
366      * 55 77.5 Percent
367      * 56 82.5 Percent
368      * 57 85 Percent
369      * 58 87.5 Percent
370      * 59 92.5 Percent
371      * 60 95 Percent
372      * 61 97.5 Percent
373      * 62 97 Percent
374      */
375     U16 ipat:6;
376 
377 }; // SHD
378 
379 bool operator==(const SHD &lhs, const SHD &rhs);
380 bool operator!=(const SHD &lhs, const SHD &rhs);
381 
382 
383 /**
384  * Paragraph Height (PHE)
385  */
386 struct PHE {
387     /**
388      * Creates an empty PHE structure and sets the defaults
389      */
390     PHE();
391     /**
392      * Simply calls read(...)
393      */
394     PHE(OLEStreamReader *stream, bool preservePos=false);
395     /**
396      * Simply calls readPtr(...)
397      */
398     PHE(const U8 *ptr);
399 
400     /**
401      * This method reads the PHE structure from the stream.
402      * If  preservePos is true we push/pop the position of
403      * the stream to save the state. If it's false the state
404      * of stream will be changed!
405      */
406     bool read(OLEStreamReader *stream, bool preservePos=false);
407 
408     /**
409      * This method reads the struct from a pointer
410      */
411     void readPtr(const U8 *ptr);
412 
413     /**
414      * Same as reading :)
415      */
416     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
417 
418     /**
419      * Set all the fields to the inital value (default is 0)
420      */
421     void clear();
422 
423     /**
424      * Dumps all fields of this structure (for debugging)
425      */
426     void dump() const;
427 
428     /**
429      * Converts the data structure to a string (for debugging)
430      */
431     std::string toString() const;
432 
433     // Size of the structure
434     static const unsigned int sizeOf;
435 
436     // Data
437     /**
438      * reserved
439      */
440     U16 fSpare:1;
441 
442     /**
443      * phe entry is invalid when == 1
444      */
445     U16 fUnk:1;
446 
447     /**
448      * when 1, total height of paragraph is known but lines in paragraph have
449      * different heights.
450      */
451     U16 fDiffLines:1;
452 
453     /**
454      * reserved
455      */
456     U16 unused0_3:5;
457 
458     /**
459      * when fDiffLines is 0 is number of lines in paragraph
460      */
461     U16 clMac:8;
462 
463     /**
464      * width of lines in paragraph
465      */
466     U16 dxaCol;
467 
468     /**
469      * When fDiffLines is 0, this is the height of every line in paragraph.in pixels (dylLine).
470      * When fDiffLines is 1, this is the total height in pixels of the paragraph (dylHeight).
471      * dylHeight and dylLine overlap (shaheed).
472      */
473     U16 dylLine_dylHeight;
474 
475 }; // PHE
476 
477 bool operator==(const PHE &lhs, const PHE &rhs);
478 bool operator!=(const PHE &lhs, const PHE &rhs);
479 
480 
481 /**
482  * Border Code (BRC)
483  */
484 struct BRC {
485     /**
486      * Creates an empty BRC structure and sets the defaults
487      */
488     BRC();
489     /**
490      * Simply calls read(...)
491      */
492     BRC(OLEStreamReader *stream, bool preservePos=false);
493     /**
494      * Simply calls readPtr(...)
495      */
496     BRC(const U8 *ptr);
497 
498     /**
499      * This method reads the BRC structure from the stream.
500      * If  preservePos is true we push/pop the position of
501      * the stream to save the state. If it's false the state
502      * of stream will be changed!
503      */
504     bool read(OLEStreamReader *stream, bool preservePos=false);
505 
506     /**
507      * This method reads the struct from a pointer
508      */
509     void readPtr(const U8 *ptr);
510 
511     /**
512      * Same as reading :)
513      */
514     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
515 
516     /**
517      * Set all the fields to the inital value (default is 0)
518      */
519     void clear();
520 
521     /**
522      * Dumps all fields of this structure (for debugging)
523      */
524     void dump() const;
525 
526     /**
527      * Converts the data structure to a string (for debugging)
528      */
529     std::string toString() const;
530 
531     // Size of the structure
532     static const unsigned int sizeOf;
533 
534     // Data
535     /**
536      * When dxpLineWidth is 0, 1, 2, 3, 4, or 5, this field is the width of
537      * a single line of border in units of 0.75 points.Each line in the border
538      * is this wide (e.g. a double border is three lines).Must be nonzero when
539      * brcType is nonzero.When dxpLineWidth is 6, it means that the border line
540      * is dotted.When dxpLineWidth is 7, it means the border line is dashed.
541      */
542     U16 dxpLineWidth:3;
543 
544     /**
545      * border type code
546      * 0 none
547      * 1 single
548      * 2 thick
549      * 3 double
550      */
551     U16 brcType:2;
552 
553     /**
554      * when 1, border is drawn with shadow. Must be 0 when BRC is a substructure
555      * of the TC
556      */
557     U16 fShadow:1;
558 
559     /**
560      * color code (see chp.ico)
561      */
562     U16 ico:5;
563 
564     /**
565      * width of space to maintain between border and text within border. Must
566      * be 0 when BRC is a substructure of the TC.Stored in points for Windows.
567      */
568     U16 dxpSpace:5;
569 
570 }; // BRC
571 
572 bool operator==(const BRC &lhs, const BRC &rhs);
573 bool operator!=(const BRC &lhs, const BRC &rhs);
574 
575 
576 /**
577  * Table Autoformat Look sPecifier (TLP)
578  */
579 struct TLP {
580     /**
581      * Creates an empty TLP structure and sets the defaults
582      */
583     TLP();
584     /**
585      * Simply calls read(...)
586      */
587     TLP(OLEStreamReader *stream, bool preservePos=false);
588     /**
589      * Simply calls readPtr(...)
590      */
591     TLP(const U8 *ptr);
592 
593     /**
594      * This method reads the TLP structure from the stream.
595      * If  preservePos is true we push/pop the position of
596      * the stream to save the state. If it's false the state
597      * of stream will be changed!
598      */
599     bool read(OLEStreamReader *stream, bool preservePos=false);
600 
601     /**
602      * This method reads the struct from a pointer
603      */
604     void readPtr(const U8 *ptr);
605 
606     /**
607      * Same as reading :)
608      */
609     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
610 
611     /**
612      * Set all the fields to the inital value (default is 0)
613      */
614     void clear();
615 
616     /**
617      * Dumps all fields of this structure (for debugging)
618      */
619     void dump() const;
620 
621     /**
622      * Converts the data structure to a string (for debugging)
623      */
624     std::string toString() const;
625 
626     // Data
627     /**
628      * index to Word's table of table looks
629      */
630     U16 itl;
631 
632     /**
633      * when ==1, use the border properties from the selected table look
634      */
635     U16 fBorders:1;
636 
637     /**
638      * when ==1, use the shading properties from the selected table look
639      */
640     U16 fShading:1;
641 
642     /**
643      * when ==1, use the font from the selected table look
644      */
645     U16 fFont:1;
646 
647     /**
648      * when ==1, use the color from the selected table look
649      */
650     U16 fColor:1;
651 
652     /**
653      * when ==1, do best fit from the selected table look
654      */
655     U16 fBestFit:1;
656 
657     /**
658      * when ==1, apply properties from the selected table look to the header
659      * rows in the table
660      */
661     U16 fHdrRows:1;
662 
663     /**
664      * when ==1, apply properties from the selected table look to the last
665      * row in the table
666      */
667     U16 fLastRow:1;
668 
669     /**
670      * when ==1, apply properties from the selected table look to the header
671      * columns ofthe table
672      */
673     U16 fHdrCols:1;
674 
675     /**
676      * when ==1, apply properties from the selected table look to the last
677      * column ofthe table
678      */
679     U16 fLastCol:1;
680 
681     /**
682      * unused
683      */
684     U16 unused2_9:7;
685 
686 }; // TLP
687 
688 bool operator==(const TLP &lhs, const TLP &rhs);
689 bool operator!=(const TLP &lhs, const TLP &rhs);
690 
691 
692 /**
693  * Table Cell Descriptors (TC)
694  */
695 struct TC {
696     /**
697      * Creates an empty TC structure and sets the defaults
698      */
699     TC();
700     /**
701      * Simply calls read(...)
702      */
703     TC(OLEStreamReader *stream, bool preservePos=false);
704     /**
705      * Simply calls readPtr(...)
706      */
707     TC(const U8 *ptr);
708 
709     /**
710      * This method reads the TC structure from the stream.
711      * If  preservePos is true we push/pop the position of
712      * the stream to save the state. If it's false the state
713      * of stream will be changed!
714      */
715     bool read(OLEStreamReader *stream, bool preservePos=false);
716 
717     /**
718      * This method reads the struct from a pointer
719      */
720     void readPtr(const U8 *ptr);
721 
722     /**
723      * Same as reading :)
724      */
725     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
726 
727     /**
728      * Set all the fields to the inital value (default is 0)
729      */
730     void clear();
731 
732     /**
733      * Dumps all fields of this structure (for debugging)
734      */
735     void dump() const;
736 
737     /**
738      * Converts the data structure to a string (for debugging)
739      */
740     std::string toString() const;
741 
742     // Size of the structure
743     static const unsigned int sizeOf;
744 
745     // Data
746     /**
747      * set to 1 when cell is first cell of a range of cells that have been
748      * merged. When a cell is merged, the display areas of the merged cells are
749      * consolidated and the text within the cells is interpreted as belonging
750      * to one text stream for purposes of calculating line breaks.
751      */
752     U16 fFirstMerged:1;
753 
754     /**
755      * set to 1 when cell has been merged with preceding cell.
756      */
757     U16 fMerged:1;
758 
759     /**
760      * reserved
761      */
762     U16 fUnused:14;
763 
764     /**
765      * specification of the top border of a table cell
766      */
767     BRC brcTop;
768 
769     /**
770      * specification of left border of table row
771      */
772     BRC brcLeft;
773 
774     /**
775      * specification of bottom border of table row
776      */
777     BRC brcBottom;
778 
779     /**
780      * specification f right border of table row.
781      */
782     BRC brcRight;
783 
784 }; // TC
785 
786 bool operator==(const TC &lhs, const TC &rhs);
787 bool operator!=(const TC &lhs, const TC &rhs);
788 
789 
790 /**
791  * Drawing Primitive Header (Word) (DPHEAD)
792  */
793 struct DPHEAD {
794     /**
795      * Creates an empty DPHEAD structure and sets the defaults
796      */
797     DPHEAD();
798     /**
799      * Simply calls read(...)
800      */
801     DPHEAD(OLEStreamReader *stream, bool preservePos=false);
802 
803     /**
804      * This method reads the DPHEAD structure from the stream.
805      * If  preservePos is true we push/pop the position of
806      * the stream to save the state. If it's false the state
807      * of stream will be changed!
808      */
809     bool read(OLEStreamReader *stream, bool preservePos=false);
810 
811     /**
812      * Same as reading :)
813      */
814     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
815 
816     /**
817      * Set all the fields to the inital value (default is 0)
818      */
819     void clear();
820 
821     // Data
822     /**
823      * Drawn Primitive KindREVIEW davebu
824      * 0x0000 = start of grouping of primitives (DO)
825      * 0x0001 = line (DPLINE)
826      * 0x0002 = textbox (DPTXBX)
827      * 0x0003 = rectangle (DPRECT)
828      * 0x0004 = arc (DPARC)
829      * 0x0005 = ellipse (DPELLIPSE)
830      * 0x0006 = polyline (DPPOLYLINE)
831      * 0x0007 = callout textbox (DPCALLOUT)
832      * 0x0008 = end of grouping of primitives
833      * 0x0009 = sample primitve holding default values (DPSAMPLE)
834      */
835     U16 dpk;
836 
837     /**
838      * size (count of bytes) of this DP
839      */
840     U16 cb;
841 
842     /**
843      * These 2 points describe the rectangle enclosing this DP relative to
844      * the origin of the DO
845      */
846     U16 xa;
847 
848     U16 ya;
849 
850     U16 dxa;
851 
852     U16 dya;
853 
854 }; // DPHEAD
855 
856 bool operator==(const DPHEAD &lhs, const DPHEAD &rhs);
857 bool operator!=(const DPHEAD &lhs, const DPHEAD &rhs);
858 
859 
860 /**
861  * DP data for a textbox (DPTXBX)
862  */
863 struct DPTXBX {
864     /**
865      * Creates an empty DPTXBX structure and sets the defaults
866      */
867     DPTXBX();
868     /**
869      * Simply calls read(...)
870      */
871     DPTXBX(OLEStreamReader *stream, bool preservePos=false);
872 
873     /**
874      * This method reads the DPTXBX structure from the stream.
875      * If  preservePos is true we push/pop the position of
876      * the stream to save the state. If it's false the state
877      * of stream will be changed!
878      */
879     bool read(OLEStreamReader *stream, bool preservePos=false);
880 
881     /**
882      * Same as reading :)
883      */
884     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
885 
886     /**
887      * Set all the fields to the inital value (default is 0)
888      */
889     void clear();
890 
891     // Data
892     /**
893      * Common header for a drawing primitive
894      */
895     DPHEAD dphead;
896 
897     /**
898      * LiNe Property Color -- RGB color value
899      */
900     U32 lnpc;
901 
902     /**
903      * line property weight in twips
904      */
905     U16 lnpw;
906 
907     /**
908      * line property style. See description in DPLINE.
909      */
910     U16 lnps;
911 
912     /**
913      * FiLl Property Color ForeGround -- RGB color value
914      */
915     U32 dlpcFg;
916 
917     /**
918      * FiLl Property Color BackGround -- RGB color value
919      */
920     U32 dlpcBg;
921 
922     /**
923      * FiLl Property Pattern. REVIEW davebu
924      */
925     U16 flpp;
926 
927     /**
928      * Shadow Property Intensity
929      */
930     U16 shdwpi;
931 
932     /**
933      * x offset of shadow
934      */
935     U16 xaOffset;
936 
937     /**
938      * y offset of shadow
939      */
940     U16 yaOffset;
941 
942     /**
943      * 1 if the textbox has rounded corners
944      */
945     U16 fRoundCorners:1;
946 
947     /**
948      * REVIEW davebu
949      */
950     U16 zaShape:15;
951 
952     /**
953      * REVIEW davebu
954      */
955     U16 dzaInternalMargin;
956 
957 }; // DPTXBX
958 
959 bool operator==(const DPTXBX &lhs, const DPTXBX &rhs);
960 bool operator!=(const DPTXBX &lhs, const DPTXBX &rhs);
961 
962 
963 /**
964  * DP data for a polyline (DPPOLYLINE)
965  */
966 struct DPPOLYLINE {
967     /**
968      * Creates an empty DPPOLYLINE structure and sets the defaults
969      */
970     DPPOLYLINE();
971     /**
972      * Simply calls read(...)
973      */
974     DPPOLYLINE(OLEStreamReader *stream, bool preservePos=false);
975     /**
976      * Attention: This struct allocates memory on the heap
977      */
978     DPPOLYLINE(const DPPOLYLINE &rhs);
979     ~DPPOLYLINE();
980 
981     DPPOLYLINE &operator=(const DPPOLYLINE &rhs);
982 
983     /**
984      * This method reads the DPPOLYLINE structure from the stream.
985      * If  preservePos is true we push/pop the position of
986      * the stream to save the state. If it's false the state
987      * of stream will be changed!
988      */
989     bool read(OLEStreamReader *stream, bool preservePos=false);
990 
991     /**
992      * Same as reading :)
993      */
994     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
995 
996     /**
997      * Set all the fields to the inital value (default is 0)
998      */
999     void clear();
1000 
1001     // Data
1002     /**
1003      * Common header for a drawing primitive
1004      */
1005     DPHEAD dphead;
1006 
1007     /**
1008      * LiNe Property Color -- RGB color value
1009      */
1010     U32 lnpc;
1011 
1012     /**
1013      * line property weight in twips
1014      */
1015     U16 lnpw;
1016 
1017     /**
1018      * line property style. See description in DPLINE.
1019      */
1020     U16 lnps;
1021 
1022     /**
1023      * FiLl Property Color ForeGround -- RGB color value
1024      */
1025     U32 dlpcFg;
1026 
1027     /**
1028      * FiLl Property Color BackGround -- RGB color value
1029      */
1030     U32 dlpcBg;
1031 
1032     /**
1033      * FiLl Property Pattern. REVIEW davebu
1034      */
1035     U16 flpp;
1036 
1037     /**
1038      * Start EndPoint Property Style
1039      * 0 None
1040      * 1 Hollow
1041      * 2 Filled
1042      */
1043     U16 eppsStart:2;
1044 
1045     /**
1046      * Start EndPoint Property Weight
1047      */
1048     U16 eppwStart:2;
1049 
1050     /**
1051      * Start EndPoint Property length
1052      */
1053     U16 epplStart:2;
1054 
1055     U16 unused30_6:10;
1056 
1057     /**
1058      * End EndPoint Property Style
1059      */
1060     U16 eppsEnd:2;
1061 
1062     /**
1063      * End EndPoint Property Weight
1064      */
1065     U16 eppwEnd:2;
1066 
1067     /**
1068      * End EndPoint Property length
1069      */
1070     U16 epplEnd:2;
1071 
1072     U16 unused32_6:10;
1073 
1074     /**
1075      * Shadow Property Intensity
1076      */
1077     U16 shdwpi;
1078 
1079     /**
1080      * x offset of shadow
1081      */
1082     U16 xaOffset;
1083 
1084     /**
1085      * y offset of shadow
1086      */
1087     U16 yaOffset;
1088 
1089     /**
1090      * 1 if this is a polygon
1091      */
1092     U16 fPolygon:1;
1093 
1094     /**
1095      * count of points
1096      */
1097     U16 cpt:15;
1098 
1099     /**
1100      * These are the endpoints of the first line.
1101      */
1102     U16 xaFirst;
1103 
1104     U16 yaFirst;
1105 
1106     U16 xaEnd;
1107 
1108     U16 yaEnd;
1109 
1110     /**
1111      * An array of xa,ya pairs for the remaining points
1112      */
1113     U16 *rgpta;   //    U16 rgpta[];
1114 
1115 private:
1116     void clearInternal();
1117 
1118 }; // DPPOLYLINE
1119 
1120 bool operator==(const DPPOLYLINE &lhs, const DPPOLYLINE &rhs);
1121 bool operator!=(const DPPOLYLINE &lhs, const DPPOLYLINE &rhs);
1122 
1123 
1124 /**
1125  * Table Properties (TAP)
1126  */
1127 struct TAP : public Shared {
1128     /**
1129      * Creates an empty TAP structure and sets the defaults
1130      */
1131     TAP();
1132     /**
1133      * Simply calls read(...)
1134      */
1135     TAP(OLEStreamReader *stream, bool preservePos=false);
1136     /**
1137      * Attention: This struct allocates memory on the heap
1138      */
1139     TAP(const TAP &rhs);
1140     ~TAP();
1141 
1142     TAP &operator=(const TAP &rhs);
1143 
1144     /**
1145      * This method reads the TAP structure from the stream.
1146      * If  preservePos is true we push/pop the position of
1147      * the stream to save the state. If it's false the state
1148      * of stream will be changed!
1149      */
1150     bool read(OLEStreamReader *stream, bool preservePos=false);
1151 
1152     /**
1153      * Same as reading :)
1154      */
1155     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
1156 
1157     /**
1158      * Set all the fields to the inital value (default is 0)
1159      */
1160     void clear();
1161 
1162     /**
1163      * Dumps all fields of this structure (for debugging)
1164      */
1165     void dump() const;
1166 
1167     /**
1168      * Converts the data structure to a string (for debugging)
1169      */
1170     std::string toString() const;
1171 
1172     // Data
1173     /**
1174      * justification code. specifies how table row should be justified within
1175      * its column.
1176      * 0 left justify
1177      * 1center
1178      * 2right justify
1179      * 3left and right justify
1180      */
1181     U16 jc;
1182 
1183     /**
1184      * measures half of the white space that will be maintained between textin
1185      * adjacent columns of a table row. A dxaGapHalf width of white space will
1186      * be maintained on both sides of a column boundary.
1187      */
1188     U16 dxaGapHalf;
1189 
1190     /**
1191      * when greater than 0. guarantees that the height of the table will be
1192      * at least dyaRowHeight high. When less than 0, guarantees that the height
1193      * of the table will be exactly absolute value of dyaRowHeight high.When 0,table
1194      * will be given a height large enough to representall of the text in all
1195      * of the cells of the table.
1196      */
1197     U16 dyaRowHeight;
1198 
1199     /**
1200      * when 1, table row may not be split across page bounds
1201      */
1202     U8 fCantSplit;
1203 
1204     /**
1205      * when 1, table row is to be used as the header of the table
1206      */
1207     U8 fTableHeader;
1208 
1209     /**
1210      * table look specifier (see TLP definition)
1211      */
1212     TLP tlp;
1213 
1214     /**
1215      * used internally by Word
1216      */
1217     U16 fCaFull:1;
1218 
1219     /**
1220      * used internally by Word
1221      */
1222     U16 fFirstRow:1;
1223 
1224     /**
1225      * used internally by Word
1226      */
1227     U16 fLastRow:1;
1228 
1229     /**
1230      * used internally by Word
1231      */
1232     U16 fOutline:1;
1233 
1234     /**
1235      * reserved
1236      */
1237     U16 unused12_4:12;
1238 
1239     /**
1240      * count of cells defined for this row. ItcMac must be >= 0 and less than
1241      * or equal to 32.
1242      */
1243     U16 itcMac;
1244 
1245     /**
1246      * used internally by Word
1247      */
1248     U16 dxaAdjust;
1249 
1250     /**
1251      * rgdxaCenter[0] is the left boundary of cell 0 measured relative to
1252      * margin.. rgdxaCenter[tap.itcMac - 1] is left boundary of last cell. rgdxaCenter[tap.itcMac]
1253      * is right boundary of last cell.
1254      */
1255     U16 *rgdxaCenter;   //    U16 rgdxaCenter[itcMac + 1];
1256 
1257     /**
1258      * array of table cell descriptors
1259      */
1260     TC *rgtc;   //    TC rgtc[itcMac];
1261 
1262     /**
1263      * array of cell shades
1264      */
1265     SHD *rgshd;   //    SHD rgshd[itcMac];
1266 
1267     /**
1268      * array of border defaults for cells
1269      */
1270     BRC rgbrcTable[6];
1271 
1272 private:
1273     void clearInternal();
1274 
1275 }; // TAP
1276 
1277 bool operator==(const TAP &lhs, const TAP &rhs);
1278 bool operator!=(const TAP &lhs, const TAP &rhs);
1279 
1280 
1281 /**
1282  * Tab Descriptor (TBD)
1283  */
1284 /* This structure has been commented out because we can't handle it correctly
1285  * Please don't try to fix it here in this file, but rather copy this broken
1286  * structure definition and fix it in some auxilliary file. If you want to
1287  * include that aux. file here, please change the template file.
1288  */
1289 //struct TBD {
1290 //    /**
1291 //     * Creates an empty TBD structure and sets the defaults
1292 //     */
1293 //    TBD();
1294 //    /**
1295 //     * Simply calls read(...)
1296 //     */
1297 //    TBD(OLEStreamReader *stream, bool preservePos=false);
1298 
1299 //    /**
1300 //     * This method reads the TBD structure from the stream.
1301 //     * If  preservePos is true we push/pop the position of
1302 //     * the stream to save the state. If it's false the state
1303 //     * of stream will be changed!
1304 //     */
1305 //    bool read(OLEStreamReader *stream, bool preservePos=false);
1306 
1307 //    /**
1308 //     * Same as reading :)
1309 //     */
1310 //    bool write(OLEStreamWriter *stream, bool preservePos=false) const;
1311 
1312 //    /**
1313 //     * Set all the fields to the inital value (default is 0)
1314 //     */
1315 //    void clear();
1316 
1317 //    // Data
1318 //    /**
1319 //     * justification code
1320 //     * 0 left tab
1321 //     * 1 centered tab
1322 //     * 2 right tab
1323 //     * 3 decimal tab
1324 //     * 4 bar
1325 //     */
1326 //    U8 jc:3;
1327 
1328 //    /**
1329 //     * tab leader code
1330 //     * 0 no leader
1331 //     * 1 dotted leader
1332 //     * 2 hyphenated leader
1333 //     * 3 single line leader
1334 //     * 4 heavy line leader
1335 //     */
1336 //    U8 tlc:3;
1337 
1338 //    /**
1339 //     * reserved
1340 //     */
1341 //    U8 unused0_6:2;
1342 
1343 //}; // TBD
1344 
1345 //bool operator==(const TBD &lhs, const TBD &rhs);
1346 //bool operator!=(const TBD &lhs, const TBD &rhs);
1347 
1348 
1349 /**
1350  * Autonumbered List Data Descriptor (ANLD)
1351  */
1352 struct ANLD {
1353     /**
1354      * Creates an empty ANLD structure and sets the defaults
1355      */
1356     ANLD();
1357     /**
1358      * Simply calls read(...)
1359      */
1360     ANLD(OLEStreamReader *stream, bool preservePos=false);
1361     /**
1362      * Simply calls readPtr(...)
1363      */
1364     ANLD(const U8 *ptr);
1365 
1366     /**
1367      * This method reads the ANLD structure from the stream.
1368      * If  preservePos is true we push/pop the position of
1369      * the stream to save the state. If it's false the state
1370      * of stream will be changed!
1371      */
1372     bool read(OLEStreamReader *stream, bool preservePos=false);
1373 
1374     /**
1375      * This method reads the struct from a pointer
1376      */
1377     void readPtr(const U8 *ptr);
1378 
1379     /**
1380      * Same as reading :)
1381      */
1382     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
1383 
1384     /**
1385      * Set all the fields to the inital value (default is 0)
1386      */
1387     void clear();
1388 
1389     /**
1390      * Dumps all fields of this structure (for debugging)
1391      */
1392     void dump() const;
1393 
1394     /**
1395      * Converts the data structure to a string (for debugging)
1396      */
1397     std::string toString() const;
1398 
1399     // Data
1400     /**
1401      * number format code
1402      * 0 Arabic numbering
1403      * 1 Upper case Roman
1404      * 2 Lower case Roman
1405      * 3 Upper case Letter
1406      * 4 Lower case letter
1407      * 5 Ordinal
1408      */
1409     U8 nfc;
1410 
1411     /**
1412      * offset into anld.rgch that is the limit of the text that will be displayed
1413      * as the prefix of the autonumber text
1414      */
1415     U8 cxchTextBefore;
1416 
1417     /**
1418      * anld.cxchTextBefore will be the beginning offset of the text in the
1419      * anld.rgchthat will be displayed as the suffix of an autonumber. The sum
1420      * of anld.cxchTextBefore + anld.cxchTextAfter will be the limit of the autonumber
1421      * suffix in anld.rgch
1422      */
1423     U8 cxchTextAfter;
1424 
1425     /**
1426      * justification code
1427      * 0 left justify
1428      * 1 center
1429      * 2 right justify
1430      * 3 left and right justify
1431      */
1432     U8 jc:2;
1433 
1434     /**
1435      * when ==1, number generated will include previous levels (used for legal
1436      * numbering)
1437      */
1438     U8 fPrev:1;
1439 
1440     /**
1441      * when ==1, number will be displayed using a hanging indent
1442      */
1443     U8 fHang:1;
1444 
1445     /**
1446      * when ==1, boldness of number will be determined by anld.fBold.
1447      */
1448     U8 fSetBold:1;
1449 
1450     /**
1451      * when ==1, italicness of number will be determined by anld.fItalic
1452      */
1453     U8 fSetItalic:1;
1454 
1455     /**
1456      * when ==1, anld.fSmallCaps will determine whether number will be displayed
1457      * in small caps or not.
1458      */
1459     U8 fSetSmallCaps:1;
1460 
1461     /**
1462      * when ==1, anld.fCaps will determine whether number will be displayed
1463      * capitalized or not
1464      */
1465     U8 fSetCaps:1;
1466 
1467     /**
1468      * when ==1, anld.fStrike will determine whether the number will be displayed
1469      * using strikethrough or not.
1470      */
1471     U8 fSetStrike:1;
1472 
1473     /**
1474      * when ==1, anld.kul will determine the underlining state of the autonumber.
1475      */
1476     U8 fSetKul:1;
1477 
1478     /**
1479      * when ==1, autonumber will be displayed with a single prefixing space
1480      * character
1481      */
1482     U8 fPrevSpace:1;
1483 
1484     /**
1485      * determines boldness of autonumber when anld.fSetBold == 1.
1486      */
1487     U8 fBold:1;
1488 
1489     /**
1490      * determines italicness of autonumber when anld.fSetItalic == 1.
1491      */
1492     U8 fItalic:1;
1493 
1494     /**
1495      * determines whether autonumber will be displayed using small caps when
1496      * anld.fSetSmallCaps == 1.
1497      */
1498     U8 fSmallCaps:1;
1499 
1500     /**
1501      * determines whether autonumber will be displayed using caps when anld.fSetCaps
1502      * == 1.
1503      */
1504     U8 fCaps:1;
1505 
1506     /**
1507      * determines whether autonumber will be displayed using caps when anld.fSetStrike
1508      * == 1.
1509      */
1510     U8 fStrike:1;
1511 
1512     /**
1513      * determines whether autonumber will be displayed with underlining when
1514      * anld.fSetKul == 1.
1515      */
1516     U8 kul:3;
1517 
1518     /**
1519      * color of autonumber
1520      */
1521     U8 ico:5;
1522 
1523     /**
1524      * font code of autonumber
1525      */
1526     S16 ftc;
1527 
1528     /**
1529      * font half point size (or 0=auto)
1530      */
1531     U16 hps;
1532 
1533     /**
1534      * starting value (0 to 65535)
1535      */
1536     U16 iStartAt;
1537 
1538     /**
1539      * width of prefix text (same as indent)
1540      */
1541     U16 dxaIndent;
1542 
1543     /**
1544      * minimum space between number and paragraph
1545      */
1546     U16 dxaSpace;
1547 
1548     /**
1549      * number only 1 item per table cell
1550      */
1551     U8 fNumber1;
1552 
1553     /**
1554      * number across cells in table rows(instead of down)
1555      */
1556     U8 fNumberAcross;
1557 
1558     /**
1559      * restart heading number on section boundary
1560      */
1561     U8 fRestartHdn;
1562 
1563     /**
1564      * unused( should be 0)
1565      */
1566     U8 fSpareX;
1567 
1568     /**
1569      * characters displayed before/after autonumber
1570      */
1571     U8 rgchAnld[32];
1572 
1573 }; // ANLD
1574 
1575 bool operator==(const ANLD &lhs, const ANLD &rhs);
1576 bool operator!=(const ANLD &lhs, const ANLD &rhs);
1577 
1578 
1579 /**
1580  * Autonumber Level Descriptor (ANLV)
1581  */
1582 struct ANLV {
1583     /**
1584      * Creates an empty ANLV structure and sets the defaults
1585      */
1586     ANLV();
1587     /**
1588      * Simply calls read(...)
1589      */
1590     ANLV(OLEStreamReader *stream, bool preservePos=false);
1591     /**
1592      * Simply calls readPtr(...)
1593      */
1594     ANLV(const U8 *ptr);
1595 
1596     /**
1597      * This method reads the ANLV structure from the stream.
1598      * If  preservePos is true we push/pop the position of
1599      * the stream to save the state. If it's false the state
1600      * of stream will be changed!
1601      */
1602     bool read(OLEStreamReader *stream, bool preservePos=false);
1603 
1604     /**
1605      * This method reads the struct from a pointer
1606      */
1607     void readPtr(const U8 *ptr);
1608 
1609     /**
1610      * Same as reading :)
1611      */
1612     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
1613 
1614     /**
1615      * Set all the fields to the inital value (default is 0)
1616      */
1617     void clear();
1618 
1619     /**
1620      * Dumps all fields of this structure (for debugging)
1621      */
1622     void dump() const;
1623 
1624     /**
1625      * Converts the data structure to a string (for debugging)
1626      */
1627     std::string toString() const;
1628 
1629     // Size of the structure
1630     static const unsigned int sizeOf;
1631 
1632     // Data
1633     /**
1634      * number format code
1635      * 0 Arabic numbering
1636      * 1 Upper case Roman
1637      * 2 Lower case Roman
1638      * 3 Upper case Letter
1639      * 4 Lower case letter
1640      * 5 Ordinal
1641      */
1642     U8 nfc;
1643 
1644     /**
1645      * offset into anld.rgch that is the limit of the text that will be displayed
1646      * as the prefix of the autonumber text
1647      */
1648     U8 cxchTextBefore;
1649 
1650     /**
1651      * anld.cxchTextBefore will be the beginning offset of the text in the
1652      * anld.rgch that will be displayed as the suffix of an autonumber. The sum
1653      * of anld.cxchTextBefore + anld.cxchTextAfter will be the limit of the autonumber
1654      * suffix in anld.rgch
1655      */
1656     U8 cxchTextAfter;
1657 
1658     /**
1659      * justification code
1660      * 0 left justify
1661      * 1 center
1662      * 2 right justify
1663      * 3 left and right justify
1664      */
1665     U8 jc:2;
1666 
1667     /**
1668      * when ==1, number generated will include previous levels (used for legal
1669      * numbering)
1670      */
1671     U8 fPrev:1;
1672 
1673     /**
1674      * when ==1, number will be displayed using a hanging indent
1675      */
1676     U8 fHang:1;
1677 
1678     /**
1679      * when ==1, boldness of number will be determined by anld.fBold.
1680      */
1681     U8 fSetBold:1;
1682 
1683     /**
1684      * when ==1, italicness of number will be determined by anld.fItalic
1685      */
1686     U8 fSetItalic:1;
1687 
1688     /**
1689      * when ==1, anld.fSmallCaps will determine whether number will be displayed
1690      * in small caps or not.
1691      */
1692     U8 fSetSmallCaps:1;
1693 
1694     /**
1695      * when ==1, anld.fCaps will determine whether number will be displayed
1696      * capitalized or not
1697      */
1698     U8 fSetCaps:1;
1699 
1700     /**
1701      * when ==1, anld.fStrike will determine whether the number will be displayed
1702      * using strikethrough or not.
1703      */
1704     U8 fSetStrike:1;
1705 
1706     /**
1707      * when ==1, anld.kul will determine the underlining state of the autonumber.
1708      */
1709     U8 fSetKul:1;
1710 
1711     /**
1712      * when ==1, autonumber will be displayed with a single prefixing space
1713      * character
1714      */
1715     U8 fPrevSpace:1;
1716 
1717     /**
1718      * determines boldness of autonumber when anld.fSetBold == 1.
1719      */
1720     U8 fBold:1;
1721 
1722     /**
1723      * determines italicness of autonumber when anld.fSetItalic == 1.
1724      */
1725     U8 fItalic:1;
1726 
1727     /**
1728      * determines whether autonumber will be displayed using small caps when
1729      * anld.fSetSmallCaps == 1.
1730      */
1731     U8 fSmallCaps:1;
1732 
1733     /**
1734      * determines whether autonumber will be displayed using caps when anld.fSetCaps
1735      * == 1.
1736      */
1737     U8 fCaps:1;
1738 
1739     /**
1740      * determines whether autonumber will be displayed using caps when anld.fSetStrike
1741      * == 1.
1742      */
1743     U8 fStrike:1;
1744 
1745     /**
1746      * determines whetherautonumber will be displayed with underlining when
1747      * anld.fSetKul == 1.
1748      */
1749     U8 kul:3;
1750 
1751     /**
1752      * color of autonumber
1753      */
1754     U8 ico:5;
1755 
1756     /**
1757      * font code of autonumber
1758      */
1759     S16 ftc;
1760 
1761     /**
1762      * font half point size (or 0=auto)
1763      */
1764     U16 hps;
1765 
1766     /**
1767      * starting value (0 to 65535)
1768      */
1769     U16 iStartAt;
1770 
1771     /**
1772      * width of prefix text (same as indent)
1773      */
1774     U16 dxaIndent;
1775 
1776     /**
1777      * minimum space between number and paragraph
1778      */
1779     U16 dxaSpace;
1780 
1781 }; // ANLV
1782 
1783 bool operator==(const ANLV &lhs, const ANLV &rhs);
1784 bool operator!=(const ANLV &lhs, const ANLV &rhs);
1785 
1786 
1787 /**
1788  * BooKmark First descriptor (BKF)
1789  */
1790 struct BKF {
1791     /**
1792      * Creates an empty BKF structure and sets the defaults
1793      */
1794     BKF();
1795     /**
1796      * Simply calls read(...)
1797      */
1798     BKF(OLEStreamReader *stream, bool preservePos=false);
1799 
1800     /**
1801      * This method reads the BKF structure from the stream.
1802      * If  preservePos is true we push/pop the position of
1803      * the stream to save the state. If it's false the state
1804      * of stream will be changed!
1805      */
1806     bool read(OLEStreamReader *stream, bool preservePos=false);
1807 
1808     /**
1809      * Same as reading :)
1810      */
1811     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
1812 
1813     /**
1814      * Set all the fields to the inital value (default is 0)
1815      */
1816     void clear();
1817 
1818     // Data
1819     /**
1820      * index to BKL entry in plcfbkl that describes the ending position of
1821      * this bookmark in the CP stream.
1822      */
1823     S16 ibkl;
1824 
1825     /**
1826      * when bkf.fCol is 1, this is the index to the first column of a table
1827      * column bookmark.
1828      */
1829     U16 itcFirst:7;
1830 
1831     /**
1832      * when 1, this indicates that this bookmark is marking the range of a
1833      * Macintosh Publisher section.
1834      */
1835     U16 fPub:1;
1836 
1837     /**
1838      * when bkf.fCol is 1, this is the index to limit column of a table column
1839      * bookmark.
1840      */
1841     U16 itcLim:7;
1842 
1843     /**
1844      * when 1, this bookmark marks a range of columns in a table specified
1845      * by [bkf.itcFirst, bkf.itcLim).
1846      */
1847     U16 fCol:1;
1848 
1849 }; // BKF
1850 
1851 bool operator==(const BKF &lhs, const BKF &rhs);
1852 bool operator!=(const BKF &lhs, const BKF &rhs);
1853 
1854 
1855 /**
1856  * BooKmark Lim descriptor (BKL)
1857  */
1858 struct BKL {
1859     /**
1860      * Creates an empty BKL structure and sets the defaults
1861      */
1862     BKL();
1863     /**
1864      * Simply calls read(...)
1865      */
1866     BKL(OLEStreamReader *stream, bool preservePos=false);
1867 
1868     /**
1869      * This method reads the BKL structure from the stream.
1870      * If  preservePos is true we push/pop the position of
1871      * the stream to save the state. If it's false the state
1872      * of stream will be changed!
1873      */
1874     bool read(OLEStreamReader *stream, bool preservePos=false);
1875 
1876     /**
1877      * Same as reading :)
1878      */
1879     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
1880 
1881     /**
1882      * Set all the fields to the inital value (default is 0)
1883      */
1884     void clear();
1885 
1886     // Data
1887     /**
1888      * index to BKF entry in plcfbkf that
1889      */
1890     S16 ibkf;
1891 
1892 }; // BKL
1893 
1894 bool operator==(const BKL &lhs, const BKL &rhs);
1895 bool operator!=(const BKL &lhs, const BKL &rhs);
1896 
1897 
1898 /**
1899  * Border Code for Windows Word 1.0 (BRC10)
1900  */
1901 struct BRC10 {
1902     /**
1903      * Creates an empty BRC10 structure and sets the defaults
1904      */
1905     BRC10();
1906     /**
1907      * Simply calls read(...)
1908      */
1909     BRC10(OLEStreamReader *stream, bool preservePos=false);
1910 
1911     /**
1912      * This method reads the BRC10 structure from the stream.
1913      * If  preservePos is true we push/pop the position of
1914      * the stream to save the state. If it's false the state
1915      * of stream will be changed!
1916      */
1917     bool read(OLEStreamReader *stream, bool preservePos=false);
1918 
1919     /**
1920      * Same as reading :)
1921      */
1922     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
1923 
1924     /**
1925      * Set all the fields to the inital value (default is 0)
1926      */
1927     void clear();
1928 
1929     // Data
1930     /**
1931      * width of second line of border in pixels
1932      */
1933     U16 dxpLine2Width:3;
1934 
1935     /**
1936      * distance to maintain between both lines of borderin pixels
1937      */
1938     U16 dxpSpaceBetween:3;
1939 
1940     /**
1941      * width of first border line in pixels
1942      */
1943     U16 dxpLine1Width:3;
1944 
1945     /**
1946      * width of space to maintain between border and text within border. Must
1947      * be 0 when BRC is a substructure of the TC.
1948      */
1949     U16 dxpSpace:5;
1950 
1951     /**
1952      * when 1, border is drawn with shadow. Must be 0 when BRC10 is a substructure
1953      * of the TC.
1954      */
1955     U16 fShadow:1;
1956 
1957     /**
1958      * reserved
1959      */
1960     U16 fSpare:1;
1961 
1962 }; // BRC10
1963 
1964 bool operator==(const BRC10 &lhs, const BRC10 &rhs);
1965 bool operator!=(const BRC10 &lhs, const BRC10 &rhs);
1966 
1967 
1968 /**
1969  * Bin Table Entry (BTE)
1970  */
1971 struct BTE {
1972     /**
1973      * Creates an empty BTE structure and sets the defaults
1974      */
1975     BTE();
1976     /**
1977      * Simply calls read(...)
1978      */
1979     BTE(OLEStreamReader *stream, bool preservePos=false);
1980 
1981     /**
1982      * This method reads the BTE structure from the stream.
1983      * If  preservePos is true we push/pop the position of
1984      * the stream to save the state. If it's false the state
1985      * of stream will be changed!
1986      */
1987     bool read(OLEStreamReader *stream, bool preservePos=false);
1988 
1989     /**
1990      * Same as reading :)
1991      */
1992     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
1993 
1994     /**
1995      * Set all the fields to the inital value (default is 0)
1996      */
1997     void clear();
1998 
1999     // Size of the structure
2000     static const unsigned int sizeOf;
2001 
2002     // Data
2003     /**
2004      * Page Number for FKP
2005      */
2006     U16 pn;
2007 
2008 }; // BTE
2009 
2010 bool operator==(const BTE &lhs, const BTE &rhs);
2011 bool operator!=(const BTE &lhs, const BTE &rhs);
2012 
2013 
2014 /**
2015  * Character Properties (CHP)
2016  */
2017 struct CHP : public Shared {
2018     /**
2019      * Creates an empty CHP structure and sets the defaults
2020      */
2021     CHP();
2022     /**
2023      * Simply calls read(...)
2024      */
2025     CHP(OLEStreamReader *stream, bool preservePos=false);
2026 
2027     /**
2028      * This method reads the CHP structure from the stream.
2029      * If  preservePos is true we push/pop the position of
2030      * the stream to save the state. If it's false the state
2031      * of stream will be changed!
2032      */
2033     bool read(OLEStreamReader *stream, bool preservePos=false);
2034 
2035     /**
2036      * Same as reading :)
2037      */
2038     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
2039 
2040     /**
2041      * Set all the fields to the inital value (default is 0)
2042      */
2043     void clear();
2044 
2045     /**
2046      * Dumps all fields of this structure (for debugging)
2047      */
2048     void dump() const;
2049 
2050     /**
2051      * Converts the data structure to a string (for debugging)
2052      */
2053     std::string toString() const;
2054 
2055     // Data
2056     /**
2057      * text is bold when 1 , and not bold when 0.
2058      */
2059     U8 fBold:1;
2060 
2061     /**
2062      * italic when 1, not italic when 0
2063      */
2064     U8 fItalic:1;
2065 
2066     /**
2067      * when 1, text has been deleted and will be displayed with strikethrus
2068      * when revision marked text is to displayed
2069      */
2070     U8 fRMarkDel:1;
2071 
2072     /**
2073      * outlined when 1, not outlined when 0
2074      */
2075     U8 fOutline:1;
2076 
2077     /**
2078      * &lt;needs work>
2079      */
2080     U8 fFldVanish:1;
2081 
2082     /**
2083      * displayed with small caps when 1, no small caps when 0
2084      */
2085     U8 fSmallCaps:1;
2086 
2087     /**
2088      * displayed with caps when 1, no caps when 0
2089      */
2090     U8 fCaps:1;
2091 
2092     U8 fVanish:1;
2093 
2094     /**
2095      * when 1, text is newly typed since the last time revision marks have
2096      * been accepted and will be displayed with an underline when revision marked
2097      * text is to be displayed
2098      */
2099     U8 fRMark:1;
2100 
2101     /**
2102      * character is a Word special character when 1, not a special character
2103      * when 0
2104      */
2105     U8 fSpec:1;
2106 
2107     /**
2108      * displayed with strikethrough when 1, no strikethroughwhen 0
2109      */
2110     U8 fStrike:1;
2111 
2112     /**
2113      * embedded object when 1, not an embedded object when 0
2114      */
2115     U8 fObj:1;
2116 
2117     /**
2118      * character is drawn with a shdow when 1; drawn without shadow when 0
2119      */
2120     U8 fShadow:1;
2121 
2122     /**
2123      * character is displayed in lower case when 1. No case transformation
2124      * is performed when 0. This field may be set to 1 only when chp.fSmallCaps
2125      * is 1.
2126      */
2127     U8 fLowerCase:1;
2128 
2129     /**
2130      * when 1, chp.fcPic points to an FFDATA the data structure binary data
2131      * used by Word to describe a form field. chp.fData may only be 1 when chp.fSpec
2132      * is also 1 and the special character in the document stream that has this
2133      * property is a chPicture (0x01).
2134      */
2135     U8 fData:1;
2136 
2137     /**
2138      * when 1, chp.lTagObj specifies a particular object in the object stream
2139      * that specifies the particular OLE object in the stream that should be displayed
2140      * when the chPicture fSpec character that is tagged with the fOle2 is encountered.
2141      * chp.fOle2 may only be 1 when chp.fSpec is also 1 and the special character
2142      * in the document stream that has this property is a chPicture (0x01).
2143      */
2144     U8 fOle2:1;
2145 
2146     /**
2147      * Reserved
2148      */
2149     U16 unused2;
2150 
2151     /**
2152      * font code. The ftc is an index into the rgffn structure. The rgffn
2153      * entry indexed by ftc describes the font that will be used to display the
2154      * run of text described by the CHP.
2155      */
2156     U16 ftc;
2157 
2158     /**
2159      * font size in half points
2160      */
2161     U16 hps;
2162 
2163     /**
2164      * space following each character in the run expressed in twip units.
2165      */
2166     U16 dxaSpace;
2167 
2168     /**
2169      * superscript/subscript indices
2170      * 0 means no super/subscripting
2171      * 1 means text in run is superscrpted
2172      * 2 means text in run is subscripted
2173      */
2174     U8 iss:3;
2175 
2176     /**
2177      * reserved
2178      */
2179     U8 unused10_3:3;
2180 
2181     /**
2182      * used by Word internally, not stored in file
2183      */
2184     U8 fSysVanish:1;
2185 
2186     /**
2187      * reserved
2188      */
2189     U8 unused10_7:1;
2190 
2191     /**
2192      * color of text:
2193      * 0 Auto
2194      * 1 Black
2195      * 2 Blue
2196      * 3 Cyan
2197      * 4 Green
2198      * 5 Magenta
2199      * 6 Red
2200      * 7 Yellow
2201      * 8 White
2202      * 9 DkBlue
2203      * 10 DkCyan
2204      * 11 DkGreen
2205      * 12 DkMagenta
2206      * 13 DkRed
2207      * 14 DkYellow
2208      * 15 DkGray
2209      * 16 LtGray
2210      */
2211     U8 ico:5;
2212 
2213     /**
2214      * underline code:
2215      * 0 none
2216      * 1 single
2217      * 2 by word
2218      * 3 double
2219      * 4 dotted
2220      * 5 hidden
2221      */
2222     U8 kul:3;
2223 
2224     /**
2225      * super/subscript position in half points; positive means text is raised;
2226      * negative means text is lowered.
2227      */
2228     S16 hpsPos;
2229 
2230     /**
2231      * Language Name Language ID
2232      * 0x0401 Arabic
2233      * 0x0402 Bulgarian
2234      * 0x0403 Catalan
2235      * 0x0404 Traditional Chinese
2236      * 0x0804 Simplified Chinese
2237      * 0x0405 Czech
2238      * 0x0406 Danish
2239      * 0x0407 German
2240      * 0x0807 Swiss German
2241      * 0x0408 Greek
2242      * 0x0409 U.S. English
2243      * 0x0809 U.K. English
2244      * 0x0c09 Australian English
2245      * 0x040a Castilian Spanish
2246      * 0x080a Mexican Spanish
2247      * 0x040b Finnish
2248      * 0x040c French
2249      * 0x080c Belgian French
2250      * 0x0c0c Canadian French
2251      * 0x100c Swiss French
2252      * 0x040d Hebrew
2253      * 0x040e Hungarian
2254      * 0x040f Icelandic
2255      * 0x0410 Italian
2256      * 0x0810 Swiss Italian
2257      * 0x0411 Japanese
2258      * 0x0412 Korean
2259      * 0x0413 Dutch
2260      * 0x0813 Belgian Dutch
2261      * 0x0414 Norwegian - Bokmal
2262      * 0x0814 Norwegian - Nynorsk
2263      * 0x0415 Polish
2264      * 0x0416 Brazilian Portuguese
2265      * 0x0816 Portuguese
2266      * 0x0417 Rhaeto-Romanic
2267      * 0x0418 Romanian
2268      * 0x0419 Russian
2269      * 0x041a Croato-Serbian (Latin)
2270      * 0x081a Serbo-Croatian (Cyrillic)
2271      * 0x041b Slovak
2272      * 0x041c Albanian
2273      * 0x041d Swedish
2274      * 0x041e Thai
2275      * 0x041f Turkish
2276      * 0x0420 Urdu
2277      * 0x0421 Bahasa
2278      */
2279     U16 lid;
2280 
2281     /**
2282      * offset in document stream pointing to beginning of a picture when character
2283      * is a picture character (character is 0x01 and chp.fSpec is 1)
2284      * offset in document stream pointing to beginning of a picture when character
2285      * is an OLE1 object character (character is 0x20 and chp.fSpec is 1, chp.fOle2
2286      * is 0)
2287      * long word tag that identifies an OLE2 object in the object stream when
2288      * the character is an OLE2 object character. (character is 0x01 and chp.fSpec
2289      * is 1, chp.fOle2 is 1)
2290      */
2291     U32 fcPic_fcObj_lTagObj;
2292 
2293     /**
2294      * index to author IDs stored in hsttbfRMark. used when text in run was
2295      * newly typed or deleted when revision marking was enabled
2296      */
2297     U16 ibstRMark;
2298 
2299     /**
2300      * Date/time at which this run of text was entered/modified by the author.
2301      * (Only recorded whenrevision marking is on.)
2302      */
2303     DTTM dttmRMark;
2304 
2305     /**
2306      * reserved
2307      */
2308     U16 unused26;
2309 
2310     /**
2311      * index to character style descriptor in the stylesheet that tags this
2312      * run of text When istd is istdNormalChar (10 decimal), characters in run
2313      * are not affected by a character style. If chp.istd contains any other value,
2314      * chpx of the specified character style are applied to CHP for this run before
2315      * any other exceptional properties are applied.
2316      */
2317     U16 istd;
2318 
2319     /**
2320      * when chp.fSpec is 1 and the character recorded for the run in the document
2321      * stream is chSymbol (0x28), chp.ftcSym identifies the font code of the symbol
2322      * font that will be used to display the symbol character recorded in chp.chSym.
2323      * Just like chp.ftc, chp.ftcSym is an index into the rgffn structure.
2324      */
2325     U16 ftcSym;
2326 
2327     /**
2328      * when chp.fSpec is 1 and the character recorded for the run in the document
2329      * stream is chSymbol (0x28), the character stored chp.chSym will be displayed
2330      * using the font specified in chp.ftcSym.
2331      */
2332     U8 chSym;
2333 
2334     /**
2335      * when 1, the character set used to interpret the characters recorded
2336      * in the run identified by chp.chse is different from the native character
2337      * set for this document which is stored in fib.chse.
2338      */
2339     U8 fChsDiff;
2340 
2341     /**
2342      * an index to strings displayed as reasons for actions taken by Word?s
2343      * AutoFormat code
2344      */
2345     U16 idslRMReason;
2346 
2347     /**
2348      * hyphenation rule
2349      * 0 No hyphenation
2350      * 1Normal hyphenation
2351      * 2Add letter before hyphen
2352      * 3Change letter before hyphen
2353      * 4Delete letter before hyphen
2354      * 5Change letter after hyphen
2355      * 6Delete letter before the hyphen and change the letter preceding the
2356      * deleted character
2357      */
2358     U8 ysr;
2359 
2360     /**
2361      * the character that will be used to add or changea letter when chp.ysr
2362      * is 2,3, 5 or 6
2363      */
2364     U8 chYsr;
2365 
2366     /**
2367      * extended character set id
2368      * 0 characters in run should be interpreted using the ANSI set used by
2369      * Windows
2370      * 256 characters in run should be interpreted using the Macintosh character
2371      * set.
2372      */
2373     U16 chse;
2374 
2375     /**
2376      * kerning distance for characters in run recorded in half points
2377      */
2378     U16 hpsKern;
2379 
2380 }; // CHP
2381 
2382 bool operator==(const CHP &lhs, const CHP &rhs);
2383 bool operator!=(const CHP &lhs, const CHP &rhs);
2384 
2385 
2386 /**
2387  * Character Property Exceptions (CHPX)
2388  */
2389 /* This structure has been commented out because we can't handle it correctly
2390  * Please don't try to fix it here in this file, but rather copy this broken
2391  * structure definition and fix it in some auxilliary file. If you want to
2392  * include that aux. file here, please change the template file.
2393  */
2394 //struct CHPX {
2395 //    /**
2396 //     * Creates an empty CHPX structure and sets the defaults
2397 //     */
2398 //    CHPX();
2399 //    /**
2400 //     * Simply calls read(...)
2401 //     */
2402 //    CHPX(OLEStreamReader *stream, bool preservePos=false);
2403 //    /**
2404 //     * Attention: This struct allocates memory on the heap
2405 //     */
2406 //    CHPX(const CHPX &rhs);
2407 //    ~CHPX();
2408 
2409 //    CHPX &operator=(const CHPX &rhs);
2410 
2411 //    /**
2412 //     * This method reads the CHPX structure from the stream.
2413 //     * If  preservePos is true we push/pop the position of
2414 //     * the stream to save the state. If it's false the state
2415 //     * of stream will be changed!
2416 //     */
2417 //    bool read(OLEStreamReader *stream, bool preservePos=false);
2418 
2419 //    /**
2420 //     * Same as reading :)
2421 //     */
2422 //    bool write(OLEStreamWriter *stream, bool preservePos=false) const;
2423 
2424 //    /**
2425 //     * Set all the fields to the inital value (default is 0)
2426 //     */
2427 //    void clear();
2428 
2429 //    // Data
2430 //    /**
2431 //     * count of bytes of following data in CHPX.
2432 //     */
2433 //    U8 cb;
2434 
2435 //    /**
2436 //     * a list of the sprms that encode the differences between CHP for a run
2437 //     * of text and the CHP generated by the paragraph and character styles that
2438 //     * tag the run.
2439 //     */
2440 //    U8 *grpprl;   //    U8 grpprl[cb];
2441 
2442 //private:
2443 //    void clearInternal();
2444 
2445 //}; // CHPX
2446 
2447 //bool operator==(const CHPX &lhs, const CHPX &rhs);
2448 //bool operator!=(const CHPX &lhs, const CHPX &rhs);
2449 
2450 
2451 /**
2452  * Formatted Disk Page for CHPXs (CHPXFKP)
2453  */
2454 /* This structure has been commented out because we can't handle it correctly
2455  * Please don't try to fix it here in this file, but rather copy this broken
2456  * structure definition and fix it in some auxilliary file. If you want to
2457  * include that aux. file here, please change the template file.
2458  */
2459 //struct CHPXFKP {
2460 //    /**
2461 //     * Creates an empty CHPXFKP structure and sets the defaults
2462 //     */
2463 //    CHPXFKP();
2464 //    /**
2465 //     * Simply calls read(...)
2466 //     */
2467 //    CHPXFKP(OLEStreamReader *stream, bool preservePos=false);
2468 //    /**
2469 //     * Attention: This struct allocates memory on the heap
2470 //     */
2471 //    CHPXFKP(const CHPXFKP &rhs);
2472 //    ~CHPXFKP();
2473 
2474 //    CHPXFKP &operator=(const CHPXFKP &rhs);
2475 
2476 //    /**
2477 //     * This method reads the CHPXFKP structure from the stream.
2478 //     * If  preservePos is true we push/pop the position of
2479 //     * the stream to save the state. If it's false the state
2480 //     * of stream will be changed!
2481 //     */
2482 //    bool read(OLEStreamReader *stream, bool preservePos=false);
2483 
2484 //    /**
2485 //     * Same as reading :)
2486 //     */
2487 //    bool write(OLEStreamWriter *stream, bool preservePos=false) const;
2488 
2489 //    /**
2490 //     * Set all the fields to the inital value (default is 0)
2491 //     */
2492 //    void clear();
2493 
2494 //    // Data
2495 //    /**
2496 //     * Array of FCs. Each FC is the limit FC of a run of exception text.
2497 //     */
2498 //    U32 *rgfc;   //    U32 rgfc[];
2499 
2500 //    /**
2501 //     * an array of bytes where each byte is the word offset of aCHPX. If the
2502 //     * byte stored is 0,there is no difference between run's character properties
2503 //     * and the style's character properties
2504 //     */
2505 //    U8 *rgb;   //    U8 rgb[];
2506 
2507 //    /**
2508 //     * As new runs/paragraphs are recorded in the FKP,unused space is reduced
2509 //     * by 5 if CHPX is already recorded and is reduced by5+sizeof(CHPX) if property
2510 //     * is not already recorded.
2511 //     */
2512 //    U8 *unusedSpace;   //    U8 unusedSpace[];
2513 
2514 //    /**
2515 //     * grpchpx consists of all of the CHPXs stored in FKP concatenated end
2516 //     * to end. Each CHPXis prefixed with a count of bytes which records its length.
2517 //     */
2518 //    U8 *grpchpx;   //    U8 grpchpx[];
2519 
2520 //    /**
2521 //     * count of runs for CHPX FKP,
2522 //     */
2523 //    U8 crun;
2524 
2525 //private:
2526 //    void clearInternal();
2527 
2528 //}; // CHPXFKP
2529 
2530 //bool operator==(const CHPXFKP &lhs, const CHPXFKP &rhs);
2531 //bool operator!=(const CHPXFKP &lhs, const CHPXFKP &rhs);
2532 
2533 
2534 /**
2535  * Drop Cap Specifier (DCS)
2536  */
2537 struct DCS {
2538     /**
2539      * Creates an empty DCS structure and sets the defaults
2540      */
2541     DCS();
2542     /**
2543      * Simply calls read(...)
2544      */
2545     DCS(OLEStreamReader *stream, bool preservePos=false);
2546     /**
2547      * Simply calls readPtr(...)
2548      */
2549     DCS(const U8 *ptr);
2550 
2551     /**
2552      * This method reads the DCS structure from the stream.
2553      * If  preservePos is true we push/pop the position of
2554      * the stream to save the state. If it's false the state
2555      * of stream will be changed!
2556      */
2557     bool read(OLEStreamReader *stream, bool preservePos=false);
2558 
2559     /**
2560      * This method reads the struct from a pointer
2561      */
2562     void readPtr(const U8 *ptr);
2563 
2564     /**
2565      * Same as reading :)
2566      */
2567     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
2568 
2569     /**
2570      * Set all the fields to the inital value (default is 0)
2571      */
2572     void clear();
2573 
2574     /**
2575      * Dumps all fields of this structure (for debugging)
2576      */
2577     void dump() const;
2578 
2579     /**
2580      * Converts the data structure to a string (for debugging)
2581      */
2582     std::string toString() const;
2583 
2584     // Data
2585     /**
2586      * default value 0
2587      * drop cap type
2588      * 0 no drop cap
2589      * 1 normal drop cap
2590      * 2 drop cap in margin
2591      */
2592     U8 fdct:3;
2593 
2594     /**
2595      * count of lines to drop
2596      */
2597     U8 lines:5;
2598 
2599     /**
2600      * reserved
2601      */
2602     U8 unused1;
2603 
2604 }; // DCS
2605 
2606 bool operator==(const DCS &lhs, const DCS &rhs);
2607 bool operator!=(const DCS &lhs, const DCS &rhs);
2608 
2609 
2610 /**
2611  * Drawing Object (Word) (DO)
2612  */
2613 struct DO {
2614     /**
2615      * Creates an empty DO structure and sets the defaults
2616      */
2617     DO();
2618     /**
2619      * Simply calls read(...)
2620      */
2621     DO(OLEStreamReader *stream, bool preservePos=false);
2622 
2623     /**
2624      * This method reads the DO structure from the stream.
2625      * If  preservePos is true we push/pop the position of
2626      * the stream to save the state. If it's false the state
2627      * of stream will be changed!
2628      */
2629     bool read(OLEStreamReader *stream, bool preservePos=false);
2630 
2631     /**
2632      * Same as reading :)
2633      */
2634     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
2635 
2636     /**
2637      * Set all the fields to the inital value (default is 0)
2638      */
2639     void clear();
2640 
2641     // Data
2642     /**
2643      * FC pointing to drawing object data
2644      */
2645     U32 fc;
2646 
2647     /**
2648      * Drawn Object Kind, currently this is always 0
2649      */
2650     U16 dok;
2651 
2652     /**
2653      * size (count of bytes) of the entire DO
2654      */
2655     U16 cb;
2656 
2657     /**
2658      * x position relative to anchor CP
2659      */
2660     U8 bx;
2661 
2662     /**
2663      * y position relative to anchor CP
2664      */
2665     U8 by;
2666 
2667     /**
2668      * height of DO
2669      */
2670     U16 dhgt;
2671 
2672     /**
2673      * 1 if the DO anchor is locked
2674      */
2675     U16 fAnchorLock:1;
2676 
2677     U16 unused8:15;
2678 
2679     /**
2680      * variable length array of drawing primitives
2681      */
2682     U8 rgdp;
2683 
2684 }; // DO
2685 
2686 bool operator==(const DO &lhs, const DO &rhs);
2687 bool operator!=(const DO &lhs, const DO &rhs);
2688 
2689 
2690 /**
2691  * Document Properties (DOP)
2692  */
2693 struct DOP {
2694     /**
2695      * Creates an empty DOP structure and sets the defaults
2696      */
2697     DOP();
2698     /**
2699      * Simply calls read(...)
2700      */
2701     DOP(OLEStreamReader *stream, bool preservePos=false);
2702 
2703     /**
2704      * This method reads the DOP structure from the stream.
2705      * If  preservePos is true we push/pop the position of
2706      * the stream to save the state. If it's false the state
2707      * of stream will be changed!
2708      */
2709     bool read(OLEStreamReader *stream, bool preservePos=false);
2710 
2711     /**
2712      * Same as reading :)
2713      */
2714     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
2715 
2716     /**
2717      * Set all the fields to the inital value (default is 0)
2718      */
2719     void clear();
2720 
2721     // Data
2722     /**
2723      * 1 when facing pages should be printed (default 0)
2724      */
2725     U16 fFacingPages:1;
2726 
2727     /**
2728      * 1 when widow control is in effect. 0 when widow control disabled. (default
2729      * 1)
2730      */
2731     U16 fWidowControl:1;
2732 
2733     /**
2734      * 1 when doc is a main doc for Print Merge Helper, 0 when not; default=0
2735      */
2736     U16 fPMHMainDoc:1;
2737 
2738     /**
2739      * Default line suppression storage
2740      * 0= form letter line suppression
2741      * 1= no line suppression
2742      * default=0
2743      */
2744     U16 grfSuppression:2;
2745 
2746     /**
2747      * footnote position code
2748      * 0 print as endnotes
2749      * 1 print at bottom of page
2750      * 2 print immediately beneath text
2751      * (default 1)
2752      */
2753     U16 fpc:2;
2754 
2755     /**
2756      * unused (default 0)
2757      */
2758     U16 unused0_7:1;
2759 
2760     /**
2761      * specification of document headers and footers. See explanation under
2762      * Headers and Footers topic. (default 0)
2763      */
2764     U16 grpfIhdt:8;
2765 
2766     /**
2767      * restart index for footnote
2768      * 0 don't restart note numbering
2769      * 1 restart for each section
2770      * 2 restart for each page
2771      * (default 0)
2772      */
2773     U16 rncFtn:2;
2774 
2775     /**
2776      * initial footnote number for document (default 1)
2777      */
2778     U16 nFtn:14;
2779 
2780     /**
2781      * when 1, indicates that information in the hplcpad should be refreshed
2782      * since outline has been dirtied
2783      */
2784     U8 fOutlineDirtySave:1;
2785 
2786     /**
2787      * reserved
2788      */
2789     U8 unused4_1:7;
2790 
2791     /**
2792      * when 1, Word believes all pictures recorded in the document were created
2793      * on a Macintosh
2794      */
2795     U8 fOnlyMacPics:1;
2796 
2797     /**
2798      * when 1, Word believes all pictures recorded in the document were created
2799      * in Windows
2800      */
2801     U8 fOnlyWinPics:1;
2802 
2803     /**
2804      * when 1, document was created as a print merge labels document
2805      */
2806     U8 fLabelDoc:1;
2807 
2808     /**
2809      * when 1, Word is allowed to hyphenate words that are capitalized. When
2810      * 0, capitalized may not be hyphenated
2811      */
2812     U8 fHyphCapitals:1;
2813 
2814     /**
2815      * when 1, Word will hyphenate newly typed text as a background task
2816      */
2817     U8 fAutoHyphen:1;
2818 
2819     U8 fFormNoFields:1;
2820 
2821     /**
2822      * when 1, Word will merge styles from its template
2823      */
2824     U8 fLinkStyles:1;
2825 
2826     /**
2827      * when 1, Word will mark revisions as the document is edited
2828      */
2829     U8 fRevMarking:1;
2830 
2831     /**
2832      * always make backup when document saved when 1.
2833      */
2834     U8 fBackup:1;
2835 
2836     U8 fExactCWords:1;
2837 
2838     U8 fPagHidden:1;
2839 
2840     U8 fPagResults:1;
2841 
2842     /**
2843      * when 1, annotations are locked for editing
2844      */
2845     U8 fLockAtn:1;
2846 
2847     /**
2848      * swap margins on left/right pages when 1.
2849      */
2850     U8 fMirrorMargins:1;
2851 
2852     /**
2853      * user has recommended that this doc be opened read-only when 1
2854      */
2855     U8 fReadOnlyRecommended:1;
2856 
2857     /**
2858      * when 1, use TrueType fonts by default (flag obeyed only when doc was
2859      * created by WinWord 2.x)
2860      */
2861     U8 fDfltTrueType:1;
2862 
2863     /**
2864      * when 1, file created with SUPPRESSTOPSPACING=YES in win.ini. (flag
2865      * obeyed only when doc was created by WinWord 2.x).
2866      */
2867     U8 fPagSuppressTopSpacing:1;
2868 
2869     /**
2870      * when 1, document is protected from edit operations
2871      */
2872     U8 fProtEnabled:1;
2873 
2874     /**
2875      * when 1, restrict selections to occur only within form fields
2876      */
2877     U8 fDispFormFldSel:1;
2878 
2879     /**
2880      * when 1, show revision markings on screen
2881      */
2882     U8 fRMView:1;
2883 
2884     /**
2885      * when 1, print revision marks when document is printed
2886      */
2887     U8 fRMPrint:1;
2888 
2889     U8 fWriteReservation:1;
2890 
2891     /**
2892      * when 1, the current revision marking state is locked
2893      */
2894     U8 fLockRev:1;
2895 
2896     /**
2897      * when 1, document contains embedded True Type fonts
2898      */
2899     U8 fEmbedFonts:1;
2900 
2901     /**
2902      * compatability option: when 1, don?t add automatic tab stops for hanging
2903      * indent
2904      */
2905     U16 copts_fNoTabForInd:1;
2906 
2907     /**
2908      * compatability option: when 1, don?t add extra space for raised or lowered
2909      * characters
2910      */
2911     U16 copts_fNoSpaceRaiseLower:1;
2912 
2913     /**
2914      * compatability option: when 1, supress the paragraph Space Before and
2915      * Space After options after a page break
2916      */
2917     U16 copts_fSuppressSpbfAfterPageBreak:1;
2918 
2919     /**
2920      * compatability option: when 1, wrap trailing spaces at the end of a
2921      * line to the next line
2922      */
2923     U16 copts_fWrapTrailSpaces:1;
2924 
2925     /**
2926      * compatability option: when 1, print colors as black on non-color printers
2927      */
2928     U16 copts_fMapPrintTextColor:1;
2929 
2930     /**
2931      * compatability option: when 1, don?t balance columns for Continuous
2932      * Section starts
2933      */
2934     U16 copts_fNoColumnBalance:1;
2935 
2936     U16 copts_fConvMailMergeEsc:1;
2937 
2938     /**
2939      * compatability option: when 1, supress extra line spacing at top of
2940      * page
2941      */
2942     U16 copts_fSupressTopSpacing:1;
2943 
2944     /**
2945      * compatability option: when 1, combine table borders like Word 5.x for
2946      * the Macintosh
2947      */
2948     U16 copts_fOrigWordTableRules:1;
2949 
2950     /**
2951      * compatability option: when 1, don?t blank area between metafile pictures
2952      */
2953     U16 copts_fTransparentMetafiles:1;
2954 
2955     /**
2956      * compatability option: when 1, show hard page or column breaks in frames
2957      */
2958     U16 copts_fShowBreaksInFrames:1;
2959 
2960     /**
2961      * compatability option: when 1, swap left and right pages on odd facing
2962      * pages
2963      */
2964     U16 copts_fSwapBordersFacingPgs:1;
2965 
2966     /**
2967      * reserved
2968      */
2969     U16 unused8_12:4;
2970 
2971     /**
2972      * (default 720 twips) default tab width
2973      */
2974     U16 dxaTab;
2975 
2976     U16 wSpare;
2977 
2978     /**
2979      * width of hyphenation hot zone measured in twips
2980      */
2981     U16 dxaHotZ;
2982 
2983     /**
2984      * number of lines allowed to have consecutive hyphens
2985      */
2986     U16 cConsecHypLim;
2987 
2988     /**
2989      * reserved
2990      */
2991     U16 wSpare2;
2992 
2993     /**
2994      * date and time document was created
2995      */
2996     DTTM dttmCreated;
2997 
2998     /**
2999      * date and time document was last revised
3000      */
3001     DTTM dttmRevised;
3002 
3003     /**
3004      * date and time document was last printed
3005      */
3006     DTTM dttmLastPrint;
3007 
3008     /**
3009      * number of times document has been revised since its creation
3010      */
3011     U16 nRevision;
3012 
3013     /**
3014      * time document was last edited
3015      */
3016     U32 tmEdited;
3017 
3018     /**
3019      * count of words tallied by last Word Count execution
3020      */
3021     U32 cWords;
3022 
3023     /**
3024      * count of characters tallied by last Word Count execution
3025      */
3026     U32 cCh;
3027 
3028     /**
3029      * count of pages tallied by last Word Count execution
3030      */
3031     U16 cPg;
3032 
3033     /**
3034      * count of paragraphs tallied by last Word Count execution
3035      */
3036     U32 cParas;
3037 
3038     /**
3039      * restart endnote number code
3040      * 0 don't restart endnote numbering
3041      * 1 restart for each section
3042      * 2 restart for each page
3043      */
3044     U16 rncEdn:2;
3045 
3046     /**
3047      * beginning endnote number
3048      */
3049     U16 nEdn:14;
3050 
3051     /**
3052      * endnote position code
3053      * 0 display endnotes at end of section
3054      * 3 display endnotes at end of document
3055      */
3056     U16 epc:2;
3057 
3058     /**
3059      * number format code for auto footnotes
3060      * 0 Arabic numbering
3061      * 1 Upper case Roman
3062      * 2 Lower case Roman
3063      * 3 Upper case Letter
3064      * 4 Lower case letter
3065      * 5 Ordinal
3066      */
3067     U16 nfcFtnRef:4;
3068 
3069     /**
3070      * number format code for auto endnotes
3071      * 0 Arabic numbering
3072      * 1 Upper case Roman
3073      * 2 Lower case Roman
3074      * 3 Upper case Letter
3075      * 4 Lower case letter
3076      * 5 Ordinal
3077      */
3078     U16 nfcEdnRef:4;
3079 
3080     /**
3081      * only print data inside of form fields
3082      */
3083     U16 fPrintFormData:1;
3084 
3085     /**
3086      * only save document data that is inside of a form field.
3087      */
3088     U16 fSaveFormData:1;
3089 
3090     /**
3091      * shade form fields
3092      */
3093     U16 fShadeFormData:1;
3094 
3095     /**
3096      * reserved
3097      */
3098     U16 unused54_13:2;
3099 
3100     /**
3101      * when 1, include footnotes and endnotes in word count
3102      */
3103     U16 fWCFtnEdn:1;
3104 
3105     /**
3106      * count of lines tallied by last Word Count operation
3107      */
3108     U32 cLines;
3109 
3110     /**
3111      * count of words in footnotes and endnotes tallied by last Word Count
3112      * operation
3113      */
3114     U32 cWordsFtnEnd;
3115 
3116     /**
3117      * count of characters in footnotes and endnotes tallied by last Word
3118      * Count operation
3119      */
3120     U32 cChFtnEdn;
3121 
3122     /**
3123      * count of pages in footnotes and endnotes tallied by last Word Count
3124      * operation
3125      */
3126     U16 cPgFtnEdn;
3127 
3128     /**
3129      * count of paragraphs in footnotes and endnotes tallied by last Word
3130      * Count operation
3131      */
3132     U32 cParasFtnEdn;
3133 
3134     /**
3135      * count of paragraphs in footnotes and endnotes tallied by last Word
3136      * Count operation
3137      */
3138     U32 cLinesFtnEdn;
3139 
3140     /**
3141      * document protection password key, only valid if dop.fProtEnabled, dop.fLockAtn
3142      * or dop.fLockRev are 1.
3143      */
3144     U32 lKeyProtDoc;
3145 
3146     /**
3147      * document view kind
3148      * 0 Normal view
3149      * 1 Outline view
3150      * 2 Page View
3151      */
3152     U16 wvkSaved:3;
3153 
3154     U16 wScaleSaved:9;
3155 
3156     U16 zkSaved:2;
3157 
3158     U16 unused82_14:2;
3159 
3160 }; // DOP
3161 
3162 bool operator==(const DOP &lhs, const DOP &rhs);
3163 bool operator!=(const DOP &lhs, const DOP &rhs);
3164 
3165 
3166 /**
3167  * DP data for an arc (DPARC)
3168  */
3169 struct DPARC {
3170     /**
3171      * Creates an empty DPARC structure and sets the defaults
3172      */
3173     DPARC();
3174     /**
3175      * Simply calls read(...)
3176      */
3177     DPARC(OLEStreamReader *stream, bool preservePos=false);
3178 
3179     /**
3180      * This method reads the DPARC structure from the stream.
3181      * If  preservePos is true we push/pop the position of
3182      * the stream to save the state. If it's false the state
3183      * of stream will be changed!
3184      */
3185     bool read(OLEStreamReader *stream, bool preservePos=false);
3186 
3187     /**
3188      * Same as reading :)
3189      */
3190     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
3191 
3192     /**
3193      * Set all the fields to the inital value (default is 0)
3194      */
3195     void clear();
3196 
3197     // Data
3198     /**
3199      * Common header for a drawing primitive
3200      */
3201     DPHEAD dphead;
3202 
3203     /**
3204      * LiNe Property Color -- RGB color value
3205      */
3206     U32 lnpc;
3207 
3208     /**
3209      * line property weight in twips
3210      */
3211     U16 lnpw;
3212 
3213     /**
3214      * line property style. See description in DPLINE.
3215      */
3216     U16 lnps;
3217 
3218     /**
3219      * FiLl Property Color ForeGround -- RGB color value
3220      */
3221     U32 dlpcFg;
3222 
3223     /**
3224      * FiLl Property Color BackGround -- RGB color value
3225      */
3226     U32 dlpcBg;
3227 
3228     /**
3229      * FiLl Property Pattern. REVIEW davebu
3230      */
3231     U16 flpp;
3232 
3233     /**
3234      * Shadow Property Intensity
3235      */
3236     U16 shdwpi;
3237 
3238     /**
3239      * x offset of shadow
3240      */
3241     U16 xaOffset;
3242 
3243     /**
3244      * y offset of shadow
3245      */
3246     U16 yaOffset;
3247 
3248     /**
3249      * REVIEW davebu
3250      */
3251     U16 fLeft:8;
3252 
3253     /**
3254      * REVIEW davebu
3255      */
3256     U16 fUp:8;
3257 
3258 }; // DPARC
3259 
3260 bool operator==(const DPARC &lhs, const DPARC &rhs);
3261 bool operator!=(const DPARC &lhs, const DPARC &rhs);
3262 
3263 
3264 /**
3265  * DP data for a callout textbox (DPCALLOUT)
3266  */
3267 struct DPCALLOUT {
3268     /**
3269      * Creates an empty DPCALLOUT structure and sets the defaults
3270      */
3271     DPCALLOUT();
3272     /**
3273      * Simply calls read(...)
3274      */
3275     DPCALLOUT(OLEStreamReader *stream, bool preservePos=false);
3276 
3277     /**
3278      * This method reads the DPCALLOUT structure from the stream.
3279      * If  preservePos is true we push/pop the position of
3280      * the stream to save the state. If it's false the state
3281      * of stream will be changed!
3282      */
3283     bool read(OLEStreamReader *stream, bool preservePos=false);
3284 
3285     /**
3286      * Same as reading :)
3287      */
3288     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
3289 
3290     /**
3291      * Set all the fields to the inital value (default is 0)
3292      */
3293     void clear();
3294 
3295     // Data
3296     /**
3297      * Common header for a drawing primitive
3298      */
3299     DPHEAD dphead;
3300 
3301     /**
3302      * REVIEW davebu flags
3303      */
3304     U16 unused12;
3305 
3306     /**
3307      * REVIEW davebu
3308      */
3309     U16 dzaOffset;
3310 
3311     /**
3312      * REVIEW davebu
3313      */
3314     U16 dzaDescent;
3315 
3316     /**
3317      * REVIEW davebu
3318      */
3319     U16 dzaLength;
3320 
3321     /**
3322      * DP for a textbox
3323      */
3324     DPTXBX dptxbx;
3325 
3326     /**
3327      * DP for a polyline
3328      */
3329     DPPOLYLINE dpPolyLine;
3330 
3331 }; // DPCALLOUT
3332 
3333 bool operator==(const DPCALLOUT &lhs, const DPCALLOUT &rhs);
3334 bool operator!=(const DPCALLOUT &lhs, const DPCALLOUT &rhs);
3335 
3336 
3337 /**
3338  * DP data for an ellipse (DPELLIPSE)
3339  */
3340 struct DPELLIPSE {
3341     /**
3342      * Creates an empty DPELLIPSE structure and sets the defaults
3343      */
3344     DPELLIPSE();
3345     /**
3346      * Simply calls read(...)
3347      */
3348     DPELLIPSE(OLEStreamReader *stream, bool preservePos=false);
3349 
3350     /**
3351      * This method reads the DPELLIPSE structure from the stream.
3352      * If  preservePos is true we push/pop the position of
3353      * the stream to save the state. If it's false the state
3354      * of stream will be changed!
3355      */
3356     bool read(OLEStreamReader *stream, bool preservePos=false);
3357 
3358     /**
3359      * Same as reading :)
3360      */
3361     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
3362 
3363     /**
3364      * Set all the fields to the inital value (default is 0)
3365      */
3366     void clear();
3367 
3368     // Data
3369     /**
3370      * Common header for a drawing primitive
3371      */
3372     DPHEAD dphead;
3373 
3374     /**
3375      * LiNe Property Color -- RGB color value
3376      */
3377     U32 lnpc;
3378 
3379     /**
3380      * line property weight in twips
3381      */
3382     U16 lnpw;
3383 
3384     /**
3385      * line property style. See description in DPLINE.
3386      */
3387     U16 lnps;
3388 
3389     /**
3390      * FiLl Property Color ForeGround -- RGB color value
3391      */
3392     U32 dlpcFg;
3393 
3394     /**
3395      * FiLl Property Color BackGround -- RGB color value
3396      */
3397     U32 dlpcBg;
3398 
3399     /**
3400      * FiLl Property Pattern. REVIEW davebu
3401      */
3402     U16 flpp;
3403 
3404     /**
3405      * Shadow Property Intensity
3406      */
3407     U16 shdwpi;
3408 
3409     /**
3410      * x offset of shadow
3411      */
3412     U16 xaOffset;
3413 
3414     /**
3415      * y offset of shadow
3416      */
3417     U16 yaOffset;
3418 
3419 }; // DPELLIPSE
3420 
3421 bool operator==(const DPELLIPSE &lhs, const DPELLIPSE &rhs);
3422 bool operator!=(const DPELLIPSE &lhs, const DPELLIPSE &rhs);
3423 
3424 
3425 /**
3426  * DP data for a line (DPLINE)
3427  */
3428 struct DPLINE {
3429     /**
3430      * Creates an empty DPLINE structure and sets the defaults
3431      */
3432     DPLINE();
3433     /**
3434      * Simply calls read(...)
3435      */
3436     DPLINE(OLEStreamReader *stream, bool preservePos=false);
3437 
3438     /**
3439      * This method reads the DPLINE structure from the stream.
3440      * If  preservePos is true we push/pop the position of
3441      * the stream to save the state. If it's false the state
3442      * of stream will be changed!
3443      */
3444     bool read(OLEStreamReader *stream, bool preservePos=false);
3445 
3446     /**
3447      * Same as reading :)
3448      */
3449     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
3450 
3451     /**
3452      * Set all the fields to the inital value (default is 0)
3453      */
3454     void clear();
3455 
3456     // Data
3457     /**
3458      * Common header for a drawing primitive
3459      */
3460     DPHEAD dphead;
3461 
3462     /**
3463      * starting point for line
3464      */
3465     U16 xaStart;
3466 
3467     U16 yaStart;
3468 
3469     /**
3470      * ending point for line
3471      */
3472     U16 xaEnd;
3473 
3474     U16 yaEnd;
3475 
3476     /**
3477      * LiNe Property Color -- RGB color value
3478      */
3479     U32 lnpc;
3480 
3481     /**
3482      * line property weight in twips
3483      */
3484     U16 lnpw;
3485 
3486     /**
3487      * line property style
3488      * 0 Solid
3489      * 1 Dashed
3490      * 2 Dotted
3491      * 3 Dash Dot
3492      * 4 Dash Dot Dot
3493      * 5 Hollow
3494      */
3495     U16 lnps;
3496 
3497     /**
3498      * Start EndPoint Property Style 0 None
3499      * 1 Hollow
3500      * 2 Filled
3501      */
3502     U16 eppsStart:2;
3503 
3504     /**
3505      * Start EndPoint Property Weight
3506      */
3507     U16 eppwStart:2;
3508 
3509     /**
3510      * Start EndPoint Property length
3511      */
3512     U16 epplStart:2;
3513 
3514     U16 unused24_6:10;
3515 
3516     /**
3517      * End EndPoint Property Style
3518      */
3519     U16 eppsEnd:2;
3520 
3521     /**
3522      * End EndPoint Property Weight
3523      */
3524     U16 eppwEnd:2;
3525 
3526     /**
3527      * End EndPoint Property length
3528      */
3529     U16 epplEnd:2;
3530 
3531     U16 unused26_6:10;
3532 
3533     /**
3534      * Shadow Property Intensity REVIEW davebu
3535      */
3536     U16 shdwpi;
3537 
3538     /**
3539      * x offset of shadow
3540      */
3541     U16 xaOffset;
3542 
3543     /**
3544      * y offset of shadow
3545      */
3546     U16 yaOffset;
3547 
3548 }; // DPLINE
3549 
3550 bool operator==(const DPLINE &lhs, const DPLINE &rhs);
3551 bool operator!=(const DPLINE &lhs, const DPLINE &rhs);
3552 
3553 
3554 /**
3555  * DP data for a rectangle (DPRECT)
3556  */
3557 struct DPRECT {
3558     /**
3559      * Creates an empty DPRECT structure and sets the defaults
3560      */
3561     DPRECT();
3562     /**
3563      * Simply calls read(...)
3564      */
3565     DPRECT(OLEStreamReader *stream, bool preservePos=false);
3566 
3567     /**
3568      * This method reads the DPRECT structure from the stream.
3569      * If  preservePos is true we push/pop the position of
3570      * the stream to save the state. If it's false the state
3571      * of stream will be changed!
3572      */
3573     bool read(OLEStreamReader *stream, bool preservePos=false);
3574 
3575     /**
3576      * Same as reading :)
3577      */
3578     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
3579 
3580     /**
3581      * Set all the fields to the inital value (default is 0)
3582      */
3583     void clear();
3584 
3585     // Data
3586     /**
3587      * Common header for a drawing primitive
3588      */
3589     DPHEAD dphead;
3590 
3591     /**
3592      * LiNe Property Color -- RGB color value
3593      */
3594     U32 lnpc;
3595 
3596     /**
3597      * line property weight in twips
3598      */
3599     U16 lnpw;
3600 
3601     /**
3602      * line property style. See description in DPLINE.
3603      */
3604     U16 lnps;
3605 
3606     /**
3607      * FiLl Property Color ForeGround -- RGB color value
3608      */
3609     U32 dlpcFg;
3610 
3611     /**
3612      * FiLl Property Color BackGround -- RGB color value
3613      */
3614     U32 dlpcBg;
3615 
3616     /**
3617      * FiLl Property Pattern. REVIEW davebu
3618      */
3619     U16 flpp;
3620 
3621     /**
3622      * Shadow Property Intensity
3623      */
3624     U16 shdwpi;
3625 
3626     /**
3627      * x offset of shadow
3628      */
3629     U16 xaOffset;
3630 
3631     /**
3632      * y offset of shadow
3633      */
3634     U16 yaOffset;
3635 
3636     /**
3637      * 1 if the textbox has rounded corners
3638      */
3639     U16 fRoundCorners:1;
3640 
3641     /**
3642      * REVIEW davebu
3643      */
3644     U16 zaShape:15;
3645 
3646 }; // DPRECT
3647 
3648 bool operator==(const DPRECT &lhs, const DPRECT &rhs);
3649 bool operator!=(const DPRECT &lhs, const DPRECT &rhs);
3650 
3651 
3652 /**
3653  * DP data for a sample primitive holding default values (DPSAMPLE)
3654  */
3655 struct DPSAMPLE {
3656     /**
3657      * Creates an empty DPSAMPLE structure and sets the defaults
3658      */
3659     DPSAMPLE();
3660     /**
3661      * Simply calls read(...)
3662      */
3663     DPSAMPLE(OLEStreamReader *stream, bool preservePos=false);
3664 
3665     /**
3666      * This method reads the DPSAMPLE structure from the stream.
3667      * If  preservePos is true we push/pop the position of
3668      * the stream to save the state. If it's false the state
3669      * of stream will be changed!
3670      */
3671     bool read(OLEStreamReader *stream, bool preservePos=false);
3672 
3673     /**
3674      * Same as reading :)
3675      */
3676     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
3677 
3678     /**
3679      * Set all the fields to the inital value (default is 0)
3680      */
3681     void clear();
3682 
3683     // Data
3684     /**
3685      * Common header for a drawing primitive
3686      */
3687     DPHEAD dphead;
3688 
3689     /**
3690      * LiNe Property Color -- RGB color value
3691      */
3692     U32 lnpc;
3693 
3694     /**
3695      * line property weight in twips
3696      */
3697     U16 lnpw;
3698 
3699     /**
3700      * line property style. See description in DPLINE.
3701      */
3702     U16 lnps;
3703 
3704     /**
3705      * FiLl Property Color ForeGround -- RGB color value
3706      */
3707     U32 dlpcFg;
3708 
3709     /**
3710      * FiLl Property Color BackGround -- RGB color value
3711      */
3712     U32 dlpcBg;
3713 
3714     /**
3715      * FiLl Property Pattern. REVIEW davebu
3716      */
3717     U16 flpp;
3718 
3719     /**
3720      * Start EndPoint Property Style
3721      * 0 None
3722      * 1 Hollow
3723      * 2 Filled
3724      */
3725     U16 eppsStart:2;
3726 
3727     /**
3728      * Start EndPoint Property Weight
3729      */
3730     U16 eppwStart:2;
3731 
3732     /**
3733      * Start EndPoint Property length
3734      */
3735     U16 epplStart:2;
3736 
3737     U16 unused30_6:10;
3738 
3739     /**
3740      * End EndPoint Property Style
3741      */
3742     U16 eppsEnd:2;
3743 
3744     /**
3745      * End EndPoint Property Weight
3746      */
3747     U16 eppwEnd:2;
3748 
3749     /**
3750      * End EndPoint Property length
3751      */
3752     U16 epplEnd:2;
3753 
3754     U16 unused32_6:10;
3755 
3756     /**
3757      * Shadow Property Intensity
3758      */
3759     U16 shdwpi;
3760 
3761     /**
3762      * x offset of shadow
3763      */
3764     U16 xaOffset;
3765 
3766     /**
3767      * y offset of shadow
3768      */
3769     U16 yaOffset;
3770 
3771     U16 unused40;
3772 
3773     /**
3774      * REVIEW davebu
3775      */
3776     U16 dzaOffset;
3777 
3778     /**
3779      * REVIEW davebu
3780      */
3781     U16 dzaDescent;
3782 
3783     /**
3784      * REVIEW davebu
3785      */
3786     U16 dzaLength;
3787 
3788     /**
3789      * 1 if the textbox has rounded corners
3790      */
3791     U16 fRoundCorners:1;
3792 
3793     /**
3794      * REVIEW davebu
3795      */
3796     U16 zaShape:15;
3797 
3798     /**
3799      * REVIEW davebu
3800      */
3801     U16 dzaInternalMargin;
3802 
3803 }; // DPSAMPLE
3804 
3805 bool operator==(const DPSAMPLE &lhs, const DPSAMPLE &rhs);
3806 bool operator!=(const DPSAMPLE &lhs, const DPSAMPLE &rhs);
3807 
3808 
3809 /**
3810  * File Drawn Object Address (Word) (FDOA)
3811  */
3812 struct FDOA {
3813     /**
3814      * Creates an empty FDOA structure and sets the defaults
3815      */
3816     FDOA();
3817     /**
3818      * Simply calls read(...)
3819      */
3820     FDOA(OLEStreamReader *stream, bool preservePos=false);
3821 
3822     /**
3823      * This method reads the FDOA structure from the stream.
3824      * If  preservePos is true we push/pop the position of
3825      * the stream to save the state. If it's false the state
3826      * of stream will be changed!
3827      */
3828     bool read(OLEStreamReader *stream, bool preservePos=false);
3829 
3830     /**
3831      * Same as reading :)
3832      */
3833     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
3834 
3835     /**
3836      * Set all the fields to the inital value (default is 0)
3837      */
3838     void clear();
3839 
3840     // Data
3841     /**
3842      * FC pointing to drawing object data
3843      */
3844     U32 fc;
3845 
3846     /**
3847      * count of textboxes in the drawing object
3848      */
3849     U16 ctxbx;
3850 
3851 }; // FDOA
3852 
3853 bool operator==(const FDOA &lhs, const FDOA &rhs);
3854 bool operator!=(const FDOA &lhs, const FDOA &rhs);
3855 
3856 
3857 /**
3858  * Font Family Name (FFN)
3859  */
3860 /* This structure has been commented out because we can't handle it correctly
3861  * Please don't try to fix it here in this file, but rather copy this broken
3862  * structure definition and fix it in some auxilliary file. If you want to
3863  * include that aux. file here, please change the template file.
3864  */
3865 //struct FFN {
3866 //    /**
3867 //     * Creates an empty FFN structure and sets the defaults
3868 //     */
3869 //    FFN();
3870 //    /**
3871 //     * Simply calls read(...)
3872 //     */
3873 //    FFN(OLEStreamReader *stream, bool preservePos=false);
3874 //    /**
3875 //     * Attention: This struct allocates memory on the heap
3876 //     */
3877 //    FFN(const FFN &rhs);
3878 //    ~FFN();
3879 
3880 //    FFN &operator=(const FFN &rhs);
3881 
3882 //    /**
3883 //     * This method reads the FFN structure from the stream.
3884 //     * If  preservePos is true we push/pop the position of
3885 //     * the stream to save the state. If it's false the state
3886 //     * of stream will be changed!
3887 //     */
3888 //    bool read(OLEStreamReader *stream, bool preservePos=false);
3889 
3890 //    /**
3891 //     * Same as reading :)
3892 //     */
3893 //    bool write(OLEStreamWriter *stream, bool preservePos=false) const;
3894 
3895 //    /**
3896 //     * Set all the fields to the inital value (default is 0)
3897 //     */
3898 //    void clear();
3899 
3900 //    // Data
3901 //    /**
3902 //     * total length of FFN - 1.
3903 //     */
3904 //    U8 cbFfnM1;
3905 
3906 //    /**
3907 //     * pitch request
3908 //     */
3909 //    U8 prq:2;
3910 
3911 //    /**
3912 //     * when 1, font is a TrueType font
3913 //     */
3914 //    U8 fTrueType:1;
3915 
3916 //    /**
3917 //     * reserved
3918 //     */
3919 //    U8 unused1_3:1;
3920 
3921 //    /**
3922 //     * font family id
3923 //     */
3924 //    U8 ff:3;
3925 
3926 //    /**
3927 //     * reserved
3928 //     */
3929 //    U8 unused1_7:1;
3930 
3931 //    /**
3932 //     * base weight of font
3933 //     */
3934 //    U16 wWeight;
3935 
3936 //    /**
3937 //     * character set identifier
3938 //     */
3939 //    U8 chs;
3940 
3941 //    /**
3942 //     * index into ffn.szFfn to the name of the alternate font
3943 //     */
3944 //    U8 ibszAlt;
3945 
3946 //    /**
3947 //     * zero terminated string that records name of font. Possibly followed
3948 //     * by a second sz which records the name of an alternate font to use if the
3949 //     * first named font does not exist on this system. Maximal size of szFfn is
3950 //     * 65 characters.
3951 //     */
3952 //    U8 *szFfn;   //    U8 szFfn[];
3953 
3954 //private:
3955 //    void clearInternal();
3956 
3957 //}; // FFN
3958 
3959 //bool operator==(const FFN &lhs, const FFN &rhs);
3960 //bool operator!=(const FFN &lhs, const FFN &rhs);
3961 
3962 
3963 /**
3964  * File Information Block (Windows Word) (FIB)
3965  */
3966 struct FIB {
3967     /**
3968      * Creates an empty FIB structure and sets the defaults
3969      */
3970     FIB();
3971     /**
3972      * Simply calls read(...)
3973      */
3974     FIB(OLEStreamReader *stream, bool preservePos=false);
3975 
3976     /**
3977      * This method reads the FIB structure from the stream.
3978      * If  preservePos is true we push/pop the position of
3979      * the stream to save the state. If it's false the state
3980      * of stream will be changed!
3981      */
3982     bool read(OLEStreamReader *stream, bool preservePos=false);
3983 
3984     /**
3985      * Same as reading :)
3986      */
3987     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
3988 
3989     /**
3990      * Set all the fields to the inital value (default is 0)
3991      */
3992     void clear();
3993 
3994     // Data
3995     /**
3996      * magic number
3997      */
3998     U16 wIdent;
3999 
4000     /**
4001      * FIB version written
4002      */
4003     U16 nFib;
4004 
4005     /**
4006      * product version written by
4007      */
4008     U16 nProduct;
4009 
4010     /**
4011      * language stamp---localized version;
4012      * <p>In pre-WinWord2.0 files this value was the nLocale.If value is &lt;
4013      * 999, then it is the nLocale, otherwise it is the lid.
4014      */
4015     U16 lid;
4016 
4017     U16 pnNext;
4018 
4019     U16 fDot:1;
4020 
4021     U16 fGlsy:1;
4022 
4023     /**
4024      * when 1, file is in complex, fast-saved format.
4025      */
4026     U16 fComplex:1;
4027 
4028     /**
4029      * file contains 1 or more pictures
4030      */
4031     U16 fHasPic:1;
4032 
4033     /**
4034      * count of times file was quicksaved
4035      */
4036     U16 cQuickSaves:4;
4037 
4038     /**
4039      * 1 if file is encrypted, 0 if not
4040      */
4041     U16 fEncrypted:1;
4042 
4043     /**
4044      * reserved
4045      */
4046     U16 unused10_9:1;
4047 
4048     /**
4049      * =1 when user has recommended that file be read read-only
4050      */
4051     U16 fReadOnlyRecommended:1;
4052 
4053     /**
4054      * =1, when file owner has made the file write reserved
4055      */
4056     U16 fWriteReservation:1;
4057 
4058     /**
4059      * =1, when using extended character set in file
4060      */
4061     U16 fExtChar:1;
4062 
4063     /**
4064      * unused
4065      */
4066     U16 unused10_13:3;
4067 
4068     U16 nFibBack;
4069 
4070     /**
4071      * file encrypted key, only valid if fEncrypted.
4072      */
4073     U32 lKey;
4074 
4075     /**
4076      * environment in which file was created
4077      * 0 created by Win Word
4078      * 1 created by Mac Word
4079      */
4080     U8 envr;
4081 
4082     /**
4083      * reserved
4084      */
4085     U8 unused19;
4086 
4087     /**
4088      * default extended character set id for text in document stream. (overidden
4089      * by chp.chse)
4090      * 0 by default characters in doc stream should be interpreted using the
4091      * ANSI character set used by Windows
4092      * 256 characters in doc stream should be interpreted using the Macintosh
4093      * character set.
4094      */
4095     U16 chse;
4096 
4097     /**
4098      * default extended character set id for text in internal data structures
4099      * 0 by default characters in doc stream should be interpreted using the
4100      * ANSI character set used by Windows
4101      * 256 characters in doc stream should be interpreted using the Macintosh
4102      * character set.
4103      */
4104     U16 chseTables;
4105 
4106     /**
4107      * file offset of first character of text. In non-complexfiles a CP can
4108      * be transformed into an FC by the following transformation: fc = cp + fib.fcMin.
4109      */
4110     U32 fcMin;
4111 
4112     /**
4113      * file offset of last character of text in document text stream+ 1
4114      */
4115     U32 fcMac;
4116 
4117     /**
4118      * file offset of last byte written to file + 1.
4119      */
4120     U32 cbMac;
4121 
4122     /**
4123      * reserved
4124      */
4125     U32 fcSpare0;
4126 
4127     /**
4128      * reserved
4129      */
4130     U32 fcSpare1;
4131 
4132     /**
4133      * reserved
4134      */
4135     U32 fcSpare2;
4136 
4137     /**
4138      * reserved
4139      */
4140     U32 fcSpare3;
4141 
4142     /**
4143      * length of main document text stream
4144      */
4145     U32 ccpText;
4146 
4147     /**
4148      * length of footnote subdocument text stream
4149      */
4150     U32 ccpFtn;
4151 
4152     /**
4153      * length of header subdocument text stream
4154      */
4155     U32 ccpHdd;
4156 
4157     /**
4158      * length of macro subdocument text stream
4159      */
4160     U32 ccpMcr;
4161 
4162     /**
4163      * length of annotation subdocument text stream
4164      */
4165     U32 ccpAtn;
4166 
4167     /**
4168      * length of endnote subdocument text stream
4169      */
4170     U32 ccpEdn;
4171 
4172     /**
4173      * length of textbox subdocument text stream
4174      */
4175     U32 ccpTxbx;
4176 
4177     /**
4178      * length of header textbox subdocument text stream
4179      * <p>Note: when ccpFtn == 0 and ccpHdr == 0 and ccpMcr== 0 and ccpAtn ==
4180      * 0 and ccpEdn ==0 and ccpTxbx == 0 and ccpHdrTxbx == 0, then fib.fcMac =
4181      * fib.fcMin+ fib.ccpText. If either ccpFtn != 0 or ccpHdd != 0or ccpMcr !=
4182      * 0or ccpAtn != 0 or ccpEdn !=0 or ccpTxbx != 0 or ccpHdrTxbx == 0, then
4183      * fib.fcMac = fib.fcMin + fib.ccpText + fib.ccpFtn + fib.ccpHdd+ fib.ccpMcr+
4184      * fib.ccpAtn + fib.ccpEdn + fib.ccpTxbx + fib.ccpHdrTxbx + 1. The single
4185      * characterstored beginning at file position fib.fcMac - 1 must always be
4186      * a CRcharacter (ASCII 13).
4187      */
4188     U32 ccpHdrTxbx;
4189 
4190     /**
4191      * reserved
4192      */
4193     U32 ccpSpare2;
4194 
4195     /**
4196      * file offset of original allocation for STSH in file. During fast save
4197      * Word will attempt to reuse this allocation if STSH is small enough to fit.
4198      */
4199     U32 fcStshfOrig;
4200 
4201     /**
4202      * count of bytes of original STSH allocation
4203      */
4204     U32 lcbStshfOrig;
4205 
4206     /**
4207      * file offset of STSH in file.
4208      */
4209     U32 fcStshf;
4210 
4211     /**
4212      * count of bytes of current STSH allocation
4213      */
4214     U32 lcbStshf;
4215 
4216     /**
4217      * file offset of footnote reference PLC. CPs in PLC are relative to main
4218      * document text stream and give location of footnote references. The structure
4219      * stored in this plc, called the FRD (footnote reference descriptor) is two
4220      * byte long.
4221      */
4222     U32 fcPlcffndRef;
4223 
4224     /**
4225      * count of bytes of footnote reference PLC. == 0 if no footnotes defined
4226      * in document.
4227      */
4228     U32 lcbPlcffndRef;
4229 
4230     /**
4231      * file offset of footnote text PLC. CPs in PLC are relative to footnote
4232      * subdocument text stream and give location of beginnings of footnote text
4233      * for correspondings references recorded in plcffndRef. No structure is stored
4234      * in this plc. There will just be n+1 FC entries in this PLC when there are
4235      * n footnotes
4236      */
4237     U32 fcPlcffndTxt;
4238 
4239     /**
4240      * count of bytes of footnote text PLC. == 0 if no footnotes defined in
4241      * document
4242      */
4243     U32 lcbPlcffndTxt;
4244 
4245     /**
4246      * file offset of annotation reference PLC. The CPs recorded in this PLC
4247      * give the offset of annotation references in the main document.
4248      */
4249     U32 fcPlcfandRef;
4250 
4251     /**
4252      * count of bytes of annotation reference PLC.
4253      */
4254     U32 lcbPlcfandRef;
4255 
4256     /**
4257      * file offset of annotation text PLC. The Cps recorded in this PLC give
4258      * the offset of the annotation text in the annotation sub document corresponding
4259      * to the references stored in the plcfandRef. There is a 1 to 1 correspondence
4260      * between entries recorded in the plcfandTxt and the plcfandRef.
4261      */
4262     U32 fcPlcfandTxt;
4263 
4264     /**
4265      * count of bytes of the annotation text PLC
4266      */
4267     U32 lcbPlcfandTxt;
4268 
4269     /**
4270      * file offset of section descriptor PLC. CPs in PLC are relative to main
4271      * document. The length of the SED is 12 bytes.
4272      */
4273     U32 fcPlcfsed;
4274 
4275     /**
4276      * count of bytes of section descriptor PLC.
4277      */
4278     U32 lcbPlcfsed;
4279 
4280     /**
4281      * file offset of paragraph descriptor PLCfor main document which is used
4282      * by Word's Outline view. CPs in PLC are relative to main document. The length
4283      * of the PGD is 8 bytes.
4284      */
4285     U32 fcPlcfpad;
4286 
4287     /**
4288      * count of bytes of paragraph descriptor PLC. ==0 if file was never viewed
4289      * in Outline view. Should not be written by third party creators of Word
4290      * files.
4291      */
4292     U32 lcbPlcfpad;
4293 
4294     /**
4295      * file offset of PLC of paragraph heights. CPs in PLC are relative to
4296      * main document text stream. Only written for fies in complex format. Should
4297      * not be written by third party creators of Word files. The PHE is 6 bytes
4298      * long.
4299      */
4300     U32 fcPlcfphe;
4301 
4302     /**
4303      * count of bytes of paragraph height PLC. ==0 when file is non-complex.
4304      */
4305     U32 lcbPlcfphe;
4306 
4307     /**
4308      * file offset of glossary string table. This table consists of pascal
4309      * style strings (strings stored prefixed with a length byte) concatenated
4310      * one after another.
4311      */
4312     U32 fcSttbfglsy;
4313 
4314     /**
4315      * count of bytes of glossary string table.
4316      * == 0 for non-glossary documents.
4317      * !=0 for glossary documents.
4318      */
4319     U32 lcbSttbfglsy;
4320 
4321     /**
4322      * file offset of glossary PLC. CPs in PLC are relative to main document
4323      * and mark the beginnings of glossary entries and are in 1-1 correspondence
4324      * with entries of sttbfglsy. No structure is stored in this PLC. There will
4325      * be n+1 FC entries in this PLC when there are n glossary entries.
4326      */
4327     U32 fcPlcfglsy;
4328 
4329     /**
4330      * count of bytes of glossary PLC.
4331      * == 0 for non-glossary documents.
4332      * !=0 for glossary documents.
4333      */
4334     U32 lcbPlcfglsy;
4335 
4336     /**
4337      * byte offset of header PLC. CPs are relative to header subdocument and
4338      * mark the beginnings of individual headers in the header subdoc. No structure
4339      * is stored in this PLC. There will be n+1 FC entries in this PLC when there
4340      * are n headers stored for the document.
4341      */
4342     U32 fcPlcfhdd;
4343 
4344     /**
4345      * count of bytes of header PLC. == 0 if document contains no headers
4346      */
4347     U32 lcbPlcfhdd;
4348 
4349     /**
4350      * file offset of character property bin table.PLC. FCs in PLC are file
4351      * offsets. Describes text of main document and all subdocuments. The BTE
4352      * is 2 bytes long.
4353      */
4354     U32 fcPlcfbteChpx;
4355 
4356     /**
4357      * count of bytes of character property bin table PLC.
4358      */
4359     U32 lcbPlcfbteChpx;
4360 
4361     /**
4362      * file offset of paragraph property bin table.PLC. FCs in PLC are file
4363      * offsets. Describes text of main document and all subdocuments. The BTE
4364      * is 2 bytes long.
4365      */
4366     U32 fcPlcfbtePapx;
4367 
4368     /**
4369      * count of bytes of paragraph property bin table PLC.
4370      */
4371     U32 lcbPlcfbtePapx;
4372 
4373     /**
4374      * file offset of PLC reserved for private use. The SEA is 6 bytes long.
4375      */
4376     U32 fcPlcfsea;
4377 
4378     /**
4379      * count of bytes of private use PLC.
4380      */
4381     U32 lcbPlcfsea;
4382 
4383     /**
4384      * file offset of font information STTBF. The nth entry in the STTBF describes
4385      * the font that will be displayed when the chp.ftc for text is equal to n.
4386      * See the FFN file structure definition.
4387      */
4388     U32 fcSttbfffn;
4389 
4390     /**
4391      * count of bytes in sttbfffn.
4392      */
4393     U32 lcbSttbfffn;
4394 
4395     /**
4396      * offset in doc stream to the PLC of field positions in the main document.
4397      * The Cps point to the beginning CP of a field, the CP offield separator
4398      * character inside a field and the ending CP of the field. A field may be
4399      * nested within another field. 20 levels of field nesting are allowed.
4400      */
4401     U32 fcPlcffldMom;
4402 
4403     U32 lcbPlcffldMom;
4404 
4405     /**
4406      * offset in doc stream to the PLC of field positions in the header subdocument.
4407      */
4408     U32 fcPlcffldHdr;
4409 
4410     U32 lcbPlcffldHdr;
4411 
4412     /**
4413      * offset in doc stream to the PLC of field positions in the footnote
4414      * subdocument.
4415      */
4416     U32 fcPlcffldFtn;
4417 
4418     U32 lcbPlcffldFtn;
4419 
4420     /**
4421      * offset in doc stream to the PLC of field positions in the annotation
4422      * subdocument.
4423      */
4424     U32 fcPlcffldAtn;
4425 
4426     U32 lcbPlcffldAtn;
4427 
4428     /**
4429      * offset in doc stream to the PLC of field positions in the macro subdocument.
4430      */
4431     U32 fcPlcffldMcr;
4432 
4433     U32 lcbPlcffldMcr;
4434 
4435     /**
4436      * offset in document stream of the STTBF that records bookmark names
4437      * in the main document
4438      */
4439     U32 fcSttbfbkmk;
4440 
4441     U32 lcbSttbfbkmk;
4442 
4443     /**
4444      * offset in document stream of the PLCF that records the beginning CP
4445      * offsets of bookmarks in the main document. See BKF structure definition
4446      */
4447     U32 fcPlcfbkf;
4448 
4449     U32 lcbPlcfbkf;
4450 
4451     /**
4452      * offset in document stream of the PLCF that records the ending CP offsets
4453      * of bookmarks recorded in the main document. See the BKL structure definition.
4454      */
4455     U32 fcPlcfbkl;
4456 
4457     U32 lcbPlcfbkl;
4458 
4459     U32 fcCmds;
4460 
4461     U32 lcbCmds;
4462 
4463     U32 fcPlcmcr;
4464 
4465     U32 lcbPlcmcr;
4466 
4467     U32 fcSttbfmcr;
4468 
4469     U32 lcbSttbfmcr;
4470 
4471     /**
4472      * file offset of the printer driver information (names of drivers, port
4473      * etc...)
4474      */
4475     U32 fcPrDrvr;
4476 
4477     /**
4478      * count of bytes of the printer driver information (names of drivers,
4479      * port etc...)
4480      */
4481     U32 lcbPrDrvr;
4482 
4483     /**
4484      * file offset of the print environment in portrait mode.
4485      */
4486     U32 fcPrEnvPort;
4487 
4488     /**
4489      * count of bytes of the print environment in portrait mode.
4490      */
4491     U32 lcbPrEnvPort;
4492 
4493     /**
4494      * file offset of the print environment in landscape mode.
4495      */
4496     U32 fcPrEnvLand;
4497 
4498     /**
4499      * count of bytes of the print environment in landscape mode.
4500      */
4501     U32 lcbPrEnvLand;
4502 
4503     /**
4504      * file offset of Window Save State data structure. WSS contains dimensions
4505      * of document's main text window and the last selection made by Word user.
4506      */
4507     U32 fcWss;
4508 
4509     /**
4510      * count of bytes of WSS. ==0 if unable to store the window state. Should
4511      * not be written by third party creators of Word files.
4512      */
4513     U32 lcbWss;
4514 
4515     /**
4516      * file offset of document property data structure.
4517      */
4518     U32 fcDop;
4519 
4520     /**
4521      * count of bytes of document properties.
4522      */
4523     U32 lcbDop;
4524 
4525     /**
4526      * offset to STTBF of associated strings. The strings in this table specify
4527      * document summary info and the paths to special documents related to this
4528      * document. See documentation of the STTBFASSOC.
4529      */
4530     U32 fcSttbfAssoc;
4531 
4532     U32 lcbSttbfAssoc;
4533 
4534     /**
4535      * file of offset of beginning of information for complex files. Consists
4536      * of an encoding of all of the prms quoted by the document followed by the
4537      * plcpcd (piece table) for the document.
4538      */
4539     U32 fcClx;
4540 
4541     /**
4542      * count of bytes of complex file information. == 0 if file is non-complex.
4543      */
4544     U32 lcbClx;
4545 
4546     /**
4547      * file offset of page descriptor PLC for footnote subdocument. CPs in
4548      * PLC are relative to footnote subdocument. Should not be written by third
4549      * party creators of Word files.
4550      */
4551     U32 fcPlcfpgdFtn;
4552 
4553     /**
4554      * count of bytes of page descriptor PLC for footnote subdocument. ==0
4555      * if document has not been paginated. The length of the PGD is 8 bytes.
4556      */
4557     U32 lcbPlcfpgdFtn;
4558 
4559     /**
4560      * file offset of the name of the original file.fcAutosaveSource and cbAutosaveSource
4561      * should both be 0 if autosave is off.
4562      */
4563     U32 fcAutosaveSource;
4564 
4565     /**
4566      * count of bytes of the name of the original file.
4567      */
4568     U32 lcbAutosaveSource;
4569 
4570     /**
4571      * group of strings recording the names of the owners of annotations stored
4572      * in the document
4573      */
4574     U32 fcGrpStAtnOwners;
4575 
4576     /**
4577      * count of bytes of the group of strings
4578      */
4579     U32 lcbGrpStAtnOwners;
4580 
4581     /**
4582      * file offset of the sttbf that records names of bookmarks in the annotation
4583      * subdocument
4584      */
4585     U32 fcSttbfAtnbkmk;
4586 
4587     /**
4588      * length in bytes of the sttbf that records names of bookmarks in the
4589      * annotation subdocument
4590      */
4591     U32 lcbSttbfAtnbkmk;
4592 
4593     U16 wSpare4Fib;
4594 
4595     /**
4596      * the page number of the lowest numbered page in the document that records
4597      * CHPX FKP information
4598      */
4599     U16 pnChpFirst;
4600 
4601     /**
4602      * the page number of the lowest numbered page in the document that records
4603      * PAPX FKP information
4604      */
4605     U16 pnPapFirst;
4606 
4607     /**
4608      * count of CHPX FKPs recorded in file. In non-complexfiles if the number
4609      * of entries in the plcfbteChpxis less than this, the plcfbteChpxis incomplete.
4610      */
4611     U16 cpnBteChp;
4612 
4613     /**
4614      * count of PAPX FKPs recorded in file. In non-complexfiles if the number
4615      * of entries in the plcfbtePapxis less than this, the plcfbtePapxis incomplete.
4616      */
4617     U16 cpnBtePap;
4618 
4619     /**
4620      * file offset of theFDOA (drawn object) PLC for main document. ==0 if
4621      * document has no drawn objects. The length of the FDOA is 6 bytes.
4622      */
4623     U32 fcPlcfdoaMom;
4624 
4625     /**
4626      * length in bytes of the FDOA PLC of the main document
4627      */
4628     U32 lcbPlcfdoaMom;
4629 
4630     /**
4631      * file offset of theFDOA (drawn object) PLC for the header document.
4632      * ==0 if document has no drawn objects. The length of the FDOA is 6 bytes.
4633      */
4634     U32 fcPlcfdoaHdr;
4635 
4636     /**
4637      * length in bytes of the FDOA PLC of the header document
4638      */
4639     U32 lcbPlcfdoaHdr;
4640 
4641     U32 fcUnused1;
4642 
4643     U32 lcbUnused1;
4644 
4645     U32 fcUnused2;
4646 
4647     U32 lcbUnused2;
4648 
4649     /**
4650      * file offset of BKF (bookmark first) PLC of the annotation subdocument
4651      */
4652     U32 fcPlcfAtnbkf;
4653 
4654     /**
4655      * length in bytes of BKF (bookmark first) PLC of the annotation subdocument
4656      */
4657     U32 lcbPlcfAtnbkf;
4658 
4659     /**
4660      * file offset of BKL (bookmark last) PLC of the annotation subdocument
4661      */
4662     U32 fcPlcfAtnbkl;
4663 
4664     /**
4665      * length in bytes of BKL (bookmark first) PLC of the annotation subdocument
4666      */
4667     U32 lcbPlcfAtnbkl;
4668 
4669     /**
4670      * file offset of PMS (Print Merge State) information block
4671      */
4672     U32 fcPms;
4673 
4674     /**
4675      * length in bytes of PMS
4676      */
4677     U32 lcbPms;
4678 
4679     /**
4680      * file offset of form field Sttbf which contains strings used in form
4681      * field dropdown controls
4682      */
4683     U32 fcFormFldSttbf;
4684 
4685     /**
4686      * length in bytes of form field Sttbf
4687      */
4688     U32 lcbFormFldSttbf;
4689 
4690     /**
4691      * file offset of PlcfendRef which points to endnote references in the
4692      * main document stream
4693      */
4694     U32 fcPlcfendRef;
4695 
4696     U32 lcbPlcfendRef;
4697 
4698     /**
4699      * file offset of PlcfendRef which points to endnote textin the endnote
4700      * document stream which corresponds with the plcfendRef
4701      */
4702     U32 fcPlcfendTxt;
4703 
4704     U32 lcbPlcfendTxt;
4705 
4706     /**
4707      * offset to PLCF of field positions in the endnote subdoc
4708      */
4709     U32 fcPlcffldEdn;
4710 
4711     U32 lcbPlcffldEdn;
4712 
4713     /**
4714      * offset to PLCF of page boundaries in the endnote subdoc.
4715      */
4716     U32 fcPlcfpgdEdn;
4717 
4718     U32 lcbPlcfpgdEdn;
4719 
4720     U32 fcUnused3;
4721 
4722     U32 lcbUnused3;
4723 
4724     /**
4725      * offset to STTBF that records the author abbreviations for authors who
4726      * have made revisions in the document.
4727      */
4728     U32 fcSttbfRMark;
4729 
4730     U32 lcbSttbfRMark;
4731 
4732     /**
4733      * offset to STTBF that records caption titles used in the document.
4734      */
4735     U32 fcSttbfCaption;
4736 
4737     U32 lcbSttbfCaption;
4738 
4739     U32 fcSttbfAutoCaption;
4740 
4741     U32 lcbSttbfAutoCaption;
4742 
4743     /**
4744      * offset to PLCF that describes the boundaries of contributing documents
4745      * in a master document
4746      */
4747     U32 fcPlcfwkb;
4748 
4749     U32 lcbPlcfwkb;
4750 
4751     U32 fcUnused4;
4752 
4753     U32 lcbUnused4;
4754 
4755     /**
4756      * offset in doc stream of PLCF that records the beginning CP in the text
4757      * box subdoc of the text of individual text box entries
4758      */
4759     U32 fcPlcftxbxTxt;
4760 
4761     U32 lcbPlcftxbxTxt;
4762 
4763     /**
4764      * offset in doc stream of the PLCF that records field boundaries recorded
4765      * in the textbox subdoc.
4766      */
4767     U32 fcPlcffldTxbx;
4768 
4769     U32 lcbPlcffldTxbx;
4770 
4771     /**
4772      * offset in doc stream of PLCF that records the beginning CP in the header
4773      * text box subdoc of the text of individual header text box entries
4774      */
4775     U32 fcPlcfHdrtxbxTxt;
4776 
4777     U32 lcbPlcfHdrtxbxTxt;
4778 
4779     /**
4780      * offset in doc stream of the PLCF that records field boundaries recorded
4781      * in the header textbox subdoc.
4782      */
4783     U32 fcPlcffldHdrTxbx;
4784 
4785     U32 lcbPlcffldHdrTxbx;
4786 
4787     /**
4788      * Macro User storage
4789      */
4790     U32 fcStwUser;
4791 
4792     U32 lcbStwUser;
4793 
4794     U32 fcSttbttmbd;
4795 
4796     U32 lcbSttbttmbd;
4797 
4798     U32 fcUnused;
4799 
4800     U32 lcbUnused;
4801 
4802     U32 fcPgdMother;
4803 
4804     U32 lcbPgdMother;
4805 
4806     U32 fcBkdMother;
4807 
4808     U32 lcbBkdMother;
4809 
4810     U32 fcPgdFtn;
4811 
4812     U32 lcbPgdFtn;
4813 
4814     U32 fcBkdFtn;
4815 
4816     U32 lcbBkdFtn;
4817 
4818     U32 fcPgdEdn;
4819 
4820     U32 lcbPgdEdn;
4821 
4822     U32 fcBkdEdn;
4823 
4824     U32 lcbBkdEdn;
4825 
4826     U32 fcSttbfIntlFld;
4827 
4828     U32 lcbSttbfIntlFld;
4829 
4830     U32 fcRouteSlip;
4831 
4832     U32 lcbRouteSlip;
4833 
4834     U32 fcSttbSavedBy;
4835 
4836     U32 lcbSttbSavedBy;
4837 
4838     U32 fcSttbFnm;
4839 
4840     U32 lcbSttbFnm;
4841 
4842 }; // FIB
4843 
4844 bool operator==(const FIB &lhs, const FIB &rhs);
4845 bool operator!=(const FIB &lhs, const FIB &rhs);
4846 
4847 
4848 /**
4849  * Field Descriptor (FLD)
4850  */
4851 /* This structure has been commented out because we can't handle it correctly
4852  * Please don't try to fix it here in this file, but rather copy this broken
4853  * structure definition and fix it in some auxilliary file. If you want to
4854  * include that aux. file here, please change the template file.
4855  */
4856 //struct FLD {
4857 //    /**
4858 //     * Creates an empty FLD structure and sets the defaults
4859 //     */
4860 //    FLD();
4861 //    /**
4862 //     * Simply calls read(...)
4863 //     */
4864 //    FLD(OLEStreamReader *stream, bool preservePos=false);
4865 
4866 //    /**
4867 //     * This method reads the FLD structure from the stream.
4868 //     * If  preservePos is true we push/pop the position of
4869 //     * the stream to save the state. If it's false the state
4870 //     * of stream will be changed!
4871 //     */
4872 //    bool read(OLEStreamReader *stream, bool preservePos=false);
4873 
4874 //    /**
4875 //     * Same as reading :)
4876 //     */
4877 //    bool write(OLEStreamWriter *stream, bool preservePos=false) const;
4878 
4879 //    /**
4880 //     * Set all the fields to the inital value (default is 0)
4881 //     */
4882 //    void clear();
4883 
4884 //    // Data
4885 //    /**
4886 //     * type of field boundary the FLD describes.
4887 //     * 19 field begin mark
4888 //     * 20 field separator
4889 //     * 21 field end mark
4890 //     */
4891 //    U8 ch;
4892 
4893 //}; // FLD
4894 
4895 //bool operator==(const FLD &lhs, const FLD &rhs);
4896 //bool operator!=(const FLD &lhs, const FLD &rhs);
4897 
4898 
4899 /**
4900  * Line Spacing Descriptor (LSPD)
4901  */
4902 struct LSPD {
4903     /**
4904      * Creates an empty LSPD structure and sets the defaults
4905      */
4906     LSPD();
4907     /**
4908      * Simply calls read(...)
4909      */
4910     LSPD(OLEStreamReader *stream, bool preservePos=false);
4911 
4912     /**
4913      * This method reads the LSPD structure from the stream.
4914      * If  preservePos is true we push/pop the position of
4915      * the stream to save the state. If it's false the state
4916      * of stream will be changed!
4917      */
4918     bool read(OLEStreamReader *stream, bool preservePos=false);
4919 
4920     /**
4921      * Same as reading :)
4922      */
4923     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
4924 
4925     /**
4926      * Set all the fields to the inital value (default is 0)
4927      */
4928     void clear();
4929 
4930     /**
4931      * Dumps all fields of this structure (for debugging)
4932      */
4933     void dump() const;
4934 
4935     /**
4936      * Converts the data structure to a string (for debugging)
4937      */
4938     std::string toString() const;
4939 
4940     // Data
4941     /**
4942      * see description of sprmPDyaLine in the Sprm Definitions sectionfor
4943      * description of the meaning of dyaLine and fMultLinespace fields
4944      */
4945     U16 dyaLine;
4946 
4947     U16 fMultLinespace;
4948 
4949 }; // LSPD
4950 
4951 bool operator==(const LSPD &lhs, const LSPD &rhs);
4952 bool operator!=(const LSPD &lhs, const LSPD &rhs);
4953 
4954 
4955 /**
4956  * Window's (METAFILEPICT)
4957  */
4958 struct METAFILEPICT {
4959     /**
4960      * Creates an empty METAFILEPICT structure and sets the defaults
4961      */
4962     METAFILEPICT();
4963     /**
4964      * Simply calls read(...)
4965      */
4966     METAFILEPICT(OLEStreamReader *stream, bool preservePos=false);
4967 
4968     /**
4969      * This method reads the METAFILEPICT structure from the stream.
4970      * If  preservePos is true we push/pop the position of
4971      * the stream to save the state. If it's false the state
4972      * of stream will be changed!
4973      */
4974     bool read(OLEStreamReader *stream, bool preservePos=false);
4975 
4976     /**
4977      * Same as reading :)
4978      */
4979     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
4980 
4981     /**
4982      * Set all the fields to the inital value (default is 0)
4983      */
4984     void clear();
4985 
4986     /**
4987      * Dumps all fields of this structure (for debugging)
4988      */
4989     void dump() const;
4990 
4991     /**
4992      * Converts the data structure to a string (for debugging)
4993      */
4994     std::string toString() const;
4995 
4996     // Data
4997     /**
4998      * Specifies the mapping mode in which the picture is drawn.
4999      */
5000     U16 mm;
5001 
5002     /**
5003      * Specifies the size of the metafile picture for all modes except the
5004      * MM_ISOTROPIC and MM_ANISOTROPIC modes. (For more information about these
5005      * modes, see the yExt member.) The x-extent specifies the width of the rectangle
5006      * within which the picture is drawn. The coordinates are in units that correspond
5007      * to the mapping mode.
5008      */
5009     U16 xExt;
5010 
5011     /**
5012      * Specifies the size of the metafile picture for all modes except the
5013      * MM_ISOTROPIC and MM_ANISOTROPIC modes. The y-extent specifies the height
5014      * of the rectangle within which the picture is drawn. The coordinates are
5015      * in units that correspond to the mapping mode.
5016      * <p>For MM_ISOTROPIC and MM_ANISOTROPIC modes, which can be scaled, the
5017      * xExt and yExt members contain an optional suggested size in MM_HIMETRIC
5018      * units.
5019      * <p>For MM_ANISOTROPIC pictures, xExt and yExt can be zero when no suggested
5020      * size is supplied. For MM_ISOTROPIC pictures, an aspect ratio must be supplied
5021      * even when no suggested size is given. (If a suggested size is given, the
5022      * aspect ratio is implied by the size.) To give an aspect ratio without implying
5023      * a suggested size, set xExt and yExt to negative values whose ratio is the
5024      * appropriate aspect ratio. The magnitude of the negative xExt and yExt values
5025      * is ignored; only the ratio is used.
5026      */
5027     U16 yExt;
5028 
5029     /**
5030      * Identifies a memory metafile.
5031      */
5032     U16 hMF;
5033 
5034 }; // METAFILEPICT
5035 
5036 bool operator==(const METAFILEPICT &lhs, const METAFILEPICT &rhs);
5037 bool operator!=(const METAFILEPICT &lhs, const METAFILEPICT &rhs);
5038 
5039 
5040 /**
5041  * Embedded Object Properties (OBJHEADER)
5042  */
5043 struct OBJHEADER {
5044     /**
5045      * Creates an empty OBJHEADER structure and sets the defaults
5046      */
5047     OBJHEADER();
5048     /**
5049      * Simply calls read(...)
5050      */
5051     OBJHEADER(OLEStreamReader *stream, bool preservePos=false);
5052 
5053     /**
5054      * This method reads the OBJHEADER structure from the stream.
5055      * If  preservePos is true we push/pop the position of
5056      * the stream to save the state. If it's false the state
5057      * of stream will be changed!
5058      */
5059     bool read(OLEStreamReader *stream, bool preservePos=false);
5060 
5061     /**
5062      * Same as reading :)
5063      */
5064     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
5065 
5066     /**
5067      * Set all the fields to the inital value (default is 0)
5068      */
5069     void clear();
5070 
5071     // Data
5072     /**
5073      * length of object (including this header)
5074      */
5075     U32 lcb;
5076 
5077     /**
5078      * length of this header (for future use)
5079      */
5080     U16 cbHeader;
5081 
5082     /**
5083      * index to clipboard format of object
5084      */
5085     U16 icf;
5086 
5087 }; // OBJHEADER
5088 
5089 bool operator==(const OBJHEADER &lhs, const OBJHEADER &rhs);
5090 bool operator!=(const OBJHEADER &lhs, const OBJHEADER &rhs);
5091 
5092 
5093 /**
5094  * Outline LiST Data (OLST)
5095  */
5096 struct OLST {
5097     /**
5098      * Creates an empty OLST structure and sets the defaults
5099      */
5100     OLST();
5101     /**
5102      * Simply calls read(...)
5103      */
5104     OLST(OLEStreamReader *stream, bool preservePos=false);
5105     /**
5106      * Simply calls readPtr(...)
5107      */
5108     OLST(const U8 *ptr);
5109 
5110     /**
5111      * This method reads the OLST structure from the stream.
5112      * If  preservePos is true we push/pop the position of
5113      * the stream to save the state. If it's false the state
5114      * of stream will be changed!
5115      */
5116     bool read(OLEStreamReader *stream, bool preservePos=false);
5117 
5118     /**
5119      * This method reads the struct from a pointer
5120      */
5121     void readPtr(const U8 *ptr);
5122 
5123     /**
5124      * Same as reading :)
5125      */
5126     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
5127 
5128     /**
5129      * Set all the fields to the inital value (default is 0)
5130      */
5131     void clear();
5132 
5133     /**
5134      * Dumps all fields of this structure (for debugging)
5135      */
5136     void dump() const;
5137 
5138     /**
5139      * Converts the data structure to a string (for debugging)
5140      */
5141     std::string toString() const;
5142 
5143     // Size of the structure
5144     static const unsigned int sizeOf;
5145 
5146     // Data
5147     /**
5148      * an array of 9 ANLV structures describing how heading numbers should
5149      * be displayed for each of Word?s 9 outline heading levels
5150      */
5151     ANLV rganlv[9];
5152 
5153     /**
5154      * when ==1, restart heading on section break
5155      */
5156     U8 fRestartHdr;
5157 
5158     /**
5159      * reserved
5160      */
5161     U8 fSpareOlst2;
5162 
5163     /**
5164      * reserved
5165      */
5166     U8 fSpareOlst3;
5167 
5168     /**
5169      * reserved
5170      */
5171     U8 fSpareOlst4;
5172 
5173     /**
5174      * text before/after number
5175      */
5176     U8 rgch[64];
5177 
5178 }; // OLST
5179 
5180 bool operator==(const OLST &lhs, const OLST &rhs);
5181 bool operator!=(const OLST &lhs, const OLST &rhs);
5182 
5183 
5184 /**
5185  * Paragraph Properties (PAP)
5186  */
5187 struct PAP : public Shared {
5188     /**
5189      * Creates an empty PAP structure and sets the defaults
5190      */
5191     PAP();
5192     /**
5193      * Simply calls read(...)
5194      */
5195     PAP(OLEStreamReader *stream, bool preservePos=false);
5196     /**
5197      * Attention: This struct allocates memory on the heap
5198      */
5199     PAP(const PAP &rhs);
5200     ~PAP();
5201 
5202     PAP &operator=(const PAP &rhs);
5203 
5204     /**
5205      * This method reads the PAP structure from the stream.
5206      * If  preservePos is true we push/pop the position of
5207      * the stream to save the state. If it's false the state
5208      * of stream will be changed!
5209      */
5210     bool read(OLEStreamReader *stream, bool preservePos=false);
5211 
5212     /**
5213      * Same as reading :)
5214      */
5215     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
5216 
5217     /**
5218      * Set all the fields to the inital value (default is 0)
5219      */
5220     void clear();
5221 
5222     /**
5223      * Dumps all fields of this structure (for debugging)
5224      */
5225     void dump() const;
5226 
5227     /**
5228      * Converts the data structure to a string (for debugging)
5229      */
5230     std::string toString() const;
5231 
5232     // Data
5233     /**
5234      * index to style descriptor . This is an index to an STD in the STSH
5235      * structure
5236      */
5237     U16 istd;
5238 
5239     /**
5240      * justification code 0left justify
5241      * 1center
5242      * 2right justify
5243      * 3left and right justify
5244      */
5245     U8 jc;
5246 
5247     /**
5248      * keep entire paragraph on one page if possible
5249      */
5250     U8 fKeep;
5251 
5252     /**
5253      * keep paragraph on same page with next paragraph if possible
5254      */
5255     U8 fKeepFollow;
5256 
5257     /**
5258      * start this paragraph on new page
5259      */
5260     U8 fPageBreakBefore;
5261 
5262     U8 fBrLnAbove:1;
5263 
5264     U8 fBrLnBelow:1;
5265 
5266     /**
5267      * reserved
5268      */
5269     U8 fUnused:2;
5270 
5271     /**
5272      * vertical position code. Specifies coordinate frame to use when paragraphs
5273      * are absolutely positioned.
5274      * 0 vertical position coordinates are relative to margin
5275      * 1 coordinates are relative to page
5276      * 2 coordinates are relative to text.This means: relative to where the
5277      * next non-APO text would have been placed if this APO did not exist.
5278      */
5279     U8 pcVert:2;
5280 
5281     /**
5282      * horizontal position code. Specifies coordinate frame to use when paragraphs
5283      * are absolutely positioned.
5284      * 0 horiz. position coordinates are relative to column.
5285      * 1 coordinates are relative to margin
5286      * 2 coordinates are relative to page
5287      */
5288     U8 pcHorz:2;
5289 
5290     /**
5291      * rectangle border codes (the brcp and brcl fields have been superceded
5292      * by the newly defined brcLeft, brcTop, etc. fields. They remain in the PAP
5293      * for compatibility with MacWord 3.0)
5294      * 0 none
5295      * 1 border above
5296      * 2 border below
5297      * 15 box around
5298      * 16 bar to left of paragraph
5299      */
5300     U8 brcp;
5301 
5302     /**
5303      * border line style
5304      * 0 single
5305      * 1 thick
5306      * 2 double
5307      * 3 shadow
5308      */
5309     U8 brcl;
5310 
5311     /**
5312      * reserved
5313      */
5314     U8 unused9;
5315 
5316     /**
5317      * auto list numbering level (0 = nothing)
5318      */
5319     U8 nLvlAnm;
5320 
5321     /**
5322      * no line numbering for this para. (makes this an exception to the section
5323      * property of line numbering)
5324      */
5325     U8 fNoLnn;
5326 
5327     /**
5328      * when 1, paragraph is a side by side paragraph
5329      */
5330     U8 fSideBySide;
5331 
5332     /**
5333      * indent from right margin (signed).
5334      */
5335     S16 dxaRight;
5336 
5337     /**
5338      * indent from left margin (signed)
5339      */
5340     S16 dxaLeft;
5341 
5342     /**
5343      * first line indent; signed number relative to dxaLeft
5344      */
5345     S16 dxaLeft1;
5346 
5347     /**
5348      * line spacing descriptor
5349      */
5350     LSPD lspd;
5351 
5352     /**
5353      * vertical spacing before paragraph (unsigned)
5354      */
5355     U16 dyaBefore;
5356 
5357     /**
5358      * vertical spacing after paragraph (unsigned)
5359      */
5360     U16 dyaAfter;
5361 
5362     /**
5363      * height of current paragraph.
5364      */
5365     PHE phe;
5366 
5367     /**
5368      * when 1, text in paragraph may be auto hyphenated
5369      */
5370     U8 fAutoHyph;
5371 
5372     /**
5373      * when 1, Word will prevent widowed lines in this paragraph from being
5374      * placed at the beginning of a page
5375      */
5376     U8 fWidowControl;
5377 
5378     /**
5379      * when 1, paragraph is contained in a table row
5380      */
5381     U8 fInTable;
5382 
5383     /**
5384      * when 1, paragraph consists only of the row mark special character and
5385      * marks the end of a table row.
5386      */
5387     U8 fTtp;
5388 
5389     /**
5390      * used internally by Word
5391      */
5392     U16 ptap;
5393 
5394     /**
5395      * when positive, is the horizontal distance from the reference frame
5396      * specified by pap.pcHorz. 0 means paragraph is positioned at the left with
5397      * respect to the refence frame specified by pcHorz. Certain negative values
5398      * have special meaning:
5399      * -4 paragraph centered horizontally within reference frame
5400      * -8 paragraph adjusted right within reference frame
5401      * -12 paragraph placed immediately inside of reference frame
5402      * -16 paragraph placed immediately outside of reference frame
5403      */
5404     S16 dxaAbs;
5405 
5406     /**
5407      * when positive, is the vertical distance from the reference frame specified
5408      * by pap.pcVert. 0 means paragraph's y-position is unconstrained. . Certain
5409      * negative values have special meaning:
5410      * -4 paragraph is placed at top of reference frame
5411      * -8 paragraph is centered vertically within reference frame
5412      * -12 paragraph is placed at bottom of reference frame.
5413      */
5414     S16 dyaAbs;
5415 
5416     /**
5417      * when not == 0, paragraph is constrained to be dxaWidth wide, independent
5418      * of current margin or column setings.
5419      */
5420     U16 dxaWidth;
5421 
5422     /**
5423      * specification for border above paragraph
5424      */
5425     BRC brcTop;
5426 
5427     /**
5428      * specification for border to the left of paragraph
5429      */
5430     BRC brcLeft;
5431 
5432     /**
5433      * specification for border below paragraph
5434      */
5435     BRC brcBottom;
5436 
5437     /**
5438      * specification for border to the right of paragraph
5439      */
5440     BRC brcRight;
5441 
5442     /**
5443      * specification of border to place between conforming paragraphs. Two
5444      * paragraphs conform when both have borders, their brcLeft and brcRight matches,
5445      * their widths are the same, theyboth belong to tables or both do not, and
5446      * have the same absolute positioning props.
5447      */
5448     BRC brcBetween;
5449 
5450     /**
5451      * specification of border to place on outside of text when facing pages
5452      * are to be displayed.
5453      */
5454     BRC brcBar;
5455 
5456     /**
5457      * horizontal distance to be maintained between an absolutely positioned
5458      * paragraph and any non-absolute positioned text
5459      */
5460     U16 dxaFromText;
5461 
5462     /**
5463      * vertical distance to be maintained between an absolutely positioned
5464      * paragraph and any non-absolute positioned text
5465      */
5466     U16 dyaFromText;
5467 
5468     /**
5469      * Wrap Code for absolute objects
5470      */
5471     U8 wr;
5472 
5473     /**
5474      * when 1, paragraph may not be editted
5475      */
5476     U8 fLocked;
5477 
5478     /**
5479      * height of abs obj; 0 == Auto
5480      */
5481     U16 dyaHeight:15;
5482 
5483     /**
5484      * 0 = Exact, 1 = At Least
5485      */
5486     U16 fMinHeight:1;
5487 
5488     /**
5489      * shading
5490      */
5491     SHD shd;
5492 
5493     /**
5494      * drop cap specifier (see DCS definition)
5495      */
5496     DCS dcs;
5497 
5498     /**
5499      * autonumber list descriptor (see ANLD definition)
5500      */
5501     ANLD anld;
5502 
5503     /**
5504      * number of tabs stops defined for paragraph. Must be >= 0 and &lt;=
5505      * 50.
5506      */
5507     U16 itbdMac;
5508 
5509     /**
5510      * array of positions of itbdMac tab stops. itbdMax == 50
5511      */
5512     U16 *rgdxaTab;   //    U16 rgdxaTab[itbdMac];
5513 
5514     /**
5515      * array of itbdMac tab descriptors
5516      */
5517     U8 *rgtbd;   //    U8 rgtbd[itbdMac];
5518 
5519 private:
5520     void clearInternal();
5521 
5522 }; // PAP
5523 
5524 bool operator==(const PAP &lhs, const PAP &rhs);
5525 bool operator!=(const PAP &lhs, const PAP &rhs);
5526 
5527 
5528 /**
5529  * Paragraph Property Exceptions (PAPX)
5530  */
5531 /* This structure has been commented out because we can't handle it correctly
5532  * Please don't try to fix it here in this file, but rather copy this broken
5533  * structure definition and fix it in some auxilliary file. If you want to
5534  * include that aux. file here, please change the template file.
5535  */
5536 //struct PAPX {
5537 //    /**
5538 //     * Creates an empty PAPX structure and sets the defaults
5539 //     */
5540 //    PAPX();
5541 //    /**
5542 //     * Simply calls read(...)
5543 //     */
5544 //    PAPX(OLEStreamReader *stream, bool preservePos=false);
5545 //    /**
5546 //     * Attention: This struct allocates memory on the heap
5547 //     */
5548 //    PAPX(const PAPX &rhs);
5549 //    ~PAPX();
5550 
5551 //    PAPX &operator=(const PAPX &rhs);
5552 
5553 //    /**
5554 //     * This method reads the PAPX structure from the stream.
5555 //     * If  preservePos is true we push/pop the position of
5556 //     * the stream to save the state. If it's false the state
5557 //     * of stream will be changed!
5558 //     */
5559 //    bool read(OLEStreamReader *stream, bool preservePos=false);
5560 
5561 //    /**
5562 //     * Same as reading :)
5563 //     */
5564 //    bool write(OLEStreamWriter *stream, bool preservePos=false) const;
5565 
5566 //    /**
5567 //     * Set all the fields to the inital value (default is 0)
5568 //     */
5569 //    void clear();
5570 
5571 //    // Data
5572 //    /**
5573 //     * count of words of following data in PAPX. The first byte of a PAPX
5574 //     * is a count of words when PAPX is stored in an FKP. Count of words is used
5575 //     * because PAPX in an FKP can contain paragraph and table sprms.
5576 //     */
5577 //    U8 cw;
5578 
5579 //    /**
5580 //     * count of bytes of following data in PAPX. The first byte of a PAPX
5581 //     * is a count of bytes when a PAPX is stored in a STSH. Count of bytes is
5582 //     * used because only paragraph sprms are stored in a STSH PAPX.
5583 //     */
5584 //    U8 cb;
5585 
5586 //    /**
5587 //     * index to style descriiptor of the style from which the paragraph inherits
5588 //     * its paragraph and character properties
5589 //     */
5590 //    U8 istd;
5591 
5592 //    /**
5593 //     * a list of the sprms that encode the differences between PAP for a paragraph
5594 //     * and the PAP for the style used. When a paragraph bound is also the end
5595 //     * of a table row, the PAPX also contains a list of table sprms which express
5596 //     * the difference of table row's TAP from an empty TAP that has been cleared
5597 //     * to zeros. The table sprms are recorded in the list after all of the paragraph
5598 //     * sprms.See Sprms definitions for list of sprms that are used in PAPXs.
5599 //     */
5600 //    U8 *grpprl;   //    U8 grpprl[];
5601 
5602 //private:
5603 //    void clearInternal();
5604 
5605 //}; // PAPX
5606 
5607 //bool operator==(const PAPX &lhs, const PAPX &rhs);
5608 //bool operator!=(const PAPX &lhs, const PAPX &rhs);
5609 
5610 
5611 /**
5612  * Formatted Disk Page for PAPXs (PAPXFKP)
5613  */
5614 /* This structure has been commented out because we can't handle it correctly
5615  * Please don't try to fix it here in this file, but rather copy this broken
5616  * structure definition and fix it in some auxilliary file. If you want to
5617  * include that aux. file here, please change the template file.
5618  */
5619 //struct PAPXFKP {
5620 //    /**
5621 //     * Creates an empty PAPXFKP structure and sets the defaults
5622 //     */
5623 //    PAPXFKP();
5624 //    /**
5625 //     * Simply calls read(...)
5626 //     */
5627 //    PAPXFKP(OLEStreamReader *stream, bool preservePos=false);
5628 //    /**
5629 //     * Attention: This struct allocates memory on the heap
5630 //     */
5631 //    PAPXFKP(const PAPXFKP &rhs);
5632 //    ~PAPXFKP();
5633 
5634 //    PAPXFKP &operator=(const PAPXFKP &rhs);
5635 
5636 //    /**
5637 //     * This method reads the PAPXFKP structure from the stream.
5638 //     * If  preservePos is true we push/pop the position of
5639 //     * the stream to save the state. If it's false the state
5640 //     * of stream will be changed!
5641 //     */
5642 //    bool read(OLEStreamReader *stream, bool preservePos=false);
5643 
5644 //    /**
5645 //     * Same as reading :)
5646 //     */
5647 //    bool write(OLEStreamWriter *stream, bool preservePos=false) const;
5648 
5649 //    /**
5650 //     * Set all the fields to the inital value (default is 0)
5651 //     */
5652 //    void clear();
5653 
5654 //    // Data
5655 //    /**
5656 //     * Each FC is the limit FC of a paragraph (ie. points to the next character
5657 //     * past an end of paragraph mark). There will be fkp.crun+1 recorded in the
5658 //     * FKP.
5659 //     */
5660 //    FC *rgfc;   //    FC rgfc[fkp.crun+1];
5661 
5662 //    /**
5663 //     * an array of the BX data structure. The ith BX entry in the array describes
5664 //     * the paragraph beginning at fkp.rgfc[i]. The BX is a seven byte data structure.
5665 //     * The first byte of each BX is the word offset of thePAPX recorded for the
5666 //     * paragraph corresponding to this BX. ..If the byte stored is 0, this represents
5667 //     * a 1 line paragraph 15 pixels high with Normal style (stc == 0) whose column
5668 //     * width is 7980 dxas.
5669 //     * <p>The last six bytes of the BX is a PHE structure which stores the current
5670 //     * paragraph height for the paragraph corresponding to the BX. If a plcfphe
5671 //     * has an entry that maps to the FC for this paragraph, that entry?s PHE overides
5672 //     * the PHE stored in the FKP.
5673 //     */
5674 //    BX *rgbx;   //    BX rgbx[fkp.crun];
5675 
5676 //    /**
5677 //     * As new runs/paragraphs are recorded in the FKP,unused space is reduced
5678 //     * by 11 if CHPX/PAPX is already recorded and is reduced by11+sizeof(PAPX)
5679 //     * if property is not already recorded.
5680 //     */
5681 //    U8 *unusedSpace;   //    U8 unusedSpace[];
5682 
5683 //    /**
5684 //     * grppapx consists of all of the PAPXs stored in FKP concatenated end
5685 //     * to end. Each PAPX begins with a count of words which records its length
5686 //     * padded to a word boundary.
5687 //     */
5688 //    U8 *grppapx;   //    U8 grppapx[];
5689 
5690 //    /**
5691 //     * count of paragraphs for PAPX FKP.
5692 //     */
5693 //    U8 crun;
5694 
5695 //private:
5696 //    void clearInternal();
5697 
5698 //}; // PAPXFKP
5699 
5700 //bool operator==(const PAPXFKP &lhs, const PAPXFKP &rhs);
5701 //bool operator!=(const PAPXFKP &lhs, const PAPXFKP &rhs);
5702 
5703 
5704 /**
5705  * Piece Descriptor (PCD)
5706  */
5707 struct PCD {
5708     /**
5709      * Creates an empty PCD structure and sets the defaults
5710      */
5711     PCD();
5712     /**
5713      * Simply calls read(...)
5714      */
5715     PCD(OLEStreamReader *stream, bool preservePos=false);
5716     /**
5717      * Simply calls readPtr(...)
5718      */
5719     PCD(const U8 *ptr);
5720 
5721     /**
5722      * This method reads the PCD structure from the stream.
5723      * If  preservePos is true we push/pop the position of
5724      * the stream to save the state. If it's false the state
5725      * of stream will be changed!
5726      */
5727     bool read(OLEStreamReader *stream, bool preservePos=false);
5728 
5729     /**
5730      * This method reads the struct from a pointer
5731      */
5732     void readPtr(const U8 *ptr);
5733 
5734     /**
5735      * Same as reading :)
5736      */
5737     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
5738 
5739     /**
5740      * Set all the fields to the inital value (default is 0)
5741      */
5742     void clear();
5743 
5744     // Size of the structure
5745     static const unsigned int sizeOf;
5746 
5747     // Data
5748     /**
5749      * when 1, means that piece contains no end of paragraph marks.
5750      */
5751     U16 fNoParaLast:1;
5752 
5753     /**
5754      * used internally by Word
5755      */
5756     U16 fPaphNil:1;
5757 
5758     /**
5759      * used internally by Word
5760      */
5761     U16 fCopied:1;
5762 
5763     U16 unused0_3:5;
5764 
5765     /**
5766      * used internally by Word
5767      */
5768     U16 fn:8;
5769 
5770     /**
5771      * file offset of beginning of piece. The size of the ithpiece can be
5772      * determined by subtracting rgcp[i] of the containing plcfpcd from its rgcp[i+1].
5773      */
5774     U32 fc;
5775 
5776     /**
5777      * contains either a single sprm or else an index number of the grpprl
5778      * which contains the sprms that modify the properties of the piece.
5779      */
5780     PRM prm;
5781 
5782 }; // PCD
5783 
5784 bool operator==(const PCD &lhs, const PCD &rhs);
5785 bool operator!=(const PCD &lhs, const PCD &rhs);
5786 
5787 
5788 /**
5789  * Page Descriptor (PGD)
5790  */
5791 struct PGD {
5792     /**
5793      * Creates an empty PGD structure and sets the defaults
5794      */
5795     PGD();
5796     /**
5797      * Simply calls read(...)
5798      */
5799     PGD(OLEStreamReader *stream, bool preservePos=false);
5800 
5801     /**
5802      * This method reads the PGD structure from the stream.
5803      * If  preservePos is true we push/pop the position of
5804      * the stream to save the state. If it's false the state
5805      * of stream will be changed!
5806      */
5807     bool read(OLEStreamReader *stream, bool preservePos=false);
5808 
5809     /**
5810      * Same as reading :)
5811      */
5812     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
5813 
5814     /**
5815      * Set all the fields to the inital value (default is 0)
5816      */
5817     void clear();
5818 
5819     // Data
5820     U16 unused0_0:5;
5821 
5822     /**
5823      * redefine fEmptyPage and fAllFtn. true when blank page or footnote only
5824      * page
5825      */
5826     U16 fGhost:2;
5827 
5828     U16 unused0_7:9;
5829 
5830     /**
5831      * 1 only when footnote is continued from previous page
5832      */
5833     U16 fContinue:1;
5834 
5835     /**
5836      * 1 when page is dirty (ie. pagination cannot be trusted)
5837      */
5838     U16 fUnk:1;
5839 
5840     /**
5841      * 1 when right hand side page
5842      */
5843     U16 fRight:1;
5844 
5845     /**
5846      * 1 when page number must be reset to 1.
5847      */
5848     U16 fPgnRestart:1;
5849 
5850     /**
5851      * 1 when section break forced page to be empty.
5852      */
5853     U16 fEmptyPage:1;
5854 
5855     /**
5856      * 1 when page contains nothing but footnotes
5857      */
5858     U16 fAllFtn:1;
5859 
5860     U16 fColOnly:1;
5861 
5862     U16 fTableBreaks:1;
5863 
5864     U16 fMarked:1;
5865 
5866     U16 fColumnBreaks:1;
5867 
5868     U16 fTableHeader:1;
5869 
5870     U16 fNewPage:1;
5871 
5872     /**
5873      * section break code
5874      */
5875     U16 bkc:4;
5876 
5877     /**
5878      * line number of first line, -1 if no line numbering
5879      */
5880     U16 lnn;
5881 
5882     /**
5883      * page number as printed
5884      */
5885     U16 pgn;
5886 
5887 }; // PGD
5888 
5889 bool operator==(const PGD &lhs, const PGD &rhs);
5890 bool operator!=(const PGD &lhs, const PGD &rhs);
5891 
5892 
5893 /**
5894  * Picture Descriptor (PICF)
5895  */
5896 struct PICF : public Shared {
5897     /**
5898      * Creates an empty PICF structure and sets the defaults
5899      */
5900     PICF();
5901     /**
5902      * Simply calls read(...)
5903      */
5904     PICF(OLEStreamReader *stream, bool preservePos=false);
5905 
5906     /**
5907      * This method reads the PICF structure from the stream.
5908      * If  preservePos is true we push/pop the position of
5909      * the stream to save the state. If it's false the state
5910      * of stream will be changed!
5911      */
5912     bool read(OLEStreamReader *stream, bool preservePos=false);
5913 
5914     /**
5915      * Same as reading :)
5916      */
5917     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
5918 
5919     /**
5920      * Set all the fields to the inital value (default is 0)
5921      */
5922     void clear();
5923 
5924     /**
5925      * Dumps all fields of this structure (for debugging)
5926      */
5927     void dump() const;
5928 
5929     /**
5930      * Converts the data structure to a string (for debugging)
5931      */
5932     std::string toString() const;
5933 
5934     // Data
5935     /**
5936      * number of bytes in the PIC structure plus size of following picture
5937      * data which may be a Window's metafile, a bitmap, or the filename of a TIFF
5938      * file.
5939      */
5940     U32 lcb;
5941 
5942     /**
5943      * number of bytes in the PIC (to allow for future expansion).
5944      */
5945     U16 cbHeader;
5946 
5947     /**
5948      * If a Windows metafiles is stored immediatelly followingthe PIC structure,
5949      * the mfp is a Window's METAFILEPICT structure. When the data immediately
5950      * following the PIC is aTIFF filename, mfp.mm == 98. If a bitmap is stored
5951      * after the pic,mfp.mm == 99
5952      * When the PIC describes a bitmap, mfp.xExt is the width of the bitmap
5953      * in pixels and mfp.yExt is the height of the bitmap in pixels..
5954      */
5955     METAFILEPICT mfp;
5956 
5957     /**
5958      * Window's bitmap structure when PIC describes a BITMAP. rect for window
5959      * origin and extents whenmetafile is stored -- ignored if 0
5960      */
5961     U8 bm_rcWinMF[14];
5962 
5963     /**
5964      * horizontalmeasurement in twips of therectangle the picture should be
5965      * imaged within.
5966      */
5967     U16 dxaGoal;
5968 
5969     /**
5970      * verticalmeasurement in twips of therectangle the picture should be
5971      * imaged within. when scaling bitmaps, dxaGoal and dyaGoal may be ignored
5972      * if the operation would cause the bitmap to shrink or grow by anon -power-of-two
5973      * factor
5974      */
5975     U16 dyaGoal;
5976 
5977     /**
5978      * horizontal scaling factor supplied by user expressedin .001% units.
5979      */
5980     U16 mx;
5981 
5982     /**
5983      * vertical scaling factor supplied by user expressed in .001% units.
5984      * for all of the Crop values, a positive measurement means the specified
5985      * border has been moved inward from its original setting and a negative measurement
5986      * means the borderhas been moved outward from its original setting.
5987      */
5988     U16 my;
5989 
5990     /**
5991      * the amount the picture has been cropped on the left in twips.
5992      */
5993     U16 dxaCropLeft;
5994 
5995     /**
5996      * the amount the picture has been cropped on the top in twips.
5997      */
5998     U16 dyaCropTop;
5999 
6000     /**
6001      * the amount the picture has been cropped on the right in twips.
6002      */
6003     U16 dxaCropRight;
6004 
6005     /**
6006      * the amount the picture has been cropped on the bottom in twips.
6007      */
6008     U16 dyaCropBottom;
6009 
6010     /**
6011      * Obsolete, superseded by brcTop, etc.In WinWord 1.x, it was the type
6012      * of border to place around picture
6013      * 0 single
6014      * 1 thick
6015      * 2 double
6016      * 3 shadow
6017      */
6018     U16 brcl:4;
6019 
6020     /**
6021      * picture consists of a single frame
6022      */
6023     U16 fFrameEmpty:1;
6024 
6025     /**
6026      * ==1, when picture is just a bitmap
6027      */
6028     U16 fBitmap:1;
6029 
6030     /**
6031      * ==1, when picture is an active OLE object
6032      */
6033     U16 fDrawHatch:1;
6034 
6035     /**
6036      * ==1, when picture is just an error message
6037      */
6038     U16 fError:1;
6039 
6040     /**
6041      * bits per pixel
6042      * 0 unknown
6043      * 1 monochrome
6044      * 4
6045      */
6046     U16 bpp:8;
6047 
6048     /**
6049      * specification for border above picture
6050      */
6051     BRC brcTop;
6052 
6053     /**
6054      * specification for border to the left of picture
6055      */
6056     BRC brcLeft;
6057 
6058     /**
6059      * specification for border below picture
6060      */
6061     BRC brcBottom;
6062 
6063     /**
6064      * specification for border to the right of picture
6065      */
6066     BRC brcRight;
6067 
6068     /**
6069      * horizontal offset of hand annotation origin
6070      */
6071     U16 dxaOrigin;
6072 
6073     /**
6074      * vertical offset of hand annotation origin
6075      */
6076     U16 dyaOrigin;
6077 
6078 }; // PICF
6079 
6080 bool operator==(const PICF &lhs, const PICF &rhs);
6081 bool operator!=(const PICF &lhs, const PICF &rhs);
6082 
6083 
6084 /**
6085  * Plex of CPs stored in File (PLCF)
6086  */
6087 /* This structure has been commented out because we can't handle it correctly
6088  * Please don't try to fix it here in this file, but rather copy this broken
6089  * structure definition and fix it in some auxilliary file. If you want to
6090  * include that aux. file here, please change the template file.
6091  */
6092 //struct PLCF {
6093 //    /**
6094 //     * Creates an empty PLCF structure and sets the defaults
6095 //     */
6096 //    PLCF();
6097 //    /**
6098 //     * Simply calls read(...)
6099 //     */
6100 //    PLCF(OLEStreamReader *stream, bool preservePos=false);
6101 //    /**
6102 //     * Attention: This struct allocates memory on the heap
6103 //     */
6104 //    PLCF(const PLCF &rhs);
6105 //    ~PLCF();
6106 
6107 //    PLCF &operator=(const PLCF &rhs);
6108 
6109 //    /**
6110 //     * This method reads the PLCF structure from the stream.
6111 //     * If  preservePos is true we push/pop the position of
6112 //     * the stream to save the state. If it's false the state
6113 //     * of stream will be changed!
6114 //     */
6115 //    bool read(OLEStreamReader *stream, bool preservePos=false);
6116 
6117 //    /**
6118 //     * Same as reading :)
6119 //     */
6120 //    bool write(OLEStreamWriter *stream, bool preservePos=false) const;
6121 
6122 //    /**
6123 //     * Set all the fields to the inital value (default is 0)
6124 //     */
6125 //    void clear();
6126 
6127 //    // Data
6128 //    /**
6129 //     * given that the size of PLCF is cb and the size of the structure stored
6130 //     * in plc is cbStruct, then the number of structure instances stored in PLCF,
6131 //     * iMac is given by (cb -4)/(4 + cbStruct) The number of FCs stored in the
6132 //     * PLCF will be iMac + 1.
6133 //     */
6134 //    FC *rgfc;   //    FC rgfc[];
6135 
6136 //    struct *rgstruct;   //    struct rgstruct[];
6137 
6138 //private:
6139 //    void clearInternal();
6140 
6141 //}; // PLCF
6142 
6143 //bool operator==(const PLCF &lhs, const PLCF &rhs);
6144 //bool operator!=(const PLCF &lhs, const PLCF &rhs);
6145 
6146 
6147 /**
6148  * Section Descriptor (SED)
6149  */
6150 struct SED {
6151     /**
6152      * Creates an empty SED structure and sets the defaults
6153      */
6154     SED();
6155     /**
6156      * Simply calls read(...)
6157      */
6158     SED(OLEStreamReader *stream, bool preservePos=false);
6159 
6160     /**
6161      * This method reads the SED structure from the stream.
6162      * If  preservePos is true we push/pop the position of
6163      * the stream to save the state. If it's false the state
6164      * of stream will be changed!
6165      */
6166     bool read(OLEStreamReader *stream, bool preservePos=false);
6167 
6168     /**
6169      * Same as reading :)
6170      */
6171     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
6172 
6173     /**
6174      * Set all the fields to the inital value (default is 0)
6175      */
6176     void clear();
6177 
6178     // Size of the structure
6179     static const unsigned int sizeOf;
6180 
6181     // Data
6182     /**
6183      * runtime flag, indicates whether orientation should be changed before
6184      * printing. 0 indicates no change, 1 indicates orientation change.
6185      */
6186     U16 fSwap:1;
6187 
6188     /**
6189      * used internally by Windows Word
6190      */
6191     U16 fUnk:1;
6192 
6193     /**
6194      * used internally by Windows Word
6195      */
6196     U16 fn:14;
6197 
6198     /**
6199      * file offset to beginning of SEPX stored for section. If sed.fcSepx==
6200      * 0xFFFFFFFF, the section properties for the section are equal to the standard
6201      * SEP (see SEP definition).
6202      */
6203     U32 fcSepx;
6204 
6205     /**
6206      * used internally by Windows Word
6207      */
6208     U16 fnMpr;
6209 
6210     /**
6211      * points to offset in FC space where the Macintosh Print Record for a
6212      * document created on a Mac will be stored
6213      */
6214     U32 fcMpr;
6215 
6216 }; // SED
6217 
6218 bool operator==(const SED &lhs, const SED &rhs);
6219 bool operator!=(const SED &lhs, const SED &rhs);
6220 
6221 
6222 /**
6223  * Section Properties (SEP)
6224  */
6225 struct SEP : public Shared {
6226     /**
6227      * Creates an empty SEP structure and sets the defaults
6228      */
6229     SEP();
6230     /**
6231      * Simply calls read(...)
6232      */
6233     SEP(OLEStreamReader *stream, bool preservePos=false);
6234 
6235     /**
6236      * This method reads the SEP structure from the stream.
6237      * If  preservePos is true we push/pop the position of
6238      * the stream to save the state. If it's false the state
6239      * of stream will be changed!
6240      */
6241     bool read(OLEStreamReader *stream, bool preservePos=false);
6242 
6243     /**
6244      * Same as reading :)
6245      */
6246     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
6247 
6248     /**
6249      * Set all the fields to the inital value (default is 0)
6250      */
6251     void clear();
6252 
6253     /**
6254      * Dumps all fields of this structure (for debugging)
6255      */
6256     void dump() const;
6257 
6258     /**
6259      * Converts the data structure to a string (for debugging)
6260      */
6261     std::string toString() const;
6262 
6263     // Data
6264     /**
6265      * break code:
6266      * 0 No break
6267      * 1 New column
6268      * 2 New page
6269      * 3 Even page
6270      * 4 Odd page
6271      */
6272     U8 bkc;
6273 
6274     /**
6275      * set to 1 when a title page is to be displayed
6276      */
6277     U8 fTitlePage;
6278 
6279     /**
6280      * number of columns in section - 1.
6281      */
6282     U16 ccolM1;
6283 
6284     /**
6285      * distance that will be maintained between columns
6286      */
6287     U16 dxaColumns;
6288 
6289     /**
6290      * only for Mac compatability, used only during open, when 1, sep.dxaPgn
6291      * and sep.dyaPgn are valid page number locations
6292      */
6293     U8 fAutoPgn;
6294 
6295     /**
6296      * page number format code:
6297      * 0Arabic numbering
6298      * 1 Upper case Roman
6299      * 2 Lower case Roman
6300      * 3 Upper case Letter
6301      * 4 Lower case letter
6302      * 5 Ordinal
6303      */
6304     U8 nfcPgn;
6305 
6306     /**
6307      * user specified starting page number.
6308      */
6309     U16 pgnStart;
6310 
6311     /**
6312      * set to 1, when a section in a locked document is unlocked
6313      */
6314     U8 fUnlocked;
6315 
6316     /**
6317      * chapter number separator for page numbers
6318      */
6319     U8 cnsPgn;
6320 
6321     /**
6322      * set to 1 when page numbering should be restarted at the beginning of
6323      * this section
6324      */
6325     U8 fPgnRestart;
6326 
6327     /**
6328      * when 1, footnotes placed at end of section. When 0, footnotes are placed
6329      * at bottom of page.
6330      */
6331     U8 fEndNote;
6332 
6333     /**
6334      * line numbering code:
6335      * 0 Per page
6336      * 1 Restart
6337      * 2 Continue
6338      */
6339     U8 lnc;
6340 
6341     /**
6342      * specification of which headers and footers are included in this section.
6343      * See explanation inHeaders and Footers topic.
6344      */
6345     U8 grpfIhdt;
6346 
6347     /**
6348      * if 0, no line numbering, otherwise this is the line number modulus
6349      * (e.g. if nLnnMod is 5, line numbers appear on line 5, 10, etc.)
6350      */
6351     U16 nLnnMod;
6352 
6353     /**
6354      * distance of
6355      */
6356     U16 dxaLnn;
6357 
6358     /**
6359      * y position of top header measured from top edge of page.
6360      */
6361     U16 dyaHdrTop;
6362 
6363     /**
6364      * y position of top header measured from top edge of page.
6365      */
6366     U16 dyaHdrBottom;
6367 
6368     /**
6369      * when fAutoPgn ==1, gives the x position of auto page number on page
6370      * in twips (for Mac compatabilty only)
6371      */
6372     U16 dxaPgn;
6373 
6374     /**
6375      * when fAutoPgn ==1, gives the y position of auto page number on page
6376      * in twips (for Mac compatabilty only)
6377      */
6378     U16 dyaPgn;
6379 
6380     /**
6381      * when ==1, draw vertical lines between columns
6382      */
6383     U8 fLBetween;
6384 
6385     /**
6386      * vertical justification code
6387      * 0 top justified
6388      * 1 centered
6389      * 2 fully justified vertically
6390      * 3 bottom justified
6391      */
6392     U8 vjc;
6393 
6394     /**
6395      * beginning line number for section
6396      */
6397     U16 lnnMin;
6398 
6399     /**
6400      * orientation of pages in that section.set to 0 when portrait, 1 when
6401      * landscape
6402      */
6403     U8 dmOrientPage;
6404 
6405     /**
6406      * heading number level for page number
6407      */
6408     U8 iHeadingPgn;
6409 
6410     /**
6411      * width of page default value is 12240 twips
6412      */
6413     U16 xaPage;
6414 
6415     /**
6416      * height of page default value is 15840 twips
6417      */
6418     U16 yaPage;
6419 
6420     /**
6421      * left margin default value is 1800 twips
6422      */
6423     U16 dxaLeft;
6424 
6425     /**
6426      * right margin default value is 1800 twips
6427      */
6428     U16 dxaRight;
6429 
6430     /**
6431      * top margin default value is 1440 twips
6432      */
6433     U16 dyaTop;
6434 
6435     /**
6436      * bottom margin default value is 1440 twips
6437      */
6438     U16 dyaBottom;
6439 
6440     /**
6441      * gutter width default value is 0 twips
6442      */
6443     U16 dzaGutter;
6444 
6445     /**
6446      * bin number supplied from windows printer driver indicating which bin
6447      * the first page of section will be printed.
6448      */
6449     U16 dmBinFirst;
6450 
6451     /**
6452      * bin number supplied from windows printer driver indicating which bin
6453      * the pages other than the first page of section will be printed.
6454      */
6455     U16 dmBinOther;
6456 
6457     /**
6458      * dmPaper code for form selected by user
6459      */
6460     U16 dmPaperReq;
6461 
6462     /**
6463      * when == 1, columns are evenly spaced. Default value is 1.
6464      */
6465     U8 fEvenlySpaced;
6466 
6467     /**
6468      * reserved
6469      */
6470     U8 unused55;
6471 
6472     /**
6473      * used internally by Word
6474      */
6475     U16 dxaColumnWidth;
6476 
6477     /**
6478      * array of 89 Xas that determine bounds of irregular width columns
6479      */
6480     U16 rgdxaColumnWidthSpacing[89];
6481 
6482     /**
6483      * multilevel autonumbering list data (see OLST definition)
6484      */
6485     OLST olstAnm;
6486 
6487 }; // SEP
6488 
6489 bool operator==(const SEP &lhs, const SEP &rhs);
6490 bool operator!=(const SEP &lhs, const SEP &rhs);
6491 
6492 
6493 /**
6494  * Section Property Exceptions (SEPX)
6495  */
6496 struct SEPX {
6497     /**
6498      * Creates an empty SEPX structure and sets the defaults
6499      */
6500     SEPX();
6501     /**
6502      * Simply calls read(...)
6503      */
6504     SEPX(OLEStreamReader *stream, bool preservePos=false);
6505     /**
6506      * Attention: This struct allocates memory on the heap
6507      */
6508     SEPX(const SEPX &rhs);
6509     ~SEPX();
6510 
6511     SEPX &operator=(const SEPX &rhs);
6512 
6513     /**
6514      * This method reads the SEPX structure from the stream.
6515      * If  preservePos is true we push/pop the position of
6516      * the stream to save the state. If it's false the state
6517      * of stream will be changed!
6518      */
6519     bool read(OLEStreamReader *stream, bool preservePos=false);
6520 
6521     /**
6522      * Same as reading :)
6523      */
6524     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
6525 
6526     /**
6527      * Set all the fields to the inital value (default is 0)
6528      */
6529     void clear();
6530 
6531     // Data
6532     /**
6533      * count of bytes in remainder of SEPX.
6534      */
6535     U8 cb;
6536 
6537     /**
6538      * list of sprms that encodes the differences between the properties of
6539      * a section and Word's default section properties.
6540      */
6541     U8 *grpprl;   //    U8 grpprl[];
6542 
6543 private:
6544     void clearInternal();
6545 
6546 }; // SEPX
6547 
6548 bool operator==(const SEPX &lhs, const SEPX &rhs);
6549 bool operator!=(const SEPX &lhs, const SEPX &rhs);
6550 
6551 
6552 /**
6553  * STyleSHeet Information (STSHI)
6554  */
6555 struct STSHI {
6556     /**
6557      * Creates an empty STSHI structure and sets the defaults
6558      */
6559     STSHI();
6560     /**
6561      * Simply calls read(...)
6562      */
6563     STSHI(OLEStreamReader *stream, bool preservePos=false);
6564 
6565     /**
6566      * This method reads the STSHI structure from the stream.
6567      * If  preservePos is true we push/pop the position of
6568      * the stream to save the state. If it's false the state
6569      * of stream will be changed!
6570      */
6571     bool read(OLEStreamReader *stream, bool preservePos=false);
6572 
6573     /**
6574      * Same as reading :)
6575      */
6576     bool write(OLEStreamWriter *stream, bool preservePos=false) const;
6577 
6578     /**
6579      * Set all the fields to the inital value (default is 0)
6580      */
6581     void clear();
6582 
6583     // Size of the structure
6584     static const unsigned int sizeOf;
6585 
6586     // Data
6587     /**
6588      * Count of styles in stylesheet
6589      */
6590     U16 cstd;
6591 
6592     /**
6593      * Length of STD Base as stored in a file
6594      */
6595     U16 cbSTDBaseInFile;
6596 
6597     /**
6598      * Are built-in stylenames stored?
6599      */
6600     U16 fStdStylenamesWritten:1;
6601 
6602     /**
6603      * Spare flags
6604      */
6605     U16 unused4_2:15;
6606 
6607     /**
6608      * Max sti known when this file was written
6609      */
6610     U16 stiMaxWhenSaved;
6611 
6612     /**
6613      * How many fixed-index istds are there?
6614      */
6615     U16 istdMaxFixedWhenSaved;
6616 
6617     /**
6618      * Current version of built-in stylenames
6619      */
6620     U16 nVerBuiltInNamesWhenSaved;
6621 
6622     /**
6623      * ftc used by StandardChpStsh for this document
6624      */
6625     U16 ftcStandardChpStsh;
6626 
6627 }; // STSHI
6628 
6629 bool operator==(const STSHI &lhs, const STSHI &rhs);
6630 bool operator!=(const STSHI &lhs, const STSHI &rhs);
6631 
6632 
6633 
6634 } // namespace Word95
6635 
6636 } // namespace wvWare
6637 
6638 #endif // WORD95_GENERATED_H
6639