44
|
1 |
/*
|
|
2 |
* Copyright (c) 2003 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 |
|
|
28 |
|
|
29 |
#ifndef __AKN_FEP_VIETNAMESE_TONE_MANAGER__
|
|
30 |
#define __AKN_FEP_VIETNAMESE_TONE_MANAGER__
|
|
31 |
|
|
32 |
#include <e32def.h>
|
|
33 |
#include <e32base.h>
|
|
34 |
|
|
35 |
#include "AknFepManager.h"
|
|
36 |
#include "AknFepVietnameseInputTables.h"
|
|
37 |
|
|
38 |
// CONSTANTS
|
|
39 |
|
|
40 |
// MACROS
|
|
41 |
|
|
42 |
// DATA TYPES
|
|
43 |
|
|
44 |
// FUNCTION PROTOTYPES
|
|
45 |
|
|
46 |
// FORWARD DECLARATIONS
|
|
47 |
|
|
48 |
// CLASS DECLARATION
|
|
49 |
|
|
50 |
/**
|
|
51 |
* CAknFepVietnameseToneManager class.
|
|
52 |
* This class is mounted based on CAknFepUIManagerWestern.
|
|
53 |
*
|
|
54 |
* @lib AknFep.lib
|
|
55 |
* @since 2.8
|
|
56 |
*/
|
|
57 |
class CAknFepVietnameseToneManager : public CBase
|
|
58 |
{
|
|
59 |
private:
|
|
60 |
/**
|
|
61 |
* Construct
|
|
62 |
*
|
|
63 |
* @param aFepManager fep manager
|
|
64 |
*
|
|
65 |
*/
|
|
66 |
void ConstructL();
|
|
67 |
|
|
68 |
/**
|
|
69 |
* private constructor
|
|
70 |
*/
|
|
71 |
CAknFepVietnameseToneManager();
|
|
72 |
|
|
73 |
public:
|
|
74 |
/**
|
|
75 |
* NewL first phase construction
|
|
76 |
*
|
|
77 |
* @param aFepManager fep manager
|
|
78 |
*
|
|
79 |
*/
|
|
80 |
static CAknFepVietnameseToneManager* NewL();
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Destructor
|
|
84 |
*/
|
|
85 |
virtual ~CAknFepVietnameseToneManager();
|
|
86 |
|
|
87 |
public:
|
|
88 |
/**
|
|
89 |
* Start the tone mark looping
|
|
90 |
*/
|
|
91 |
TBool StartToneMarkLooping();
|
|
92 |
|
|
93 |
/**
|
|
94 |
* first phase construction
|
|
95 |
*
|
|
96 |
* @param aParent parent window
|
|
97 |
* @param aPaneLayout the required layout
|
|
98 |
*
|
|
99 |
*/
|
|
100 |
TText GetVowelWithToneMark() const;
|
|
101 |
|
|
102 |
/**
|
|
103 |
* Increase the tone mark
|
|
104 |
*/
|
|
105 |
inline void IncrementToneMark();
|
|
106 |
|
|
107 |
/**
|
|
108 |
* stop tone marking looping, counterpart to StartToneMarkLooping
|
|
109 |
*/
|
|
110 |
void StopToneMarkLooping();
|
|
111 |
|
|
112 |
/**
|
|
113 |
* Set the fep manager pointer
|
|
114 |
*
|
|
115 |
* @param aFepManager Pointer to the fep manager
|
|
116 |
*
|
|
117 |
*/
|
|
118 |
inline void SetFepManager(MAknFepManagerUIInterface* aFepManager);
|
|
119 |
|
|
120 |
/**
|
|
121 |
* Judge if the current state is looping or not
|
|
122 |
*/
|
|
123 |
inline TBool IsLooping() const;
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Judge if the current state is looping or not
|
|
127 |
*/
|
|
128 |
inline void SetDeletedVowel(TText aDeletedVowel);
|
|
129 |
|
|
130 |
/**
|
|
131 |
* Judge if the current state is looping or not
|
|
132 |
*/
|
|
133 |
inline TText GetDeletedVowel() const;
|
|
134 |
|
|
135 |
/**
|
|
136 |
* Start key looping
|
|
137 |
*
|
|
138 |
* @param aKey current looping key
|
|
139 |
*
|
|
140 |
*/
|
|
141 |
void StartKeyLooping(TInt aKey);
|
|
142 |
|
|
143 |
/**
|
|
144 |
* stop key looping, counterpart to StartKeyLooping
|
|
145 |
*/
|
|
146 |
void StopKeyLooping();
|
|
147 |
|
|
148 |
/**
|
|
149 |
* Get current mark index in key looping
|
|
150 |
*
|
|
151 |
*/
|
|
152 |
TInt ToneMarkIndex() const;
|
|
153 |
|
|
154 |
/**
|
|
155 |
* Get tone mark vowel in current key looping
|
|
156 |
*
|
|
157 |
* @param aText return the tone mark vowel
|
|
158 |
*
|
|
159 |
*/
|
|
160 |
TBool GetLoopingToneMarkVowel( TText& aText ) const;
|
|
161 |
|
|
162 |
/**
|
|
163 |
* Judge if the current state is key looping or not
|
|
164 |
*
|
|
165 |
* @param aKey current looping key
|
|
166 |
*
|
|
167 |
*/
|
|
168 |
inline TBool IsKeyLooping(TInt aKey) const;
|
|
169 |
|
|
170 |
/**
|
|
171 |
* Judge if the current state is key looping or not
|
|
172 |
*/
|
|
173 |
inline TBool IsLoopingCombined() const;
|
|
174 |
|
|
175 |
/**
|
|
176 |
* Set whether tone mark is combined in previous looping
|
|
177 |
*
|
|
178 |
* @param aCombined tone mark is combined
|
|
179 |
*
|
|
180 |
*/
|
|
181 |
inline void SetLoopingCombined(TBool aCombined);
|
|
182 |
|
|
183 |
private: // Data
|
|
184 |
MAknFepManagerUIInterface* iFepMan; // not own
|
|
185 |
TInt iToneIndex; // Index of tone mark list
|
|
186 |
TInt iVowelIndex; // Index of vowel list
|
|
187 |
TBool iIsLooping; // Judge if input is in looping state
|
|
188 |
TText iPrevVowel; // Prev Vowel, used for undo the backdeletion
|
|
189 |
|
|
190 |
TBool iIsKeyLooping; // Judge if input is in loop state,
|
|
191 |
// iIsLooping is only used for star key
|
|
192 |
TInt iLoopingKey; // Current looping key
|
|
193 |
TBool iIsLoopingCombined; // Judge if tone mark is combined in previous looping
|
|
194 |
};
|
|
195 |
|
|
196 |
// Inline function implementation
|
|
197 |
inline TBool CAknFepVietnameseToneManager::IsLooping() const
|
|
198 |
{
|
|
199 |
return iIsLooping;
|
|
200 |
}
|
|
201 |
|
|
202 |
inline void CAknFepVietnameseToneManager::SetFepManager(MAknFepManagerUIInterface* aFepManager)
|
|
203 |
{
|
|
204 |
iFepMan = aFepManager;
|
|
205 |
}
|
|
206 |
|
|
207 |
inline void CAknFepVietnameseToneManager::IncrementToneMark()
|
|
208 |
{
|
|
209 |
if (iToneIndex+1 == KNumberOfToneMarks)
|
|
210 |
iToneIndex = 0;
|
|
211 |
else
|
|
212 |
++iToneIndex;
|
|
213 |
}
|
|
214 |
|
|
215 |
inline void CAknFepVietnameseToneManager::SetDeletedVowel(TText aDeletedVowel)
|
|
216 |
{
|
|
217 |
iPrevVowel = aDeletedVowel;
|
|
218 |
}
|
|
219 |
|
|
220 |
inline TText CAknFepVietnameseToneManager::GetDeletedVowel() const
|
|
221 |
{
|
|
222 |
return iPrevVowel;
|
|
223 |
}
|
|
224 |
|
|
225 |
inline TBool CAknFepVietnameseToneManager::IsKeyLooping(TInt aKey) const
|
|
226 |
{
|
|
227 |
return iIsKeyLooping && (iLoopingKey == aKey) ;
|
|
228 |
}
|
|
229 |
|
|
230 |
inline TBool CAknFepVietnameseToneManager::IsLoopingCombined() const
|
|
231 |
{
|
|
232 |
return iIsLoopingCombined ;
|
|
233 |
}
|
|
234 |
|
|
235 |
inline void CAknFepVietnameseToneManager::SetLoopingCombined(TBool aCombined)
|
|
236 |
{
|
|
237 |
iIsLoopingCombined = aCombined ;
|
|
238 |
}
|
|
239 |
|
|
240 |
#endif // __AKN_FEP_VIETNAMESE_TONE_MANAGER__
|
|
241 |
|
|
242 |
// End of file
|