22#ifndef __STRUCTURES_PRIVATE_H__
23#define __STRUCTURES_PRIVATE_H__
25#include "structures_generated.h"
30 class Header :
public HeaderGenerated
36 bool readFromDevice (
void);
friend class InternalParser;
37 bool writeToDevice (
void);
friend class InternalGenerator;
43 Header &operator= (
const Header &rhs);
45 Word getFormat (
void)
const {
return getMagic (); }
46 void setFormat (
const Word f) { setMagic (f); }
48 DWord getNumCharBytes (
void)
const {
return m_numCharBytes; }
49 void setNumCharBytes (
const DWord w) { m_numCharBytes = w; }
51 Word getNumPageCharInfo (
void)
const {
return m_pageParaInfo - m_pageCharInfo; }
52 Word getNumPageParaInfo (
void)
const {
return m_pageFootnoteTable - m_pageParaInfo; }
53 Word getNumPageFootnoteTable (
void)
const {
return m_pageSectionProperty - m_pageFootnoteTable; }
54 Word getNumPageSectionProperty (
void)
const {
return m_pageSectionTable - m_pageSectionProperty; }
55 Word getNumPageSectionTable (
void)
const {
return m_pagePageTable - m_pageSectionTable; }
56 Word getNumPagePageTable (
void)
const {
return m_pageFontTable - m_pagePageTable; }
57 Word getNumPageFontTable (
void)
const {
return m_numPages - m_pageFontTable; }
59 Word getPageCharInfo (
void)
const {
return m_pageCharInfo; }
68 NeedsHeader (Header *header = NULL)
73 virtual ~NeedsHeader ()
77 NeedsHeader &operator= (
const NeedsHeader &rhs)
82 m_header = rhs.m_header;
87 void setHeader (Header *header) { m_header = header; }
91 class SectionDescriptor :
public SectionDescriptorGenerated
95 virtual ~SectionDescriptor ();
97 SectionDescriptor &operator= (
const SectionDescriptor &rhs);
101 class SectionTable :
public SectionTableGenerated,
public NeedsHeader
105 virtual ~SectionTable ();
107 SectionTable &operator= (
const SectionTable &rhs);
110 bool readFromDevice (
void);
friend class InternalParser;
111 bool writeToDevice (
const bool needed);
friend class InternalGenerator;
116 class FontTable :
public FontTableGenerated,
public NeedsHeader
119 List <Font> m_fontList;
121 bool readFromDevice (
void);
friend class InternalParser;
122 bool writeToDevice (
void);
friend class InternalGenerator;
126 virtual ~FontTable ();
128 FontTable &operator= (
const FontTable &rhs);
130 Font *getFont (
const DWord fontCode)
const;
131 DWord findFont (
const Font *want)
const;
132 DWord addFont (
const Font *input);
136 class PagePointer :
public PagePointerGenerated
139 friend class PageTable;
140 bool readFromDevice (
void);
141 bool writeToDevice (
void);
145 virtual ~PagePointer ();
147 PagePointer &operator= (
const PagePointer &rhs);
151 class PageTable :
public PageTableGenerated,
public NeedsHeader
154 List <PagePointer> m_pagePointerList;
155 Word m_pageNumberStart;
157 friend class InternalParser;
158 friend class InternalGenerator;
159 bool readFromDevice (
void);
160 bool writeToDevice (
void);
163 void setPageNumberStart (
const Word s) { m_pageNumberStart = s; }
165 List <PagePointer>::Iterator m_pageTableIterator;
169 virtual ~PageTable ();
171 PageTable &operator= (
const PageTable &rhs);
173 PagePointer *begin (
void)
175 m_pageTableIterator = m_pagePointerList.begin ();
176 return &(*m_pageTableIterator);
179 PagePointer *next (
void)
181 m_pageTableIterator = m_pageTableIterator.next ();
182 return &(*m_pageTableIterator);
187 return m_pageTableIterator == m_pagePointerList.end ();
190 bool add (
const PagePointer *newone)
192 return m_pagePointerList.addToBack (*newone);
197 class FormatPointer :
public FormatPointerGenerated
200 DWord m_afterEndCharByte;
202 friend class FormatInfoPage;
203 bool readFromDevice (
void);
204 bool writeToDevice (
void);
209 const void *m_formatProperty;
211 const void *getFormatProperty (
void)
const {
return m_formatProperty; }
212 void setFormatProperty (
const void *val) { m_formatProperty = val; }
216 virtual ~FormatPointer ();
218 FormatPointer &operator= (
const FormatPointer &rhs);
220 DWord getAfterEndCharByte (
void)
const {
return m_afterEndCharByte; }
221 void setAfterEndCharByte (
const DWord val) { m_afterEndCharByte = val; }
225 enum FormatInfoPageTypes
231 class FormatCharProperty;
232 class FormatParaProperty;
233 class FormatInfoPage :
public FormatInfoPageGenerated,
public NeedsHeader
236 DWord m_firstCharByte;
237 enum FormatInfoPageTypes m_type;
245 FormatPointer *m_formatPointer;
248 FormatCharProperty *m_formatCharProperty;
249 FontTable *m_fontTable;
250 FormatParaProperty *m_formatParaProperty;
251 Word m_leftMargin, m_rightMargin;
257 int m_formatPointerUpto;
258 DWord m_nextCharByte;
259 int m_lastPropertyOffset;
260 int m_formatPointerPos, m_formatPropertyPos;
264 friend class FormatInfo;
265 bool readFromDevice (
void);
266 bool writeToDevice (
void);
267 bool writeToArray (
void);
270 FormatInfoPage &operator= (
const FormatInfoPage &rhs);
274 virtual ~FormatInfoPage ();
276 void setMargins (
const Word leftMargin,
const Word rightMargin)
278 m_leftMargin = leftMargin, m_rightMargin = rightMargin;
280 void setFontTable (FontTable *fontTable)
282 m_fontTable = fontTable;
285 void setType (
const enum FormatInfoPageTypes t) { m_type = t; }
287 DWord getFirstCharByte (
void)
const {
return m_firstCharByte; }
288 void setFirstCharByte (
const DWord val) { m_firstCharByte = val; }
290 DWord getNextCharByte (
void)
const {
return m_nextCharByte; }
295 bool end (
void)
const;
297 bool add (
const void *property);
301 class BMP_BitmapFileHeader :
public BMP_BitmapFileHeaderGenerated
304 BMP_BitmapFileHeader ();
305 virtual ~BMP_BitmapFileHeader ();
307 BMP_BitmapFileHeader &operator= (
const BMP_BitmapFileHeader &rhs);
309 bool readFromDevice (
void);
310 bool writeToDevice (
void);
314 class BMP_BitmapInfoHeader :
public BMP_BitmapInfoHeaderGenerated
317 BMP_BitmapInfoHeader ();
318 virtual ~BMP_BitmapInfoHeader ();
320 BMP_BitmapInfoHeader &operator= (
const BMP_BitmapInfoHeader &rhs);
322 bool readFromDevice (
void);
323 bool writeToDevice (
void);
327 class BMP_BitmapColourIndex :
public BMP_BitmapColourIndexGenerated
330 BMP_BitmapColourIndex ();
331 virtual ~BMP_BitmapColourIndex ();
333 BMP_BitmapColourIndex &operator= (
const BMP_BitmapColourIndex &rhs);
337 class BitmapHeader :
public BitmapHeaderGenerated
343 virtual ~BitmapHeader ();
345 BitmapHeader &operator= (
const BitmapHeader &rhs);
347 bool readFromDevice (
void);
348 bool writeToDevice (
void);
352 class WMFHeader :
public WMFHeaderGenerated
358 virtual ~WMFHeader ();
360 WMFHeader &operator= (
const WMFHeader &rhs);
362 bool readFromDevice (
void);
363 bool writeToDevice (
void);