sl@0: // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Contains the inline functions IsAlphaChannel, QuoteOrBracketPair and IsIgnoredCharacterForLocalisedProcFunc. sl@0: // sl@0: // sl@0: #ifndef GDIINLINE_INL sl@0: #define GDIINLINE_INL sl@0: sl@0: sl@0: /** Utility function to check if a display mode has Alpha channel information sl@0: @param aDisplayMode - the display mode being queried sl@0: @return ETrue if display mode contains Alpha information. sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: inline TBool IsAlphaChannel(TDisplayMode aDisplayMode) sl@0: { sl@0: if(aDisplayMode == EColor16MAP || aDisplayMode == EColor16MA) sl@0: return ETrue; sl@0: else sl@0: return EFalse; sl@0: } sl@0: sl@0: /** sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: inline TUint QuoteOrBracketPair(TUint code) sl@0: { sl@0: // given the opening/closing quote or bracket, return the corresponding closing/opening quote or bracket sl@0: switch(code) sl@0: { sl@0: case 0x0022: return 0x0022; // "..." sl@0: case 0x0027: return 0x0027; // '...' sl@0: case 0x0028: return 0x0029; // (...) sl@0: case 0x003c: return 0x003e; // <...> sl@0: case 0x005b: return 0x005d; // [...] sl@0: case 0x007b: return 0x007d; // {...} sl@0: case 0x2018: return 0x2019; // Single quotation marks sl@0: case 0x201b: return 0x2019; // Single high-reversed-9 quotation mark sl@0: case 0x201c: return 0x201d; // Double quotation marks sl@0: case 0x201f: return 0x201d; // Double high-reversed-9 quotation mark sl@0: case 0x2035: return 0x2032; // Single primes sl@0: case 0x2036: return 0x2033; // Double primes sl@0: case 0x2037: return 0x2034; // Triple primes sl@0: case 0x2039: return 0x203a; // Single left/right-pointing angle quotation marks sl@0: case 0x2045: return 0x2046; // Square brackets with quill sl@0: sl@0: case 0x0029: return 0x0028; // (...) sl@0: case 0x003e: return 0x003c; // <...> sl@0: case 0x005d: return 0x005b; // [...] sl@0: case 0x007d: return 0x007b; // {...} sl@0: case 0x2019: return 0x2018; // Single quotation marks sl@0: case 0x201d: return 0x201c; // Double quotation marks sl@0: case 0x2032: return 0x2035; // Single primes sl@0: case 0x2033: return 0x2036; // Double primes sl@0: case 0x2034: return 0x2037; // Triple primes sl@0: case 0x203a: return 0x2039; // Single left/right-pointing angle quotation marks sl@0: case 0x2046: return 0x2045; // Square brackets with quill sl@0: sl@0: default: return 0; sl@0: } sl@0: } sl@0: sl@0: /** sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: inline TBool IsIgnoredCharacterForLocalisedProcFunc(TChar aCode) sl@0: { sl@0: TChar::TBdCategory cat = aCode.GetBdCategory(); sl@0: sl@0: if ((cat == TChar::ELeftToRight || sl@0: cat == TChar::ERightToLeft || sl@0: cat == TChar::ERightToLeftArabic) && aCode != 0 && aCode != 0xFFFF) sl@0: return EFalse; sl@0: sl@0: return ETrue; sl@0: } sl@0: sl@0: sl@0: sl@0: sl@0: #endif /* GDIINLINE_INL */