os/graphics/printingservices/printerdriversupport/src/PDRBODY.H
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/printingservices/printerdriversupport/src/PDRBODY.H	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,206 @@
     1.4 +// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef PDRBODY_H
    1.20 +#define PDRBODY_H
    1.21 +
    1.22 +#include <e32std.h>
    1.23 +#include <s32file.h>
    1.24 +#include <pdrstore.h>
    1.25 +
    1.26 +/**
    1.27 +@internalComponent
    1.28 +*/
    1.29 +const TInt KCInfoFontUidVal = 268435524;
    1.30 +
    1.31 +/**
    1.32 +pdr store files are backwardly compatible to this value
    1.33 +@internalComponent
    1.34 +*/
    1.35 +const TInt KPdrtranVersion = 22;  
    1.36 +
    1.37 +/**
    1.38 +50 points
    1.39 +@internalComponent
    1.40 +*/
    1.41 +const TInt KScalableWidthTableHeightInTwips = 1000;
    1.42 +
    1.43 +/**
    1.44 +@internalComponent
    1.45 +*/
    1.46 +const TInt KMaxCommandStringMaxLength=0x100;
    1.47 +
    1.48 +/**
    1.49 +@internalComponent
    1.50 +*/
    1.51 +enum TStyleIndex
    1.52 +	{
    1.53 +	EStyleNormal,
    1.54 +	EStyleBold,
    1.55 +	EStyleItalic,
    1.56 +	EStyleBoldItalic
    1.57 +	};
    1.58 +
    1.59 +class TPdrResource
    1.60 +/**
    1.61 +@internalComponent
    1.62 +*/
    1.63 +	{
    1.64 +public:
    1.65 +	TPdrResource();
    1.66 +	void InternalizeL(RReadStream& aStream);
    1.67 +public:
    1.68 +	TInt iId;
    1.69 +	TCommandString iString;
    1.70 +	};
    1.71 +
    1.72 +NONSHARABLE_CLASS(CPdrTranslation) : public CBase
    1.73 +/**
    1.74 +@internalComponent
    1.75 +*/
    1.76 +	{
    1.77 +public:
    1.78 +	CPdrTranslation();
    1.79 +	~CPdrTranslation();
    1.80 +	void InternalizeL(RReadStream& aStream);
    1.81 +public:
    1.82 +	TInt iFrom;
    1.83 +	HBufC8* iTo;
    1.84 +	};
    1.85 +
    1.86 +NONSHARABLE_CLASS(CPdrTranslates) : public CBase
    1.87 +/**
    1.88 +@internalComponent
    1.89 +*/
    1.90 +	{
    1.91 +public:
    1.92 +	CPdrTranslates();
    1.93 +	void InternalizeL(RReadStream& aStream);
    1.94 +	~CPdrTranslates();
    1.95 +	HBufC8* TranslateStringL(const TDesC& aString) const;
    1.96 +public:
    1.97 +	TStreamId iStreamId;
    1.98 +	TInt iNumTranslations;
    1.99 +	CPdrTranslation** iTranslationList;
   1.100 +	};
   1.101 +
   1.102 +NONSHARABLE_CLASS(CWidthsCodeSection) : public CBase
   1.103 +/**
   1.104 +@internalComponent
   1.105 +*/
   1.106 +	{
   1.107 +public:
   1.108 +	CWidthsCodeSection();
   1.109 +	void InternalizeL(RReadStream& aStream);
   1.110 +	~CWidthsCodeSection();
   1.111 +public:
   1.112 +	TCodeSection iCodeSection;
   1.113 +	TInt iNumWidths;
   1.114 +	TUint16* iWidthList;
   1.115 +	};
   1.116 +
   1.117 +NONSHARABLE_CLASS(CFontInfo)	: public CBase
   1.118 +/**
   1.119 +@internalComponent
   1.120 +*/
   1.121 +	{
   1.122 +public:
   1.123 +	CFontInfo(TStreamId aStreamId);
   1.124 +	void InternalizeL(RReadStream &aStream);
   1.125 +	~CFontInfo();
   1.126 +	TInt CharWidthInPixels(TChar aChar) const;
   1.127 +	TInt NumCodeSections() const;
   1.128 +	TCodeSection CodeSection(TInt anIndex) const;
   1.129 +public:
   1.130 +	TStreamId iStreamId;
   1.131 +	TUint16 iAscentInPixels;
   1.132 +	TUint16 iMaxCharWidthInPixels;
   1.133 +	TUint16 iMaxNormalCharWidthInPixels;
   1.134 +	TInt iNumCodeSections;
   1.135 +	CWidthsCodeSection** iCodeSectionList;
   1.136 +	};
   1.137 +
   1.138 +class TPdrStyle
   1.139 +/**
   1.140 +@internalComponent
   1.141 +*/
   1.142 +	{
   1.143 +public:
   1.144 +	TPdrStyle();
   1.145 +	void InternalizeL(RReadStream &aStream);
   1.146 +public:
   1.147 +	TBool iIsAvailable;
   1.148 +	TStreamId iFontInfoStreamId;
   1.149 +	};
   1.150 +
   1.151 +class TPdrFontHeight
   1.152 +/**
   1.153 +@internalComponent
   1.154 +*/
   1.155 +	{
   1.156 +public:
   1.157 +	 TPdrFontHeight();
   1.158 +	 void InternalizeL(RReadStream& aStream);
   1.159 +public:
   1.160 +	TCommandString iCommandString;
   1.161 +	TInt iHeightInTwips;
   1.162 +	TInt iWidthScale;
   1.163 +	TPdrStyle iStyle[EStyleBoldItalic + 1];  // N.B. Don't use enums TFontPosture and TFontStrokeWeight as indices
   1.164 +	};
   1.165 +
   1.166 +class TPdrScalableFontHeight
   1.167 +/**
   1.168 +@internalComponent
   1.169 +*/
   1.170 +	{
   1.171 +public:
   1.172 +	TPdrScalableFontHeight();
   1.173 +	void InternalizeL(RReadStream& aStream);
   1.174 +public:
   1.175 +	TCommandString iCommandString;
   1.176 +	TInt iHeightMinInTwips;
   1.177 +	TInt iHeightMaxInTwips;
   1.178 +	TInt iHeightDeltaInTwips;
   1.179 +	TPdrStyle iStyle[EStyleBoldItalic + 1];  // N.B. Don't use enums TFontPosture and TFontStrokeWeight as indices
   1.180 +	};
   1.181 +
   1.182 +NONSHARABLE_CLASS(CTypefaceFonts) : public CBase
   1.183 +/**
   1.184 +@internalComponent
   1.185 +*/
   1.186 +	{
   1.187 +public:
   1.188 +	CTypefaceFonts();
   1.189 +	void InternalizeL(RReadStream& aStream);
   1.190 +	~CTypefaceFonts();
   1.191 +	TInt IsScalable() const;
   1.192 +	TInt NumFontHeights() const;
   1.193 +	TInt FontHeightInTwips(TInt aHeightIndex) const;
   1.194 +	TInt FontInfoHeightInTwips(TInt aHeightIndex) const;
   1.195 +	void CommandString(TDes8& aDes, TInt aHeightIndex) const;
   1.196 +	TPdrStyle* Style(TInt aHeightIndex, TFontStyle& aFontStyle) const;
   1.197 +	TTypeface Typeface();
   1.198 +private:
   1.199 +	TStyleIndex StyleIndex(TFontStyle& aFontStyle) const;
   1.200 +private:
   1.201 +	TTypeface iTypeface;
   1.202 +	TInt iNumFontHeights;  // Also used as flag	for !iIsScalable
   1.203 +	TPdrFontHeight* iFontHeightList;
   1.204 +	TPdrScalableFontHeight* iScalableFontHeight;
   1.205 +public:
   1.206 +	TSwizzle<CPdrTranslates> iTranslates;
   1.207 +	};
   1.208 +
   1.209 +#endif