fontservices/textbase/inc/gdiinline.inl
changeset 45 662fa7de7023
equal deleted inserted replaced
41:ea44a32a96bc 45:662fa7de7023
       
     1 // Copyright (c) 1998-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 // Contains the inline functions IsAlphaChannel, QuoteOrBracketPair and IsIgnoredCharacterForLocalisedProcFunc.
       
    15 // 
       
    16 //
       
    17 #ifndef GDIINLINE_INL
       
    18 #define GDIINLINE_INL
       
    19 
       
    20 	
       
    21 /** Utility function to check if a display mode has Alpha channel information
       
    22 @param aDisplayMode - the display mode being queried
       
    23 @return ETrue if display mode contains Alpha information.
       
    24 @internalTechnology
       
    25 @released
       
    26 */
       
    27 inline TBool IsAlphaChannel(TDisplayMode aDisplayMode)
       
    28 	{
       
    29 	if(aDisplayMode == EColor16MAP || aDisplayMode == EColor16MA) 
       
    30 		return ETrue;
       
    31 	else
       
    32 		return EFalse;
       
    33 	}
       
    34 
       
    35 /**
       
    36 @internalTechnology
       
    37 @released
       
    38 */
       
    39 inline TUint QuoteOrBracketPair(TUint code)
       
    40 	{
       
    41 	// given the opening/closing quote or bracket, return the corresponding closing/opening quote or bracket
       
    42 	switch(code)
       
    43 		{
       
    44 		case 0x0022: return 0x0022; // "..."
       
    45 		case 0x0027: return 0x0027; // '...'
       
    46 		case 0x0028: return 0x0029; // (...)
       
    47 		case 0x003c: return 0x003e; // <...>
       
    48 		case 0x005b: return 0x005d; // [...]
       
    49 		case 0x007b: return 0x007d; // {...}
       
    50 		case 0x2018: return 0x2019; // Single quotation marks
       
    51 		case 0x201b: return 0x2019; // Single high-reversed-9 quotation mark
       
    52 		case 0x201c: return 0x201d; // Double quotation marks
       
    53 		case 0x201f: return 0x201d; // Double high-reversed-9 quotation mark
       
    54 		case 0x2035: return 0x2032; // Single primes
       
    55 		case 0x2036: return 0x2033; // Double primes
       
    56 		case 0x2037: return 0x2034; // Triple primes
       
    57 		case 0x2039: return 0x203a; // Single left/right-pointing angle quotation marks
       
    58 		case 0x2045: return 0x2046; // Square brackets with quill
       
    59 		
       
    60 		case 0x0029: return 0x0028; // (...)
       
    61 		case 0x003e: return 0x003c; // <...>
       
    62 		case 0x005d: return 0x005b; // [...]
       
    63 		case 0x007d: return 0x007b; // {...}
       
    64 		case 0x2019: return 0x2018; // Single quotation marks
       
    65 		case 0x201d: return 0x201c; // Double quotation marks
       
    66 		case 0x2032: return 0x2035; // Single primes
       
    67 		case 0x2033: return 0x2036; // Double primes
       
    68 		case 0x2034: return 0x2037; // Triple primes
       
    69 		case 0x203a: return 0x2039; // Single left/right-pointing angle quotation marks
       
    70 		case 0x2046: return 0x2045; // Square brackets with quill
       
    71 				
       
    72 		default: return 0;
       
    73 		}
       
    74 	}
       
    75 
       
    76 /**
       
    77 @internalTechnology
       
    78 @released
       
    79 */	
       
    80 inline TBool IsIgnoredCharacterForLocalisedProcFunc(TChar aCode)
       
    81 	{
       
    82 	TChar::TBdCategory cat = aCode.GetBdCategory();
       
    83 
       
    84 	if ((cat == TChar::ELeftToRight ||
       
    85 		cat == TChar::ERightToLeft ||
       
    86 		cat == TChar::ERightToLeftArabic) && aCode != 0 && aCode != 0xFFFF)
       
    87 		return EFalse;
       
    88 	
       
    89 	return ETrue;
       
    90 	}
       
    91 
       
    92 
       
    93 
       
    94 
       
    95 #endif /* GDIINLINE_INL */