|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0"" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 #include "AknFepVietnameseToneManager.h" |
|
28 #include "AknFepManager.h" |
|
29 |
|
30 |
|
31 CAknFepVietnameseToneManager::CAknFepVietnameseToneManager() |
|
32 { |
|
33 } |
|
34 |
|
35 CAknFepVietnameseToneManager::~CAknFepVietnameseToneManager() |
|
36 { |
|
37 } |
|
38 |
|
39 CAknFepVietnameseToneManager* CAknFepVietnameseToneManager::NewL() |
|
40 { |
|
41 CAknFepVietnameseToneManager* self = new (ELeave) CAknFepVietnameseToneManager; |
|
42 CleanupStack::PushL(self); |
|
43 self->ConstructL(); |
|
44 CleanupStack::Pop(); |
|
45 return self; |
|
46 } |
|
47 |
|
48 void CAknFepVietnameseToneManager::ConstructL() |
|
49 { |
|
50 } |
|
51 |
|
52 void CAknFepVietnameseToneManager::StopToneMarkLooping() |
|
53 { |
|
54 iToneIndex = 0; |
|
55 iVowelIndex = 0; |
|
56 iIsLooping = EFalse; |
|
57 } |
|
58 |
|
59 TBool CAknFepVietnameseToneManager::StartToneMarkLooping() |
|
60 { |
|
61 __ASSERT_DEBUG(iFepMan != NULL, |
|
62 RDebug::Print( |
|
63 _L("In CAknFepVietnameseToneManager::StartLooping,\nINVALID PARAM: Empty Fep Manager!"))); |
|
64 |
|
65 StopToneMarkLooping(); |
|
66 |
|
67 const TText prevChr = iFepMan->PreviousChar(); |
|
68 |
|
69 // Judge if the prevChr is a vowel or not |
|
70 for (TUint i = 0; i < sizeof(VietVowelList) / sizeof(TText); ++i) |
|
71 { |
|
72 if (prevChr == VietVowelList[i]) |
|
73 { |
|
74 iIsLooping = ETrue; |
|
75 iVowelIndex = i; |
|
76 break; |
|
77 } |
|
78 } |
|
79 |
|
80 return iIsLooping; |
|
81 } |
|
82 |
|
83 TText CAknFepVietnameseToneManager::GetVowelWithToneMark() const |
|
84 { |
|
85 // First vowel row lists those tone marks themselves |
|
86 return VietToneMatrix[iVowelIndex+1][iToneIndex]; |
|
87 } |