os/graphics/printingservices/printerdriversupport/src/PDRBODY.H
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef PDRBODY_H
sl@0
    17
#define PDRBODY_H
sl@0
    18
sl@0
    19
#include <e32std.h>
sl@0
    20
#include <s32file.h>
sl@0
    21
#include <pdrstore.h>
sl@0
    22
sl@0
    23
/**
sl@0
    24
@internalComponent
sl@0
    25
*/
sl@0
    26
const TInt KCInfoFontUidVal = 268435524;
sl@0
    27
sl@0
    28
/**
sl@0
    29
pdr store files are backwardly compatible to this value
sl@0
    30
@internalComponent
sl@0
    31
*/
sl@0
    32
const TInt KPdrtranVersion = 22;  
sl@0
    33
sl@0
    34
/**
sl@0
    35
50 points
sl@0
    36
@internalComponent
sl@0
    37
*/
sl@0
    38
const TInt KScalableWidthTableHeightInTwips = 1000;
sl@0
    39
sl@0
    40
/**
sl@0
    41
@internalComponent
sl@0
    42
*/
sl@0
    43
const TInt KMaxCommandStringMaxLength=0x100;
sl@0
    44
sl@0
    45
/**
sl@0
    46
@internalComponent
sl@0
    47
*/
sl@0
    48
enum TStyleIndex
sl@0
    49
	{
sl@0
    50
	EStyleNormal,
sl@0
    51
	EStyleBold,
sl@0
    52
	EStyleItalic,
sl@0
    53
	EStyleBoldItalic
sl@0
    54
	};
sl@0
    55
sl@0
    56
class TPdrResource
sl@0
    57
/**
sl@0
    58
@internalComponent
sl@0
    59
*/
sl@0
    60
	{
sl@0
    61
public:
sl@0
    62
	TPdrResource();
sl@0
    63
	void InternalizeL(RReadStream& aStream);
sl@0
    64
public:
sl@0
    65
	TInt iId;
sl@0
    66
	TCommandString iString;
sl@0
    67
	};
sl@0
    68
sl@0
    69
NONSHARABLE_CLASS(CPdrTranslation) : public CBase
sl@0
    70
/**
sl@0
    71
@internalComponent
sl@0
    72
*/
sl@0
    73
	{
sl@0
    74
public:
sl@0
    75
	CPdrTranslation();
sl@0
    76
	~CPdrTranslation();
sl@0
    77
	void InternalizeL(RReadStream& aStream);
sl@0
    78
public:
sl@0
    79
	TInt iFrom;
sl@0
    80
	HBufC8* iTo;
sl@0
    81
	};
sl@0
    82
sl@0
    83
NONSHARABLE_CLASS(CPdrTranslates) : public CBase
sl@0
    84
/**
sl@0
    85
@internalComponent
sl@0
    86
*/
sl@0
    87
	{
sl@0
    88
public:
sl@0
    89
	CPdrTranslates();
sl@0
    90
	void InternalizeL(RReadStream& aStream);
sl@0
    91
	~CPdrTranslates();
sl@0
    92
	HBufC8* TranslateStringL(const TDesC& aString) const;
sl@0
    93
public:
sl@0
    94
	TStreamId iStreamId;
sl@0
    95
	TInt iNumTranslations;
sl@0
    96
	CPdrTranslation** iTranslationList;
sl@0
    97
	};
sl@0
    98
sl@0
    99
NONSHARABLE_CLASS(CWidthsCodeSection) : public CBase
sl@0
   100
/**
sl@0
   101
@internalComponent
sl@0
   102
*/
sl@0
   103
	{
sl@0
   104
public:
sl@0
   105
	CWidthsCodeSection();
sl@0
   106
	void InternalizeL(RReadStream& aStream);
sl@0
   107
	~CWidthsCodeSection();
sl@0
   108
public:
sl@0
   109
	TCodeSection iCodeSection;
sl@0
   110
	TInt iNumWidths;
sl@0
   111
	TUint16* iWidthList;
sl@0
   112
	};
sl@0
   113
sl@0
   114
NONSHARABLE_CLASS(CFontInfo)	: public CBase
sl@0
   115
/**
sl@0
   116
@internalComponent
sl@0
   117
*/
sl@0
   118
	{
sl@0
   119
public:
sl@0
   120
	CFontInfo(TStreamId aStreamId);
sl@0
   121
	void InternalizeL(RReadStream &aStream);
sl@0
   122
	~CFontInfo();
sl@0
   123
	TInt CharWidthInPixels(TChar aChar) const;
sl@0
   124
	TInt NumCodeSections() const;
sl@0
   125
	TCodeSection CodeSection(TInt anIndex) const;
sl@0
   126
public:
sl@0
   127
	TStreamId iStreamId;
sl@0
   128
	TUint16 iAscentInPixels;
sl@0
   129
	TUint16 iMaxCharWidthInPixels;
sl@0
   130
	TUint16 iMaxNormalCharWidthInPixels;
sl@0
   131
	TInt iNumCodeSections;
sl@0
   132
	CWidthsCodeSection** iCodeSectionList;
sl@0
   133
	};
sl@0
   134
sl@0
   135
class TPdrStyle
sl@0
   136
/**
sl@0
   137
@internalComponent
sl@0
   138
*/
sl@0
   139
	{
sl@0
   140
public:
sl@0
   141
	TPdrStyle();
sl@0
   142
	void InternalizeL(RReadStream &aStream);
sl@0
   143
public:
sl@0
   144
	TBool iIsAvailable;
sl@0
   145
	TStreamId iFontInfoStreamId;
sl@0
   146
	};
sl@0
   147
sl@0
   148
class TPdrFontHeight
sl@0
   149
/**
sl@0
   150
@internalComponent
sl@0
   151
*/
sl@0
   152
	{
sl@0
   153
public:
sl@0
   154
	 TPdrFontHeight();
sl@0
   155
	 void InternalizeL(RReadStream& aStream);
sl@0
   156
public:
sl@0
   157
	TCommandString iCommandString;
sl@0
   158
	TInt iHeightInTwips;
sl@0
   159
	TInt iWidthScale;
sl@0
   160
	TPdrStyle iStyle[EStyleBoldItalic + 1];  // N.B. Don't use enums TFontPosture and TFontStrokeWeight as indices
sl@0
   161
	};
sl@0
   162
sl@0
   163
class TPdrScalableFontHeight
sl@0
   164
/**
sl@0
   165
@internalComponent
sl@0
   166
*/
sl@0
   167
	{
sl@0
   168
public:
sl@0
   169
	TPdrScalableFontHeight();
sl@0
   170
	void InternalizeL(RReadStream& aStream);
sl@0
   171
public:
sl@0
   172
	TCommandString iCommandString;
sl@0
   173
	TInt iHeightMinInTwips;
sl@0
   174
	TInt iHeightMaxInTwips;
sl@0
   175
	TInt iHeightDeltaInTwips;
sl@0
   176
	TPdrStyle iStyle[EStyleBoldItalic + 1];  // N.B. Don't use enums TFontPosture and TFontStrokeWeight as indices
sl@0
   177
	};
sl@0
   178
sl@0
   179
NONSHARABLE_CLASS(CTypefaceFonts) : public CBase
sl@0
   180
/**
sl@0
   181
@internalComponent
sl@0
   182
*/
sl@0
   183
	{
sl@0
   184
public:
sl@0
   185
	CTypefaceFonts();
sl@0
   186
	void InternalizeL(RReadStream& aStream);
sl@0
   187
	~CTypefaceFonts();
sl@0
   188
	TInt IsScalable() const;
sl@0
   189
	TInt NumFontHeights() const;
sl@0
   190
	TInt FontHeightInTwips(TInt aHeightIndex) const;
sl@0
   191
	TInt FontInfoHeightInTwips(TInt aHeightIndex) const;
sl@0
   192
	void CommandString(TDes8& aDes, TInt aHeightIndex) const;
sl@0
   193
	TPdrStyle* Style(TInt aHeightIndex, TFontStyle& aFontStyle) const;
sl@0
   194
	TTypeface Typeface();
sl@0
   195
private:
sl@0
   196
	TStyleIndex StyleIndex(TFontStyle& aFontStyle) const;
sl@0
   197
private:
sl@0
   198
	TTypeface iTypeface;
sl@0
   199
	TInt iNumFontHeights;  // Also used as flag	for !iIsScalable
sl@0
   200
	TPdrFontHeight* iFontHeightList;
sl@0
   201
	TPdrScalableFontHeight* iScalableFontHeight;
sl@0
   202
public:
sl@0
   203
	TSwizzle<CPdrTranslates> iTranslates;
sl@0
   204
	};
sl@0
   205
sl@0
   206
#endif