filters

structures_generated.h

00001 /* This file is part of the LibMSWrite Library
00002    Copyright (C) 2001-2003 Clarence Dang <clarencedang@users.sourceforge.net>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License Version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License Version 2 for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    Version 2 along with this library; see the file COPYING.LIB.  If not,
00015    write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016  * Boston, MA 02110-1301, USA.
00017 
00018    LibMSWrite Project Website:
00019    http://sourceforge.net/projects/libmswrite/
00020 */
00021 
00022 /*
00023  * structures_generated - Internal MS Write file structures
00024  * This file was generated by make_structures_generated 0.51pre 2003/07/09.
00025  * ALL CHANGES MADE TO THIS FILE "WILL BE LOST IN TIME LIKE TEARS IN RAIN"!
00026  */
00027 
00028 #ifndef __STRUCTURES_GENERATED_H__
00029 #define __STRUCTURES_GENERATED_H__
00030 
00031 #include "libmswrite_defs.h"
00032 
00033 namespace MSWrite
00034 {
00035     // $Id: structures_generated.h 490579 2005-12-22 12:32:17Z scripty $
00036     // 
00037     //    This file is part of the LibMSWrite Library
00038     //    Copyright (C) 2001-2003 Clarence Dang <clarencedang@users.sourceforge.net>
00039     // 
00040     //    This library is free software; you can redistribute it and/or
00041     //    modify it under the terms of the GNU Library General Public
00042     //    License Version 2 as published by the Free Software Foundation.
00043     // 
00044     //    This library is distributed in the hope that it will be useful,
00045     //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00046     //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00047     //    Library General Public License Version 2 for more details.
00048     // 
00049     //    You should have received a copy of the GNU Library General Public License
00050     //    Version 2 along with this library; see the file COPYING.LIB.  If not,
00051     //    write to  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00052     //    Boston, MA 02110-1301, USA.
00053     // 
00054     //    LibMSWrite Project Website:
00055     //    http://sourceforge.net/projects/libmswrite/
00056     // 
00057     // DESCRIPTION
00058     // 
00059     // format.xml describes the basic structures that can be found in Microsoft(r)
00060     // Windows(r) Write files.  The majority of the information in format.xml
00061     // (excluding the Windows(r) BMP and WMF structures) is the result of
00062     // investigative file format work but a few portions of format.xml are derived
00063     // from a specification freely available from http://www.wotsit.org/.  The BMP
00064     // & WMF structures are from somewhere on the Internet (they are freely and
00065     // readily available) and can also be found in many programming books.
00066     // 
00067     // The data types and numbers in this document are intended to be interpreted
00068     // in the way they would be in Win3.x (Little Endian, 16-bit).
00069     // 
00070     // 
00071     //  Structure Fields:
00072     // 
00073     //      name #REQUIRED
00074     //      type #IMPLIED "Word"
00075     //      default #IMPLIED ""
00076     //      description #IMPLIED "" (also valid for Structures)
00077     //      verify #IMPLIED ""
00078     //      failVerify #IMPLIED "InvalidFormat"
00079     //      rep #IMPLIED "1"
00080     //      useThisMuch #IMPLIED "0"
00081     //      provideMethod #IMPLIED "0"
00082     //      protected #IMPLIED "0"  (also valid for Structures)
00083     // 
00084     //  All structure names will be automatically postfixed with "Generated".
00085     //  Derive structures from "Generated" structures (in structures*.cpp) e.g.
00086     // 
00087     //      class Header : public HeaderGenerated
00088     //      {
00089     //      }
00090     // 
00091     //  All fields will be automatically prefixed with "m_" to signify that
00092     //  they are member variables.
00093     // 
00094     //  Note that there are some limitations with make_structures_generated,
00095     //  most importantly:
00096     // 
00097     //      * any field of type Bit, must have
00098     //          - rep <=8
00099     //          - default = 0
00100     //          - may not cross a byte boundary!
00101     
00102     // Write file header (mostly from wotsit)
00103     // [PRIVATE] this is a private libmswrite class, do not use it!
00104     class HeaderGenerated : public NeedsDevice
00105     {
00106     public:
00107         static const int s_size = 98;
00108     
00109     private:
00110         HeaderGenerated (const HeaderGenerated &rhs);   //TODO: copy constructor
00111     
00112     protected:
00113         Byte m_data [98];   // raw data from .wri file
00114         
00115         Word m_magic;                           // must be 0xBE31 (v3.0) or 0xBE32 (v3.1 because the file contains OLE)
00116         Word m_zero;
00117         Word m_magic2;                          // Magic number2 (must be 0xAB00)
00118         Word m_zero2 [4];
00119         DWord m_numCharBytesPlus128;        // #bytes of text,images & OLE (starting from Byte 128/Page 1)
00120         Word m_pageParaInfo;
00121         Word m_pageFootnoteTable;
00122         Word m_pageSectionProperty;     // I call it "Page Layout"
00123         Word m_pageSectionTable;
00124         Word m_pagePageTable;
00125         Word m_pageFontTable;
00126         Word m_zero3 [33];
00127         Word m_numPages;                        // (where a page is 128 bytes)
00128         
00129         HeaderGenerated &operator= (const HeaderGenerated &rhs);
00130         
00131         virtual bool verifyVariables (void);
00132         virtual bool writeToArray (void);
00133         
00134         static const Word magicDefault = Word (0xBE31/*Write 3.0*/);
00135         static const Word zeroDefault = Word (0);
00136         static const Word magic2Default = Word (0xAB00);
00137         // cannot provide default for zero2 (is an array or of a non-internal type)
00138         // no default for numCharBytesPlus128
00139         // no default for pageParaInfo
00140         // no default for pageFootnoteTable
00141         // no default for pageSectionProperty
00142         // no default for pageSectionTable
00143         // no default for pagePageTable
00144         // no default for pageFontTable
00145         // cannot provide default for zero3 (is an array or of a non-internal type)
00146         // no default for numPages
00147     
00148     public:
00149         // [PRIVATE] do not call!
00150         virtual bool readFromDevice (void);
00151         virtual bool writeToDevice (void);
00152         
00153         HeaderGenerated ();
00154         virtual ~HeaderGenerated ();
00155         
00156         
00157         //
00158         // get and set functions
00159         //
00160         
00161         Word getMagic (void) const  {   return m_magic; }
00162         void setMagic (const Word val)  {   m_magic = val;  }
00163         
00164         Word getPageParaInfo (void) const   {   return m_pageParaInfo;  }
00165         void setPageParaInfo (const Word val)   {   m_pageParaInfo = val;   }
00166         
00167         Word getPageFootnoteTable (void) const  {   return m_pageFootnoteTable; }
00168         void setPageFootnoteTable (const Word val)  {   m_pageFootnoteTable = val;  }
00169         
00170         Word getPageSectionProperty (void) const    {   return m_pageSectionProperty;   }
00171         void setPageSectionProperty (const Word val)    {   m_pageSectionProperty = val;    }
00172         
00173         Word getPageSectionTable (void) const   {   return m_pageSectionTable;  }
00174         void setPageSectionTable (const Word val)   {   m_pageSectionTable = val;   }
00175         
00176         Word getPagePageTable (void) const  {   return m_pagePageTable; }
00177         void setPagePageTable (const Word val)  {   m_pagePageTable = val;  }
00178         
00179         Word getPageFontTable (void) const  {   return m_pageFontTable; }
00180         void setPageFontTable (const Word val)  {   m_pageFontTable = val;  }
00181         
00182         Word getNumPages (void) const   {   return m_numPages;  }
00183         void setNumPages (const Word val)   {   m_numPages = val;   }
00184     };
00185     
00186     // Page layout information (margins, dimensions, ...)
00187     class PageLayoutGenerated : public NeedsDevice
00188     {
00189     public:
00190         static const int s_size = 33;
00191     
00192     private:
00193         PageLayoutGenerated (const PageLayoutGenerated &rhs);   //TODO: copy constructor
00194     
00195     protected:
00196         Byte m_data [33];   // raw data from .wri file
00197         
00198         Byte m_magic102;                        // =102?
00199         Word m_magic512;                        // =512?
00200         Word m_pageHeight;
00201         Word m_pageWidth;
00202         Word m_pageNumberStart;             // start counting page numbers from this value (0xFFFF means ignore, set to 1 I guess)
00203         Word m_topMargin;
00204         Word m_textHeight;
00205         Word m_leftMargin;
00206         Word m_textWidth;
00207         
00208         Word m_magic256;                        // =256?
00209         
00210         Word m_headerFromTop;               // distance header is from top of page
00211         Word m_footerFromTop;               // distance footer is from top of page
00212         
00213         Word m_magic720;                        // 720
00214         Word m_zero;                            // 0
00215         Word m_magic1080;                       // 1080
00216         Word m_unknown;                     // ? (let's not be random and default to 0)
00217         Word m_zero2;                           // 0
00218         
00219         PageLayoutGenerated &operator= (const PageLayoutGenerated &rhs);
00220         
00221         virtual bool verifyVariables (void);
00222         virtual bool writeToArray (void);
00223         
00224         static const Byte magic102Default = Byte (102);
00225         static const Word magic512Default = Word (512);
00226         static const Word pageHeightDefault = Word (Inch2Twip (11));
00227         static const Word pageWidthDefault = Word (Inch2Twip (8.5));
00228         static const Word pageNumberStartDefault = Word (1);
00229         static const Word topMarginDefault = Word (Inch2Twip (1));
00230         static const Word textHeightDefault = Word (Inch2Twip (9));
00231         static const Word leftMarginDefault = Word (Inch2Twip (1.25));
00232         static const Word textWidthDefault = Word (Inch2Twip (6));
00233         static const Word magic256Default = Word (256);
00234         static const Word headerFromTopDefault = Word (Inch2Twip (0.75));
00235         static const Word footerFromTopDefault = Word (Inch2Twip (10.25 /*11.0 (m_pageHeight) - 0.75*/));
00236         static const Word magic720Default = Word (720);
00237         static const Word zeroDefault = Word (0);
00238         static const Word magic1080Default = Word (1080);
00239         static const Word unknownDefault = Word (0);
00240         static const Word zero2Default = Word (0);
00241     
00242     public:
00243         // [PRIVATE] do not call!
00244         virtual bool readFromDevice (void);
00245         virtual bool writeToDevice (void);
00246         
00247         PageLayoutGenerated ();
00248         virtual ~PageLayoutGenerated ();
00249         
00250     };
00251     
00252     // No idea what this is supposed to do (from wotsit)
00253     // [PRIVATE] this is a private libmswrite class, do not use it!
00254     class SectionDescriptorGenerated : public NeedsDevice
00255     {
00256     public:
00257         static const int s_size = 10;
00258     
00259     private:
00260         SectionDescriptorGenerated (const SectionDescriptorGenerated &rhs); //TODO: copy constructor
00261     
00262     protected:
00263         Byte m_data [10];   // raw data from .wri file
00264         
00265         DWord m_afterEndCharByte;           // byte of character just after end of section
00266         Word m_undefined;
00267         DWord m_sectionPropertyLocation;    // byte address of corresponding sectionProperty (I call it a "Page Layout" which is more obvious IMHO)
00268         
00269         SectionDescriptorGenerated &operator= (const SectionDescriptorGenerated &rhs);
00270         
00271         virtual bool verifyVariables (void);
00272         virtual bool writeToArray (void);
00273         
00274         // no default for afterEndCharByte
00275         static const Word undefinedDefault = Word (0);
00276         // no default for sectionPropertyLocation
00277     
00278     public:
00279         // [PRIVATE] do not call!
00280         virtual bool readFromDevice (void);
00281         virtual bool writeToDevice (void);
00282         
00283         SectionDescriptorGenerated ();
00284         virtual ~SectionDescriptorGenerated ();
00285         
00286         
00287         //
00288         // get and set functions
00289         //
00290         
00291         DWord getAfterEndCharByte (void) const  {   return m_afterEndCharByte;  }
00292         void setAfterEndCharByte (const DWord val)  {   m_afterEndCharByte = val;   }
00293         
00294         DWord getSectionPropertyLocation (void) const   {   return m_sectionPropertyLocation;   }
00295         void setSectionPropertyLocation (const DWord val)   {   m_sectionPropertyLocation = val;    }
00296     };
00297     
00298     // (from wotsit)
00299     class SectionDescriptor;
00300     // [PRIVATE] this is a private libmswrite class, do not use it!
00301     class SectionTableGenerated : public NeedsDevice
00302     {
00303     public:
00304         static const int s_size = 24;
00305     
00306     private:
00307         SectionTableGenerated (const SectionTableGenerated &rhs);   //TODO: copy constructor
00308     
00309     protected:
00310         Byte m_data [24];   // raw data from .wri file
00311         
00312         Word m_numSectionDescriptors;
00313         Word m_undefined;
00314         SectionDescriptor *m_sed [2];
00315         
00316         SectionTableGenerated &operator= (const SectionTableGenerated &rhs);
00317         
00318         virtual bool verifyVariables (void);
00319         virtual bool writeToArray (void);
00320         
00321         static const Word numSectionDescriptorsDefault = Word (2);
00322         static const Word undefinedDefault = Word (0);
00323         // no default for sed
00324     
00325     public:
00326         // [PRIVATE] do not call!
00327         virtual bool readFromDevice (void);
00328         virtual bool writeToDevice (void);
00329         
00330         SectionTableGenerated ();
00331         virtual ~SectionTableGenerated ();
00332         
00333     };
00334     
00335     class FontGenerated : public NeedsDevice
00336     {
00337     public:
00338         static const int s_size = 3;
00339     
00340     private:
00341         FontGenerated (const FontGenerated &rhs);   //TODO: copy constructor
00342     
00343     protected:
00344         Byte m_data [3];    // raw data from .wri file
00345         
00346         Word m_numDataBytes;                    // number of bytes that follow
00347         Byte m_family;
00348         
00349         // - - - followed by Byte *fontName - - - 
00350         
00351         FontGenerated &operator= (const FontGenerated &rhs);
00352         
00353         virtual bool verifyVariables (void);
00354         virtual bool writeToArray (void);
00355         
00356         static const Word numDataBytesDefault = Word (0);
00357         static const Byte familyDefault = Byte (0);
00358     
00359     public:
00360         // [PRIVATE] do not call!
00361         virtual bool readFromDevice (void);
00362         virtual bool writeToDevice (void);
00363         
00364         FontGenerated ();
00365         virtual ~FontGenerated ();
00366         
00367         
00368         //
00369         // get and set functions
00370         //
00371         
00372         // [PRIVATE] these are private libmswrite methods, do not call them!
00373         Word getNumDataBytes (void) const   {   return m_numDataBytes;  }
00374         void setNumDataBytes (const Word val)   {   m_numDataBytes = val;   }
00375         
00376         Byte getFamily (void) const {   return m_family;    }
00377         void setFamily (const Byte val) {   m_family = val; }
00378     };
00379     
00380     // [PRIVATE] this is a private libmswrite class, do not use it!
00381     class FontTableGenerated : public NeedsDevice
00382     {
00383     public:
00384         static const int s_size = 2;
00385     
00386     private:
00387         FontTableGenerated (const FontTableGenerated &rhs); //TODO: copy constructor
00388     
00389     protected:
00390         Byte m_data [2];    // raw data from .wri file
00391         
00392         Word m_numFonts;
00393         
00394         // - - - followed by a list of Font(s) - - - 
00395         
00396         FontTableGenerated &operator= (const FontTableGenerated &rhs);
00397         
00398         virtual bool verifyVariables (void);
00399         virtual bool writeToArray (void);
00400         
00401         static const Word numFontsDefault = Word (0);
00402     
00403     public:
00404         // [PRIVATE] do not call!
00405         virtual bool readFromDevice (void);
00406         virtual bool writeToDevice (void);
00407         
00408         FontTableGenerated ();
00409         virtual ~FontTableGenerated ();
00410         
00411         
00412         //
00413         // get and set functions
00414         //
00415         
00416         Word getNumFonts (void) const   {   return m_numFonts;  }
00417         void setNumFonts (const Word val)   {   m_numFonts = val;   }
00418     };
00419     
00420     // [PRIVATE] this is a private libmswrite class, do not use it!
00421     class PagePointerGenerated : public NeedsDevice
00422     {
00423     public:
00424         static const int s_size = 6;
00425     
00426     private:
00427         PagePointerGenerated (const PagePointerGenerated &rhs); //TODO: copy constructor
00428     
00429     protected:
00430         Byte m_data [6];    // raw data from .wri file
00431         
00432         Word m_pageNumber;
00433         DWord m_firstCharByte;              // first character on page
00434         
00435         PagePointerGenerated &operator= (const PagePointerGenerated &rhs);
00436         
00437         virtual bool verifyVariables (void);
00438         virtual bool writeToArray (void);
00439         
00440         // no default for pageNumber
00441         // no default for firstCharByte
00442     
00443     public:
00444         // [PRIVATE] do not call!
00445         virtual bool readFromDevice (void);
00446         virtual bool writeToDevice (void);
00447         
00448         PagePointerGenerated ();
00449         virtual ~PagePointerGenerated ();
00450         
00451         
00452         //
00453         // get and set functions
00454         //
00455         
00456         Word getPageNumber (void) const {   return m_pageNumber;    }
00457         void setPageNumber (const Word val) {   m_pageNumber = val; }
00458         
00459         DWord getFirstCharByte (void) const {   return m_firstCharByte; }
00460         void setFirstCharByte (const DWord val) {   m_firstCharByte = val;  }
00461     };
00462     
00463     // File/Repaginate function
00464     // [PRIVATE] this is a private libmswrite class, do not use it!
00465     class PageTableGenerated : public NeedsDevice
00466     {
00467     public:
00468         static const int s_size = 4;
00469     
00470     private:
00471         PageTableGenerated (const PageTableGenerated &rhs); //TODO: copy constructor
00472     
00473     protected:
00474         Byte m_data [4];    // raw data from .wri file
00475         
00476         Word m_numPagePointers;
00477         Word m_zero;
00478         
00479         // - - - followed by a list of PagePointer(s) - - - 
00480         
00481         PageTableGenerated &operator= (const PageTableGenerated &rhs);
00482         
00483         virtual bool verifyVariables (void);
00484         virtual bool writeToArray (void);
00485         
00486         static const Word numPagePointersDefault = Word (0);
00487         static const Word zeroDefault = Word (0);
00488     
00489     public:
00490         // [PRIVATE] do not call!
00491         virtual bool readFromDevice (void);
00492         virtual bool writeToDevice (void);
00493         
00494         PageTableGenerated ();
00495         virtual ~PageTableGenerated ();
00496         
00497     };
00498     
00499     // A pointer to the actual formatting properties (formatting properties are shared to save space)
00500     // [PRIVATE] this is a private libmswrite class, do not use it!
00501     class FormatPointerGenerated : public NeedsDevice
00502     {
00503     public:
00504         static const int s_size = 6;
00505     
00506     private:
00507         FormatPointerGenerated (const FormatPointerGenerated &rhs); //TODO: copy constructor
00508     
00509     protected:
00510         Byte m_data [6];    // raw data from .wri file
00511         
00512         DWord m_afterEndCharBytePlus128;    // last character it points to + 1
00513         Word m_formatPropertyOffset;        // location of relevant FormatProperty (or 0xFFFF for defaults)
00514         
00515         FormatPointerGenerated &operator= (const FormatPointerGenerated &rhs);
00516         
00517         virtual bool verifyVariables (void);
00518         virtual bool writeToArray (void);
00519         
00520         // no default for afterEndCharBytePlus128
00521         // no default for formatPropertyOffset
00522     
00523     public:
00524         // [PRIVATE] do not call!
00525         virtual bool readFromDevice (void);
00526         virtual bool writeToDevice (void);
00527         
00528         FormatPointerGenerated ();
00529         virtual ~FormatPointerGenerated ();
00530         
00531         
00532         //
00533         // get and set functions
00534         //
00535         
00536         DWord getAfterEndCharBytePlus128 (void) const   {   return m_afterEndCharBytePlus128;   }
00537         void setAfterEndCharBytePlus128 (const DWord val)   {   m_afterEndCharBytePlus128 = val;    }
00538         
00539         Word getFormatPropertyOffset (void) const   {   return m_formatPropertyOffset;  }
00540         void setFormatPropertyOffset (const Word val)   {   m_formatPropertyOffset = val;   }
00541     };
00542     
00543     // Character Properties
00544     class FormatCharPropertyGenerated : public NeedsDevice, public UseThisMuch
00545     {
00546     public:
00547         static const int s_size = 7;
00548     
00549     private:
00550         FormatCharPropertyGenerated (const FormatCharPropertyGenerated &rhs);   //TODO: copy constructor
00551     
00552     protected:
00553         Byte m_data [7];    // raw data from .wri file
00554         
00555         // Byte 0 
00556         Byte m_numDataBytes;                    // number of bytes that follow
00557         
00558         // Byte 1 
00559         Byte m_unknown;                     // =0? or =1?
00560         
00561         // Byte 2 
00562         unsigned m_isBold   :   1;
00563         unsigned m_isItalic :   1;
00564         unsigned m_fontCodeLow  :   6;
00565         
00566         // Byte 3 
00567         Byte m_fontSize;                        // half the fontSize?
00568         
00569         // Byte 4 
00570         unsigned m_isUnderlined :   1;
00571         unsigned m_zero :   5;
00572         unsigned m_isPageNumber :   1;      // seems to be set for '(page)' number variables - only in headers/footers?
00573         unsigned m_zero2    :   1;
00574         
00575         // Byte 5 
00576         unsigned m_fontCodeHigh :   3;      // not sure if this is true
00577         unsigned m_zero3    :   5;
00578         
00579         // Byte 6 
00580         Byte m_position;                        // 0=normal, 1-127=superscript, 128-255=subscript (I tested mainly boundary values so I don't know if it's this is totally true)
00581         
00582         FormatCharPropertyGenerated &operator= (const FormatCharPropertyGenerated &rhs);
00583         
00584         Word getNumDataBytes (void) const   {   return UseThisMuch::getNeedNumDataBytes (); }
00585         // note: you cannot set numDataBytes
00586         void updateNumDataBytes (void)  {   m_numDataBytes = UseThisMuch::getNeedNumDataBytes ();   }
00587         
00588         virtual bool verifyVariables (void);
00589         virtual bool writeToArray (void);
00590         
00591         static const Byte numDataBytesDefault = Byte (0);
00592         static const Byte unknownDefault = Byte (1);
00593         static const unsigned isBoldDefault = unsigned (0);
00594         static const unsigned isItalicDefault = unsigned (0);
00595         // cannot provide default for fontCodeLow (is an array or of a non-internal type)
00596         static const Byte fontSizeDefault = Byte (24);
00597         static const unsigned isUnderlinedDefault = unsigned (0);
00598         // cannot provide default for zero (is an array or of a non-internal type)
00599         static const unsigned isPageNumberDefault = unsigned (0);
00600         static const unsigned zero2Default = unsigned (0);
00601         // cannot provide default for fontCodeHigh (is an array or of a non-internal type)
00602         // cannot provide default for zero3 (is an array or of a non-internal type)
00603         static const Byte positionDefault = Byte (0);
00604     
00605     public:
00606         // [PRIVATE] do not call!
00607         virtual bool readFromDevice (void);
00608         virtual bool writeToDevice (void);
00609         
00610         FormatCharPropertyGenerated ();
00611         virtual ~FormatCharPropertyGenerated ();
00612         
00613         
00614         //
00615         // get and set functions
00616         //
00617         
00618         bool getIsBold (void) const {   return m_isBold;    }
00619         void setIsBold (const bool val) {   m_isBold = val; signalHaveSetData (m_isBold == bool (0), 8/*offset*/ + 1/*size*/);  }
00620         
00621         bool getIsItalic (void) const   {   return m_isItalic;  }
00622         void setIsItalic (const bool val)   {   m_isItalic = val;   signalHaveSetData (m_isItalic == bool (0), 9/*offset*/ + 1/*size*/);    }
00623         
00624         // [PRIVATE] these are private libmswrite methods, do not call them!
00625         unsigned getFontCodeLow (void) const    {   return m_fontCodeLow;   }
00626         void setFontCodeLow (const unsigned val)    {   m_fontCodeLow = val;    signalHaveSetData (m_fontCodeLow == unsigned (0), 10/*offset*/ + 6/*size*/);    }
00627         
00628         bool getIsUnderlined (void) const   {   return m_isUnderlined;  }
00629         void setIsUnderlined (const bool val)   {   m_isUnderlined = val;   signalHaveSetData (m_isUnderlined == bool (0), 24/*offset*/ + 1/*size*/);   }
00630         
00631         bool getIsPageNumber (void) const   {   return m_isPageNumber;  }
00632         void setIsPageNumber (const bool val)   {   m_isPageNumber = val;   signalHaveSetData (m_isPageNumber == bool (0), 30/*offset*/ + 1/*size*/);   }
00633         
00634         // [PRIVATE] these are private libmswrite methods, do not call them!
00635         unsigned getFontCodeHigh (void) const   {   return m_fontCodeHigh;  }
00636         void setFontCodeHigh (const unsigned val)   {   m_fontCodeHigh = val;   signalHaveSetData (m_fontCodeHigh == unsigned (0), 32/*offset*/ + 3/*size*/);   }
00637         
00638         // [PRIVATE] these are private libmswrite methods, do not call them!
00639         Byte getPosition (void) const   {   return m_position;  }
00640         void setPosition (const Byte val)   {   m_position = val;   signalHaveSetData (m_position == Byte (0), 40/*offset*/ + 8/*size*/);   }
00641     };
00642     
00643     // Paragraph Tabulator(s) Properties
00644     class FormatParaPropertyTabulatorGenerated : public NeedsDevice
00645     {
00646     public:
00647         static const int s_size = 4;
00648     
00649     private:
00650         FormatParaPropertyTabulatorGenerated (const FormatParaPropertyTabulatorGenerated &rhs); //TODO: copy constructor
00651     
00652     protected:
00653         Byte m_data [4];    // raw data from .wri file
00654         
00655         Word m_indent;
00656         Byte m_type;                            // 0=normal,3=decimal...all that the GUI allows
00657         Byte m_zero;
00658         
00659         FormatParaPropertyTabulatorGenerated &operator= (const FormatParaPropertyTabulatorGenerated &rhs);
00660         
00661         virtual bool verifyVariables (void);
00662         virtual bool writeToArray (void);
00663         
00664         static const Word indentDefault = Word (0);
00665         static const Byte typeDefault = Byte (0);
00666         static const Byte zeroDefault = Byte (0);
00667     
00668     public:
00669         // [PRIVATE] do not call!
00670         virtual bool readFromDevice (void);
00671         virtual bool writeToDevice (void);
00672         
00673         FormatParaPropertyTabulatorGenerated ();
00674         virtual ~FormatParaPropertyTabulatorGenerated ();
00675         
00676         
00677         //
00678         // get and set functions
00679         //
00680         
00681         Word getIndent (void) const {   return m_indent;    }
00682         void setIndent (const Word val) {   m_indent = val; }
00683         
00684         // [PRIVATE] these are private libmswrite methods, do not call them!
00685         Byte getType (void) const   {   return m_type;  }
00686         void setType (const Byte val)   {   m_type = val;   }
00687     };
00688     
00689     // Paragraph Properties
00690     class FormatParaPropertyTabulator;
00691     class FormatParaPropertyGenerated : public NeedsDevice, public UseThisMuch
00692     {
00693     public:
00694         static const int s_size = 79;
00695     
00696     private:
00697         FormatParaPropertyGenerated (const FormatParaPropertyGenerated &rhs);   //TODO: copy constructor
00698     
00699     protected:
00700         Byte m_data [79];   // raw data from .wri file
00701         
00702         Byte m_numDataBytes;                    // number of bytes that follow
00703         Byte m_magic0_60_or_61;             // =0? =60? =61? 60 is the most common
00704         Byte m_alignment;
00705         Word m_magic30;                     // =30?
00706         Word m_rightIndent;                 // indent from right margin + right margin (if in header/footer)
00707         Word m_leftIndent;                  // indent from left margin + left margin (if in header/footer)
00708         Short m_leftIndentFirstLine;        // indent of first line relative to leftIndent (may be negative for a "hanging indent")
00709         Word m_lineSpacing;                 // measurement in twips?
00710         Word m_zero [2];
00711         
00712         // Type Byte 
00713         unsigned m_headerOrFooter   :   1;  // 0=header,1=footer (if not normal paragraph)
00714         unsigned m_isNotNormalParagraph :   2;// 0=normal paragraph;1,2?,3?=header/footer
00715         unsigned m_isOnFirstPage    :   1;  // again, valid only if not normal paragraph
00716         unsigned m_isObject :   1;          // 0=image/OLE,1=text
00717         unsigned m_zero2    :   3;
00718         
00719         Byte m_zero3 [5];
00720         FormatParaPropertyTabulator *m_tab [14];
00721         
00722         FormatParaPropertyGenerated &operator= (const FormatParaPropertyGenerated &rhs);
00723         
00724         Word getNumDataBytes (void) const   {   return UseThisMuch::getNeedNumDataBytes (); }
00725         // note: you cannot set numDataBytes
00726         void updateNumDataBytes (void)  {   m_numDataBytes = UseThisMuch::getNeedNumDataBytes ();   }
00727         
00728         virtual bool verifyVariables (void);
00729         virtual bool writeToArray (void);
00730         
00731         static const Byte numDataBytesDefault = Byte (0);
00732         static const Byte magic0_60_or_61Default = Byte (60);
00733         static const Byte alignmentDefault = Byte (0);
00734         static const Word magic30Default = Word (30);
00735         static const Word rightIndentDefault = Word (0);
00736         static const Word leftIndentDefault = Word (0);
00737         static const Short leftIndentFirstLineDefault = Short (0);
00738         static const Word lineSpacingDefault = Word (240);
00739         // cannot provide default for zero (is an array or of a non-internal type)
00740         static const unsigned headerOrFooterDefault = unsigned (0);
00741         // cannot provide default for isNotNormalParagraph (is an array or of a non-internal type)
00742         static const unsigned isOnFirstPageDefault = unsigned (0);
00743         static const unsigned isObjectDefault = unsigned (0);
00744         // cannot provide default for zero2 (is an array or of a non-internal type)
00745         // cannot provide default for zero3 (is an array or of a non-internal type)
00746         // no default for tab
00747     
00748     public:
00749         // [PRIVATE] do not call!
00750         virtual bool readFromDevice (void);
00751         virtual bool writeToDevice (void);
00752         
00753         FormatParaPropertyGenerated ();
00754         virtual ~FormatParaPropertyGenerated ();
00755         
00756         
00757         //
00758         // get and set functions
00759         //
00760         
00761         Byte getAlignment (void) const  {   return m_alignment; }
00762         void setAlignment (const Byte val)  {   m_alignment = val;  signalHaveSetData (m_alignment == Byte (0), 8/*offset*/ + 8/*size*/);   }
00763         
00764         Word getRightIndent (void) const    {   return m_rightIndent;   }
00765         void setRightIndent (const Word val)    {   m_rightIndent = val;    signalHaveSetData (m_rightIndent == Word (0), 32/*offset*/ + 16/*size*/);   }
00766         
00767         Word getLeftIndent (void) const {   return m_leftIndent;    }
00768         void setLeftIndent (const Word val) {   m_leftIndent = val; signalHaveSetData (m_leftIndent == Word (0), 48/*offset*/ + 16/*size*/);    }
00769         
00770         Word getLineSpacing (void) const    {   return m_lineSpacing;   }
00771         void setLineSpacing (const Word val)    {   m_lineSpacing = val;    signalHaveSetData (m_lineSpacing == Word (240), 80/*offset*/ + 16/*size*/); }
00772         
00773         bool getHeaderOrFooter (void) const {   return m_headerOrFooter;    }
00774         void setHeaderOrFooter (const bool val) {   m_headerOrFooter = val; signalHaveSetData (m_headerOrFooter == bool (0), 128/*offset*/ + 1/*size*/);    }
00775         
00776         unsigned getIsNotNormalParagraph (void) const   {   return m_isNotNormalParagraph;  }
00777         void setIsNotNormalParagraph (const unsigned val)   {   m_isNotNormalParagraph = val;   signalHaveSetData (m_isNotNormalParagraph == unsigned (0), 129/*offset*/ + 2/*size*/);  }
00778         
00779         bool getIsOnFirstPage (void) const  {   return m_isOnFirstPage; }
00780         void setIsOnFirstPage (const bool val)  {   m_isOnFirstPage = val;  signalHaveSetData (m_isOnFirstPage == bool (0), 131/*offset*/ + 1/*size*/); }
00781         
00782         bool getIsObject (void) const   {   return m_isObject;  }
00783         void setIsObject (const bool val)   {   m_isObject = val;   signalHaveSetData (m_isObject == bool (0), 132/*offset*/ + 1/*size*/);  }
00784     };
00785     
00786     // [PRIVATE] this is a private libmswrite class, do not use it!
00787     class FormatInfoPageGenerated : public NeedsDevice
00788     {
00789     public:
00790         static const int s_size = 128;
00791     
00792     private:
00793         FormatInfoPageGenerated (const FormatInfoPageGenerated &rhs);   //TODO: copy constructor
00794     
00795     protected:
00796         Byte m_data [128];  // raw data from .wri file
00797         
00798         DWord m_firstCharBytePlus128;
00799         Byte m_packedStructs [123];     // array of FormatPointers and FormatCharProperties/FormatParaProperties
00800         Byte m_numFormatPointers;
00801         
00802         FormatInfoPageGenerated &operator= (const FormatInfoPageGenerated &rhs);
00803         
00804         virtual bool verifyVariables (void);
00805         virtual bool writeToArray (void);
00806         
00807         // no default for firstCharBytePlus128
00808         // cannot provide default for packedStructs (is an array or of a non-internal type)
00809         static const Byte numFormatPointersDefault = Byte (0);
00810     
00811     public:
00812         // [PRIVATE] do not call!
00813         virtual bool readFromDevice (void);
00814         virtual bool writeToDevice (void);
00815         
00816         FormatInfoPageGenerated ();
00817         virtual ~FormatInfoPageGenerated ();
00818         
00819     };
00820     
00821     // first header of a .BMP file (_not_ stored in .WRI)
00822     // [PRIVATE] this is a private libmswrite class, do not use it!
00823     class BMP_BitmapFileHeaderGenerated : public NeedsDevice
00824     {
00825     public:
00826         static const int s_size = 14;
00827     
00828     private:
00829         BMP_BitmapFileHeaderGenerated (const BMP_BitmapFileHeaderGenerated &rhs);   //TODO: copy constructor
00830     
00831     protected:
00832         Byte m_data [14];   // raw data from .wri file
00833         
00834         Word m_magic;
00835         DWord m_totalBytes;
00836         Word m_zero [2];
00837         DWord m_actualImageOffset;
00838         
00839         BMP_BitmapFileHeaderGenerated &operator= (const BMP_BitmapFileHeaderGenerated &rhs);
00840         
00841         virtual bool verifyVariables (void);
00842         virtual bool writeToArray (void);
00843         
00844         static const Word magicDefault = Word (Word ('B') + (Word ('M') << 8));
00845         // no default for totalBytes
00846         // cannot provide default for zero (is an array or of a non-internal type)
00847         // no default for actualImageOffset
00848     
00849     public:
00850         // [PRIVATE] do not call!
00851         virtual bool readFromDevice (void);
00852         virtual bool writeToDevice (void);
00853         
00854         BMP_BitmapFileHeaderGenerated ();
00855         virtual ~BMP_BitmapFileHeaderGenerated ();
00856         
00857         
00858         //
00859         // get and set functions
00860         //
00861         
00862         DWord getTotalBytes (void) const    {   return m_totalBytes;    }
00863         void setTotalBytes (const DWord val)    {   m_totalBytes = val; }
00864         
00865         DWord getActualImageOffset (void) const {   return m_actualImageOffset; }
00866         void setActualImageOffset (const DWord val) {   m_actualImageOffset = val;  }
00867     };
00868     
00869     // second header of a .BMP file (_not_ stored in .WRI)
00870     // [PRIVATE] this is a private libmswrite class, do not use it!
00871     class BMP_BitmapInfoHeaderGenerated : public NeedsDevice
00872     {
00873     public:
00874         static const int s_size = 40;
00875     
00876     private:
00877         BMP_BitmapInfoHeaderGenerated (const BMP_BitmapInfoHeaderGenerated &rhs);   //TODO: copy constructor
00878     
00879     protected:
00880         Byte m_data [40];   // raw data from .wri file
00881         
00882         DWord m_numHeaderBytes;
00883         Long m_width;
00884         Long m_height;
00885         Word m_numPlanes;                       // always==1
00886         Word m_bitsPerPixel;
00887         DWord m_compression;
00888         DWord m_sizeImage;
00889         Long m_xPixelsPerMeter;
00890         Long m_yPixelsPerMeter;
00891         DWord m_coloursUsed;
00892         DWord m_coloursImportant;
00893         
00894         BMP_BitmapInfoHeaderGenerated &operator= (const BMP_BitmapInfoHeaderGenerated &rhs);
00895         
00896         virtual bool verifyVariables (void);
00897         virtual bool writeToArray (void);
00898         
00899         static const DWord numHeaderBytesDefault = DWord (s_size);
00900         // no default for width
00901         // no default for height
00902         static const Word numPlanesDefault = Word (1);
00903         // no default for bitsPerPixel
00904         static const DWord compressionDefault = DWord (0);
00905         static const DWord sizeImageDefault = DWord (0);
00906         static const Long xPixelsPerMeterDefault = Long (0);
00907         static const Long yPixelsPerMeterDefault = Long (0);
00908         static const DWord coloursUsedDefault = DWord (0);
00909         // no default for coloursImportant
00910     
00911     public:
00912         // [PRIVATE] do not call!
00913         virtual bool readFromDevice (void);
00914         virtual bool writeToDevice (void);
00915         
00916         BMP_BitmapInfoHeaderGenerated ();
00917         virtual ~BMP_BitmapInfoHeaderGenerated ();
00918         
00919         
00920         //
00921         // get and set functions
00922         //
00923         
00924         Long getWidth (void) const  {   return m_width; }
00925         void setWidth (const Long val)  {   m_width = val;  }
00926         
00927         Long getHeight (void) const {   return m_height;    }
00928         void setHeight (const Long val) {   m_height = val; }
00929         
00930         Word getNumPlanes (void) const  {   return m_numPlanes; }
00931         void setNumPlanes (const Word val)  {   m_numPlanes = val;  }
00932         
00933         Word getBitsPerPixel (void) const   {   return m_bitsPerPixel;  }
00934         void setBitsPerPixel (const Word val)   {   m_bitsPerPixel = val;   }
00935         
00936         DWord getCompression (void) const   {   return m_compression;   }
00937         void setCompression (const DWord val)   {   m_compression = val;    }
00938         
00939         DWord getSizeImage (void) const {   return m_sizeImage; }
00940         void setSizeImage (const DWord val) {   m_sizeImage = val;  }
00941         
00942         Long getXPixelsPerMeter (void) const    {   return m_xPixelsPerMeter;   }
00943         void setXPixelsPerMeter (const Long val)    {   m_xPixelsPerMeter = val;    }
00944         
00945         Long getYPixelsPerMeter (void) const    {   return m_yPixelsPerMeter;   }
00946         void setYPixelsPerMeter (const Long val)    {   m_yPixelsPerMeter = val;    }
00947         
00948         DWord getColoursUsed (void) const   {   return m_coloursUsed;   }
00949         void setColoursUsed (const DWord val)   {   m_coloursUsed = val;    }
00950         
00951         DWord getColoursImportant (void) const  {   return m_coloursImportant;  }
00952         void setColoursImportant (const DWord val)  {   m_coloursImportant = val;   }
00953     };
00954     
00955     // element of colourTable, triad of RGB
00956     // [PRIVATE] this is a private libmswrite class, do not use it!
00957     class BMP_BitmapColourIndexGenerated : public NeedsDevice
00958     {
00959     public:
00960         static const int s_size = 4;
00961     
00962     private:
00963         BMP_BitmapColourIndexGenerated (const BMP_BitmapColourIndexGenerated &rhs); //TODO: copy constructor
00964     
00965     protected:
00966         Byte m_data [4];    // raw data from .wri file
00967         
00968         Byte m_blue;
00969         Byte m_green;
00970         Byte m_red;
00971         Byte m_reserved;
00972         
00973         BMP_BitmapColourIndexGenerated &operator= (const BMP_BitmapColourIndexGenerated &rhs);
00974         
00975         virtual bool verifyVariables (void);
00976         virtual bool writeToArray (void);
00977         
00978         // no default for blue
00979         // no default for green
00980         // no default for red
00981         static const Byte reservedDefault = Byte (0);
00982     
00983     public:
00984         // [PRIVATE] do not call!
00985         virtual bool readFromDevice (void);
00986         virtual bool writeToDevice (void);
00987         
00988         BMP_BitmapColourIndexGenerated ();
00989         virtual ~BMP_BitmapColourIndexGenerated ();
00990         
00991         
00992         //
00993         // get and set functions
00994         //
00995         
00996         Byte getBlue (void) const   {   return m_blue;  }
00997         void setBlue (const Byte val)   {   m_blue = val;   }
00998         
00999         Byte getGreen (void) const  {   return m_green; }
01000         void setGreen (const Byte val)  {   m_green = val;  }
01001         
01002         Byte getRed (void) const    {   return m_red;   }
01003         void setRed (const Byte val)    {   m_red = val;    }
01004     };
01005     
01006     // [PRIVATE] this is a private libmswrite class, do not use it!
01007     class BitmapHeaderGenerated : public NeedsDevice
01008     {
01009     public:
01010         static const int s_size = 14;
01011     
01012     private:
01013         BitmapHeaderGenerated (const BitmapHeaderGenerated &rhs);   //TODO: copy constructor
01014     
01015     protected:
01016         Byte m_data [14];   // raw data from .wri file
01017         
01018         Word m_zero;
01019         Word m_width;
01020         Word m_height;
01021         Word m_widthBytes;
01022         Byte m_numPlanes;                       // always 1 for mono BMP or the entire struct is 0 for WMF
01023         Byte m_bitsPerPixel;
01024         DWord m_zero2;
01025         
01026         BitmapHeaderGenerated &operator= (const BitmapHeaderGenerated &rhs);
01027         
01028         virtual bool verifyVariables (void);
01029         virtual bool writeToArray (void);
01030         
01031         static const Word zeroDefault = Word (0);
01032         static const Word widthDefault = Word (0);
01033         static const Word heightDefault = Word (0);
01034         static const Word widthBytesDefault = Word (0);
01035         static const Byte numPlanesDefault = Byte (0);
01036         static const Byte bitsPerPixelDefault = Byte (0);
01037         static const DWord zero2Default = DWord (0);
01038     
01039     public:
01040         // [PRIVATE] do not call!
01041         virtual bool readFromDevice (void);
01042         virtual bool writeToDevice (void);
01043         
01044         BitmapHeaderGenerated ();
01045         virtual ~BitmapHeaderGenerated ();
01046         
01047         
01048         //
01049         // get and set functions
01050         //
01051         
01052         Word getWidth (void) const  {   return m_width; }
01053         void setWidth (const Word val)  {   m_width = val;  }
01054         
01055         Word getHeight (void) const {   return m_height;    }
01056         void setHeight (const Word val) {   m_height = val; }
01057         
01058         Word getWidthBytes (void) const {   return m_widthBytes;    }
01059         void setWidthBytes (const Word val) {   m_widthBytes = val; }
01060         
01061         Byte getNumPlanes (void) const  {   return m_numPlanes; }
01062         void setNumPlanes (const Byte val)  {   m_numPlanes = val;  }
01063         
01064         Byte getBitsPerPixel (void) const   {   return m_bitsPerPixel;  }
01065         void setBitsPerPixel (const Byte val)   {   m_bitsPerPixel = val;   }
01066     };
01067     
01068     // 'Standard WMF' Header
01069     // [PRIVATE] this is a private libmswrite class, do not use it!
01070     class WMFHeaderGenerated : public NeedsDevice
01071     {
01072     public:
01073         static const int s_size = 18;
01074     
01075     private:
01076         WMFHeaderGenerated (const WMFHeaderGenerated &rhs); //TODO: copy constructor
01077     
01078     protected:
01079         Byte m_data [18];   // raw data from .wri file
01080         
01081         Word m_fieldType;                       // 0=memory WMF,1=file WMF; so will never be 0
01082         Word m_headerSize;                  // (in Words)
01083         Word m_winVersion;                  // correct for Win>=3.0
01084         DWord m_fileSize;                       // (in Words)
01085         Word m_numObjects;                  // ?
01086         DWord m_maxRecordSize;              // (in Words)
01087         Word m_zero;
01088         
01089         WMFHeaderGenerated &operator= (const WMFHeaderGenerated &rhs);
01090         
01091         virtual bool verifyVariables (void);
01092         virtual bool writeToArray (void);
01093         
01094         static const Word fieldTypeDefault = Word (1);
01095         static const Word headerSizeDefault = Word (9);
01096         static const Word winVersionDefault = Word (0x0300);
01097         // no default for fileSize
01098         static const Word numObjectsDefault = Word (0);
01099         // no default for maxRecordSize
01100         static const Word zeroDefault = Word (0);
01101     
01102     public:
01103         // [PRIVATE] do not call!
01104         virtual bool readFromDevice (void);
01105         virtual bool writeToDevice (void);
01106         
01107         WMFHeaderGenerated ();
01108         virtual ~WMFHeaderGenerated ();
01109         
01110         
01111         //
01112         // get and set functions
01113         //
01114         
01115         DWord getFileSize (void) const  {   return m_fileSize;  }
01116         void setFileSize (const DWord val)  {   m_fileSize = val;   }
01117         
01118         DWord getMaxRecordSize (void) const {   return m_maxRecordSize; }
01119         void setMaxRecordSize (const DWord val) {   m_maxRecordSize = val;  }
01120     };
01121     
01122     class BitmapHeader;
01123     class ImageGenerated : public NeedsDevice
01124     {
01125     public:
01126         static const int s_size = 40;
01127     
01128     private:
01129         ImageGenerated (const ImageGenerated &rhs); //TODO: copy constructor
01130     
01131     protected:
01132         Byte m_data [40];   // raw data from .wri file
01133         
01134         // - - - METAFILEPICT begin - - - 
01135         
01136         Word m_mappingMode;                 // type of image: 0xE3 for mono bitmap, != 0xE3 for WMF (usually 0x88)
01137         Word m_MFP_width;
01138         Word m_MFP_height;
01139         Word m_MFP_unknown;
01140         
01141         // - - - METAFILEPICT end - - - 
01142         
01143         Word m_indent;                          // horizontal position from left margin
01144         Word m_width;                           // WMF width only, use m_bmh for bitmaps
01145         Word m_height;                          // WMF height only, use m_bmh for bitmaps
01146         Word m_zero;                            // ??? varies too much, default to 0
01147         
01148         BitmapHeader *m_bmh;                    // only valid for mono BMPs i.e. when mappingMode == 0xe3
01149         
01150         Word m_numHeaderBytes;              // size of this header? (why isn't it the first element?)
01151         DWord m_numDataBytes;               // number of image bytes
01152         Word m_horizontalScalingRel1000;    // horizontal scaling (/1000)*100% (BMPs only)
01153         Word m_verticalScalingRel1000;  // vertical scaling (/1000)*100% (BMPs only)
01154         
01155         // - - - Followed by either a strangely packed monochrome bitmap or a Standard WMF (with WMFHeader, of course) - - - 
01156         
01157         ImageGenerated &operator= (const ImageGenerated &rhs);
01158         
01159         virtual bool verifyVariables (void);
01160         virtual bool writeToArray (void);
01161         
01162         // no default for mappingMode
01163         // no default for MFP_width
01164         // no default for MFP_height
01165         static const Word MFP_unknownDefault = Word (0);
01166         static const Word indentDefault = Word (0);
01167         // no default for width
01168         // no default for height
01169         static const Word zeroDefault = Word (0);
01170         // no default for bmh
01171         static const Word numHeaderBytesDefault = Word (s_size);
01172         // no default for numDataBytes
01173         static const Word horizontalScalingRel1000Default = Word (1000);
01174         static const Word verticalScalingRel1000Default = Word (1000);
01175     
01176     public:
01177         // [PRIVATE] do not call!
01178         virtual bool readFromDevice (void);
01179         virtual bool writeToDevice (void);
01180         
01181         ImageGenerated ();
01182         virtual ~ImageGenerated ();
01183         
01184         
01185         //
01186         // get and set functions
01187         //
01188         
01189         Word getIndent (void) const {   return m_indent;    }
01190         void setIndent (const Word val) {   m_indent = val; }
01191         
01192         // [PRIVATE] these are private libmswrite methods, do not call them!
01193         Word getNumHeaderBytes (void) const {   return m_numHeaderBytes;    }
01194         void setNumHeaderBytes (const Word val) {   m_numHeaderBytes = val; }
01195         
01196         // [PRIVATE] these are private libmswrite methods, do not call them!
01197         DWord getNumDataBytes (void) const  {   return m_numDataBytes;  }
01198         void setNumDataBytes (const DWord val)  {   m_numDataBytes = val;   }
01199     };
01200     
01201     class OLEGenerated : public NeedsDevice
01202     {
01203     public:
01204         static const int s_size = 40;
01205     
01206     private:
01207         OLEGenerated (const OLEGenerated &rhs); //TODO: copy constructor
01208     
01209     protected:
01210         Byte m_data [40];   // raw data from .wri file
01211         
01212         Word m_mappingMode;
01213         DWord m_zero;
01214         Word m_objectType;                  // 1=static, 2=embedded, 3=link
01215         
01216         Word m_indent;                          // horizontal position from left margin
01217         Word m_width;
01218         Word m_height;
01219         Word m_zero2;
01220         DWord m_numDataBytes;               // number of OLE bytes
01221         DWord m_zero3;
01222         DWord m_objectName;                 // name of the object in hex
01223         Word m_zero4;
01224         Word m_numHeaderBytes;              // size of this header
01225         DWord m_zero5;
01226         Word m_widthScaledRel1000;          // horizontal scaling (/1000)*100% (same as Image?)
01227         Word m_heightScaledRel1000;     // vertical scaling (/1000)*100% (same as Image?)
01228         
01229         // - - - Followed by OLE data - - - 
01230         
01231         OLEGenerated &operator= (const OLEGenerated &rhs);
01232         
01233         virtual bool verifyVariables (void);
01234         virtual bool writeToArray (void);
01235         
01236         // no default for mappingMode
01237         static const DWord zeroDefault = DWord (0);
01238         // no default for objectType
01239         // no default for indent
01240         // no default for width
01241         // no default for height
01242         static const Word zero2Default = Word (0);
01243         // no default for numDataBytes
01244         static const DWord zero3Default = DWord (0);
01245         // no default for objectName
01246         static const Word zero4Default = Word (0);
01247         // no default for numHeaderBytes
01248         static const DWord zero5Default = DWord (0);
01249         // no default for widthScaledRel1000
01250         // no default for heightScaledRel1000
01251     
01252     public:
01253         // [PRIVATE] do not call!
01254         virtual bool readFromDevice (void);
01255         virtual bool writeToDevice (void);
01256         
01257         OLEGenerated ();
01258         virtual ~OLEGenerated ();
01259         
01260         
01261         //
01262         // get and set functions
01263         //
01264         
01265         Word getObjectType (void) const {   return m_objectType;    }
01266         void setObjectType (const Word val) {   m_objectType = val; }
01267         
01268         Word getIndent (void) const {   return m_indent;    }
01269         void setIndent (const Word val) {   m_indent = val; }
01270         
01271         Word getWidth (void) const  {   return m_width; }
01272         void setWidth (const Word val)  {   m_width = val;  }
01273         
01274         Word getHeight (void) const {   return m_height;    }
01275         void setHeight (const Word val) {   m_height = val; }
01276         
01277         // [PRIVATE] these are private libmswrite methods, do not call them!
01278         DWord getNumDataBytes (void) const  {   return m_numDataBytes;  }
01279         void setNumDataBytes (const DWord val)  {   m_numDataBytes = val;   }
01280         
01281         DWord getObjectName (void) const    {   return m_objectName;    }
01282         void setObjectName (const DWord val)    {   m_objectName = val; }
01283         
01284         Word getWidthScaledRel1000 (void) const {   return m_widthScaledRel1000;    }
01285         void setWidthScaledRel1000 (const Word val) {   m_widthScaledRel1000 = val; }
01286         
01287         Word getHeightScaledRel1000 (void) const    {   return m_heightScaledRel1000;   }
01288         void setHeightScaledRel1000 (const Word val)    {   m_heightScaledRel1000 = val;    }
01289     };
01290 }   // namespace MSWrite    {
01291 
01292 #endif  // __STRUCTURES_GENERATED_H__
01293 
01294 // end of structures_generated.h
KDE Home | KDE Accessibility Home | Description of Access Keys