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