1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
18 #ifndef __PDRRECRD_H__
19 #define __PDRRECRD_H__
26 Index of text styles used by printer description records.
38 /** Bold italic text. */
44 This class encapsulates a printer resource.
50 IMPORT_C static PdrResource* New();
51 IMPORT_C void Delete();
52 void Externalize(ostream& out);
54 /** Resource identifier. */
56 /** String containing the resource. */
60 class PdrResources : public Record
62 This class holds printer resources.
68 IMPORT_C static PdrResources* New();
69 IMPORT_C void Delete();
70 void Externalize(ostream& out);
71 IMPORT_C void AddResource(PdrResource* aResource);
75 ObjectList<PdrResource*> iPdrResourceList;
80 This class holds a translation between printer descriptions.
86 IMPORT_C static PdrTranslation* New();
87 IMPORT_C void Delete();
88 void Externalize(ostream& out);
90 /** Printer identifier to translate from. */
92 /** Printer identifier to translate to. */
93 String iTo; // !! Think about Unicode version
96 class PdrTranslates : public Record
98 This class encapsulates a list of printer description translations.
104 IMPORT_C static PdrTranslates* New();
105 IMPORT_C void Delete();
106 void Externalize(ostream& out);
107 IMPORT_C void AddTranslation(PdrTranslation* aTranslation);
111 ObjectList<PdrTranslation*> iPdrTranslationList;
116 This class is used to hold font widths. It is used by printer descriptions.
122 IMPORT_C static Width* New();
123 IMPORT_C void Delete();
124 void Externalize(ostream& out);
126 /** Font width in pixels. */
127 uint16 iWidthInPixels;
130 class WidthsCodeSection
132 This class encapsulates a list of font widths used by printer descriptions.
140 IMPORT_C static WidthsCodeSection* New();
141 IMPORT_C void Delete();
142 void Externalize(ostream& out);
143 IMPORT_C void AddWidth(Width* aWidth);
144 IMPORT_C Width* WidthList(int i);
145 IMPORT_C int NumWidths();
146 ~WidthsCodeSection();
148 /** Start of list. */
153 ObjectList<Width*> iWidthList;
156 class FontInfo : public Record
158 This class contains information about fonts. It is used by a printer description.
164 IMPORT_C static FontInfo* New();
165 IMPORT_C void Delete();
166 void Externalize(ostream& out);
167 IMPORT_C void AddCodeSection(WidthsCodeSection* aCodeSection);
168 IMPORT_C WidthsCodeSection* CodeSectionList(int i);
169 IMPORT_C int NumCodeSections();
173 /** Font ascent in pixels. */
174 uint16 iAscentInPixels;
175 /** Maximum font character width in pixels. */
176 uint16 iMaxCharWidthInPixels;
177 /** Normal font character width in pixels. */
178 uint16 iMaxNormalCharWidthInPixels;
180 ObjectList<WidthsCodeSection*> iCodeSectionList;
185 This class contains information about a font style used in a printer descriptions.
191 IMPORT_C static PdrStyle* New();
192 IMPORT_C void Delete();
193 void Externalize(ostream& out);
196 /** Determines whether the font is available for use. */
197 boolean iIsAvailable;
198 /** Reference to a record containing information about the font. */
204 This class stores information for use in printer descriptions about font heights
205 and relative scaling.
211 IMPORT_C static PdrFontHeight* New();
212 IMPORT_C void Delete();
213 void Externalize(ostream& out);
216 /** Command string associated with font height. */
217 String iCommandString;
218 /** Font height in twips. */
219 int32 iHeightInTwips;
220 /** Width scaling. */
222 /** Array containing space for four styles. */
223 PdrStyle iStyle[BoldItalic + 1]; // Array for four styles
226 class PdrScalableFontHeight
228 This class contains information on scalable fonts used by printer descriptions.
234 PdrScalableFontHeight();
235 void Externalize(ostream& out);
237 /** Contains a printer command string associated with this font. */
238 String iCommandString;
239 /** Minimum height in twips. */
240 int32 iHeightMinInTwips;
241 /** Maximum height in twips. */
242 int32 iHeightMaxInTwips;
243 /** Scale delta in twips. */
244 int32 iHeightDeltaInTwips;
245 /** Array for four styles. */
246 PdrStyle iStyle[BoldItalic + 1]; // Array for four styles
249 class TypefaceFonts : public Record
251 This class encapsulates a list of font heights for printer descriptions.
257 IMPORT_C static TypefaceFonts* New();
258 IMPORT_C void Delete();
259 void Externalize(ostream& out);
260 IMPORT_C void AddFontHeight(PdrFontHeight* aFontHeight);
261 IMPORT_C int NumFontHeights();
262 PdrFontHeight* FontHeightList(int i);
268 /** Determines whether the font height is scalable. */
271 ObjectList<PdrFontHeight*> iFontHeightList;
273 /** Describes a scalable font height. */
274 PdrScalableFontHeight iScalableFontHeight;
278 class TypefaceFontsEntry
280 This class encapsulates information about a printer font.
286 IMPORT_C static TypefaceFontsEntry* New(Record* aTypefaceFonts);
287 IMPORT_C void Delete();
288 void Externalize(ostream& out);
290 TypefaceFontsEntry(Record* aTypefaceFonts);
292 ~TypefaceFontsEntry();
294 /** Contains the font record. */
295 Record* iTypefaceFonts;
296 /** Determines whether the font can be used in portrait view. */
297 boolean iNotInPortrait;
298 /** Determines whether the font can be used in landscape view. */
299 boolean iNotInLandscape;
304 This class contains the margins used by a printer description.
310 void Externalize(ostream& out);
318 /** Bottom margin. */
322 class PdrExtraInfo : public Record
326 void Externalize(ostream& out);
328 ObjectList<String*> iInfo;
333 This class contains information about a printer model used by a printer description.
339 void Externalize(ostream& out);
340 IMPORT_C void AddTypefaceFontsEntry(TypefaceFontsEntry* aTypefaceFontsEntry);
341 int NumTypefaceFontsEntries();
342 TypefaceFontsEntry* TypefaceFontsEntryList(int i);
347 /** Flags associated with model. */
349 /** Pixel width in twips. */
350 int32 iKPixelWidthInTwips;
351 /** Pixel height in twips. */
352 int32 iKPixelHeightInTwips;
353 /** Portrait printng offset in twips. */
354 Point iPortraitOffsetInPixels;
355 /** Landscape printing offset in twips. */
356 Point iLandscapeOffsetInPixels;
357 /** Minimum margin in pixels. */
358 Margins iMinMarginsInPixels;
362 ObjectList<TypefaceFontsEntry*> iTypefaceFontsEntryList;
365 Record *iSpareRecord;
368 class PrinterModelEntry
370 This class contains information on a printer model.
377 void Externalize(ostream& out);
381 /** Whether a printer port is required. */
382 boolean iRequiresPrinterPort;
386 class PrinterModelHeader : public Record
388 This class encapsulates information about a printer model.
394 IMPORT_C static PrinterModelHeader* New();
395 IMPORT_C void Delete();
396 void Externalize(ostream& out);
397 void ExternalizeData(ostream& out);
398 boolean IsPdrModel();
400 /** Printer model entry. */
401 PrinterModelEntry iEntry;
402 /** Printer model information. */
406 class PdrStoreFile : public Record
408 This class stores printer description files.
414 IMPORT_C static PdrStoreFile* New();
415 IMPORT_C void Delete();
416 IMPORT_C void AddModel(PrinterModelHeader *aModel);
417 void Externalize(ostream& out);
421 void AddTypefaceFonts(TypefaceFonts* aTypefaceFonts);
422 void ExternalizeHeader(ostream& out);
423 void ExternalizeComponents(ostream& out);
425 /** Printer descriptor. */
429 RecordList iModelList;
430 RecordList iTypefaceFontsList;
431 RecordList iFontInfoList;
432 RecordList iResourcesList;
433 RecordList iTranslatesList;
434 // RecordList iExtraInfoList;
439 This class is used to store information about printer models, and externalize
440 it to external files.
446 IMPORT_C boolean Store(const String& aFilename);
447 IMPORT_C void AddPdrStoreFile(PdrStoreFile* aPdrStoreFile);
448 IMPORT_C void AddModel(PrinterModelHeader *aModel);
449 IMPORT_C Record* FindModel(String& aLabel);
450 IMPORT_C void AddTypefaceFonts(TypefaceFonts *aTypefaceFonts);
451 IMPORT_C Record* FindTypefaceFonts(String& aLabel);
452 IMPORT_C void AddFontInfo(FontInfo *aFontInfo);
453 IMPORT_C Record* FindFontInfo(String& aLabel);
454 IMPORT_C void AddResources(PdrResources *aResources);
455 IMPORT_C Record* FindResources(String& aLabel);
456 IMPORT_C void AddTranslates(PdrTranslates *aTranslates);
457 IMPORT_C Record* FindTranslates(String& aLabel);
458 // void AddExtraInfo(PdrExtraInfo *aInfo);
459 // Record* FindExtraInfo(String& aLabel);
463 /** This attribute is internal, and is not intended for use. */
464 PdrStoreFile* iPdrStoreFile;
465 RecordList iModelList;
466 RecordList iTypefaceFontsList;
467 RecordList iFontInfoList;
468 RecordList iResourcesList;
469 RecordList iTranslatesList;
470 // RecordList iExtraInfoList;