fontservices/textbase/inc/ShapeImpl.h
changeset 45 662fa7de7023
equal deleted inserted replaced
41:ea44a32a96bc 45:662fa7de7023
       
     1 // Copyright (c) 2005-2010 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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef SHAPEIMPL_H_
       
    17 #define SHAPEIMPL_H_
       
    18 
       
    19 #include <e32cmn.h>
       
    20 
       
    21 /**@file
       
    22 @internalTechnology
       
    23 */
       
    24 
       
    25 class CFont;
       
    26 class TDesC16;
       
    27 
       
    28 const TUid KFontGetShaping = {0x10274246};
       
    29 const TUid KFontDeleteShaping = {0x102744D7};
       
    30 
       
    31 /** Internal class describing shaping information. */
       
    32 class TShapeHeader
       
    33 	{
       
    34 public:
       
    35 	/** Number of glyphs output. */
       
    36 	TInt iGlyphCount;
       
    37 	/** Number of characters consumed from the input. */
       
    38 	TInt iCharacterCount;
       
    39 	/** Reserved for future expansion. */
       
    40 	TInt iReserved0;
       
    41 	/** Reserved for future expansion. */
       
    42 	TInt iReserved1;
       
    43 	/** The glyph, position and indices data.
       
    44 
       
    45 	The first iGlyphCount * 4 bytes contain the glyph codes
       
    46 	as 2-byte values. The next iGlyphCount * 4 + 4 bytes contain the
       
    47 	positions in which these glyphs are to be drawn, in pixels, taking
       
    48 	the original pen position as origin, with the x axis going right and
       
    49 	the y axis going down. The next iGlyphCount * 2 bytes contain the
       
    50 	indices of the characters in the input string that correspond to the
       
    51 	glyphs in the output.
       
    52 	
       
    53 	The final entry in the position array is the total advance of the text.
       
    54 
       
    55 	Therefore this buffer is actually iGlyphCount * 10 + 4 bytes long. */
       
    56 	TInt8 iBuffer[1];
       
    57 	};
       
    58 
       
    59 /** For CFont::ExtendedFunctions aParam argument, with KFontGetShaping
       
    60 function ID. */
       
    61 class TFontShapeFunctionParameters
       
    62 	{
       
    63 public:
       
    64 	/** The text, including context. */
       
    65 	const TDesC16* iText;
       
    66 	/** The start of the meat within iText. */
       
    67 	TInt iStart;
       
    68 	/** The end of the meat within iText. */
       
    69 	TInt iEnd;
       
    70 	/** Script code. */
       
    71 	TInt iScript;
       
    72 	/** Language code. 0 for default. */
       
    73 	TInt iLanguage;
       
    74 	/** Output from the shaper; a TShapeHeader on the shared heap. */
       
    75 	const TShapeHeader* iShapeHeaderOutput;
       
    76 	};
       
    77 
       
    78 /** For CFont::ExtendedFunctions aParam argument, with KFontDeleteShaping
       
    79 function ID. */
       
    80 class TFontShapeDeleteFunctionParameters
       
    81 	{
       
    82 public:
       
    83 	const TShapeHeader* iShapeHeader;
       
    84 	};
       
    85 
       
    86 #endif