os/graphics/graphicsdeviceinterface/gdi/inc/gdiinline.inl
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicsdeviceinterface/gdi/inc/gdiinline.inl	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,95 @@
     1.4 +// Copyright (c) 1998-2009 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 +// Contains the inline functions IsAlphaChannel, QuoteOrBracketPair and IsIgnoredCharacterForLocalisedProcFunc.
    1.18 +// 
    1.19 +//
    1.20 +#ifndef GDIINLINE_INL
    1.21 +#define GDIINLINE_INL
    1.22 +
    1.23 +	
    1.24 +/** Utility function to check if a display mode has Alpha channel information
    1.25 +@param aDisplayMode - the display mode being queried
    1.26 +@return ETrue if display mode contains Alpha information.
    1.27 +@internalTechnology
    1.28 +@released
    1.29 +*/
    1.30 +inline TBool IsAlphaChannel(TDisplayMode aDisplayMode)
    1.31 +	{
    1.32 +	if(aDisplayMode == EColor16MAP || aDisplayMode == EColor16MA) 
    1.33 +		return ETrue;
    1.34 +	else
    1.35 +		return EFalse;
    1.36 +	}
    1.37 +
    1.38 +/**
    1.39 +@internalTechnology
    1.40 +@released
    1.41 +*/
    1.42 +inline TUint QuoteOrBracketPair(TUint code)
    1.43 +	{
    1.44 +	// given the opening/closing quote or bracket, return the corresponding closing/opening quote or bracket
    1.45 +	switch(code)
    1.46 +		{
    1.47 +		case 0x0022: return 0x0022; // "..."
    1.48 +		case 0x0027: return 0x0027; // '...'
    1.49 +		case 0x0028: return 0x0029; // (...)
    1.50 +		case 0x003c: return 0x003e; // <...>
    1.51 +		case 0x005b: return 0x005d; // [...]
    1.52 +		case 0x007b: return 0x007d; // {...}
    1.53 +		case 0x2018: return 0x2019; // Single quotation marks
    1.54 +		case 0x201b: return 0x2019; // Single high-reversed-9 quotation mark
    1.55 +		case 0x201c: return 0x201d; // Double quotation marks
    1.56 +		case 0x201f: return 0x201d; // Double high-reversed-9 quotation mark
    1.57 +		case 0x2035: return 0x2032; // Single primes
    1.58 +		case 0x2036: return 0x2033; // Double primes
    1.59 +		case 0x2037: return 0x2034; // Triple primes
    1.60 +		case 0x2039: return 0x203a; // Single left/right-pointing angle quotation marks
    1.61 +		case 0x2045: return 0x2046; // Square brackets with quill
    1.62 +		
    1.63 +		case 0x0029: return 0x0028; // (...)
    1.64 +		case 0x003e: return 0x003c; // <...>
    1.65 +		case 0x005d: return 0x005b; // [...]
    1.66 +		case 0x007d: return 0x007b; // {...}
    1.67 +		case 0x2019: return 0x2018; // Single quotation marks
    1.68 +		case 0x201d: return 0x201c; // Double quotation marks
    1.69 +		case 0x2032: return 0x2035; // Single primes
    1.70 +		case 0x2033: return 0x2036; // Double primes
    1.71 +		case 0x2034: return 0x2037; // Triple primes
    1.72 +		case 0x203a: return 0x2039; // Single left/right-pointing angle quotation marks
    1.73 +		case 0x2046: return 0x2045; // Square brackets with quill
    1.74 +				
    1.75 +		default: return 0;
    1.76 +		}
    1.77 +	}
    1.78 +
    1.79 +/**
    1.80 +@internalTechnology
    1.81 +@released
    1.82 +*/	
    1.83 +inline TBool IsIgnoredCharacterForLocalisedProcFunc(TChar aCode)
    1.84 +	{
    1.85 +	TChar::TBdCategory cat = aCode.GetBdCategory();
    1.86 +
    1.87 +	if ((cat == TChar::ELeftToRight ||
    1.88 +		cat == TChar::ERightToLeft ||
    1.89 +		cat == TChar::ERightToLeftArabic) && aCode != 0 && aCode != 0xFFFF)
    1.90 +		return EFalse;
    1.91 +	
    1.92 +	return ETrue;
    1.93 +	}
    1.94 +
    1.95 +
    1.96 +
    1.97 +
    1.98 +#endif /* GDIINLINE_INL */