|
1 /* |
|
2 * Copyright (c) 2004 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 * Provides the CAknFepUICtrlPinyinPopup methods. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 #include <gdi.h> |
|
31 #include <eiklabel.h> |
|
32 #include <AknsDrawUtils.h> |
|
33 #include <AknsUtils.h> |
|
34 #include <AknIconUtils.h> |
|
35 |
|
36 #include <AknsFrameBackgroundControlContext.h> |
|
37 #include <aknfepuictrls.mbg> |
|
38 |
|
39 #include "AknFepUiInterfacePanic.h" |
|
40 #include "AknFepUIAvkonCtrlPinyinPopup.h" |
|
41 #include "AknFepUIAvkonCtrlInputPane.h" |
|
42 #include "aknfepchineseuidataconv.h" |
|
43 #include "aknfepuilayoutdatamgr.h" |
|
44 #include <skinlayout.cdl.h> |
|
45 |
|
46 #include "data_caging_path_literals.hrh" |
|
47 |
|
48 _LIT(KFepUiControlsBitmapFile, "aknfepuictrls.mbm"); |
|
49 |
|
50 CAknFepUICtrlPinyinPopup* CAknFepUICtrlPinyinPopup::NewL(RWindow& aParent, CAknFepUiLayoutDataMgr* aLafDataMgr ) |
|
51 { |
|
52 CAknFepUICtrlPinyinPopup* self = new(ELeave) CAknFepUICtrlPinyinPopup( aLafDataMgr ); |
|
53 CleanupStack::PushL(self); |
|
54 self->ConstructL(aParent); |
|
55 CleanupStack::Pop(); |
|
56 return self; |
|
57 } |
|
58 |
|
59 CAknFepUICtrlPinyinPopup::~CAknFepUICtrlPinyinPopup() |
|
60 { |
|
61 iInputPaneArray.ResetAndDestroy(); |
|
62 iPages.Reset(); |
|
63 delete iSpellingArray; |
|
64 delete iSpellingIndexArray; |
|
65 delete iNaviArrowBitmapLeft; |
|
66 delete iNaviArrowBitmapLeftMask; |
|
67 delete iNaviArrowBitmapRight; |
|
68 delete iNaviArrowBitmapRightMask; |
|
69 delete iBgContext; |
|
70 delete iKeystrokeArray; |
|
71 delete iInEffectKeystrokeArray; |
|
72 delete iShowKeystrokeArray; |
|
73 delete iOptimizeSpelling; |
|
74 delete iTempSpelling; |
|
75 delete iChooseChineseCharacterArray; |
|
76 delete iChooseChineseCharacterArraySpelling; |
|
77 delete iChooseChineseCharacterArrayKeystroke; |
|
78 |
|
79 delete iKeystrokeArrayForStroke; |
|
80 delete iInEffectKeystrokeArrayForStroke; |
|
81 delete iShowKeystrokeArrayForStroke; |
|
82 delete iChooseChineseCharacterArrayForStroke; |
|
83 delete iChooseChineseCharacterArrayKeystrokeForStroke; |
|
84 |
|
85 delete iZhuyinSymbols; |
|
86 delete iZhuyinShowSymbols; |
|
87 delete iFirstValidZhuyinGrp; |
|
88 delete iChineseCharsDisped; |
|
89 delete iZhuyinSymbolsForChineseCharsDisped; |
|
90 } |
|
91 |
|
92 void CAknFepUICtrlPinyinPopup::SetSizeChangedObserver( |
|
93 MAknFepUICtrlPinyinPopupSizeChangedObserver* aObserver) |
|
94 { |
|
95 iSizeChangedObserver = aObserver; |
|
96 } |
|
97 |
|
98 TBool CAknFepUICtrlPinyinPopup::IsEnabled() const |
|
99 { |
|
100 return iEnabled; |
|
101 } |
|
102 |
|
103 void CAknFepUICtrlPinyinPopup::Enable(TBool aEnable) |
|
104 { |
|
105 // fix the refresh bug. |
|
106 TBool redraw = ( aEnable || iEnabled != aEnable ); |
|
107 |
|
108 iEnabled = aEnable; |
|
109 if(aEnable) |
|
110 { |
|
111 Window().SetOrdinalPosition(0, ECoeWinPriorityFep); // right at the front |
|
112 } |
|
113 |
|
114 iSizeChangedObserver->SelectionPopupEnabled(aEnable); |
|
115 if (!aEnable) |
|
116 { |
|
117 for(TInt i = 0; i < iVisibleCount; i++) |
|
118 { |
|
119 CAknFepUICtrlInputPane* inputPane = iInputPaneArray[i]; |
|
120 inputPane->SetText(KNullDesC); |
|
121 } |
|
122 iVisibleCount = 0; |
|
123 } |
|
124 MakeVisible(aEnable); |
|
125 |
|
126 // fix the refresh bug. |
|
127 if( redraw ) |
|
128 { |
|
129 DrawDeferred(); |
|
130 } |
|
131 } |
|
132 |
|
133 void CAknFepUICtrlPinyinPopup::SetVisibleSelectionCount(TInt aCount) |
|
134 { |
|
135 __ASSERT_DEBUG(aCount <= EMaxPhraseCandidate, AknFepUiInterfacePanic(EAknFepUiInterfacePanicNewVisibleCountExceedsRange)); |
|
136 __ASSERT_DEBUG(aCount >= 1, AknFepUiInterfacePanic(EAknFepUiInterfacePanicNewVisibleCountExceedsRange)); |
|
137 |
|
138 if(iVisibleCount != aCount) |
|
139 { |
|
140 iVisibleCount = aCount; |
|
141 TInt oldSelected = iSelected; |
|
142 |
|
143 if (iVisibleCount > 1) //the layout does not support a visible count of 1 |
|
144 { |
|
145 if(aCount - 1 < oldSelected) |
|
146 { |
|
147 // automatically move the selection to be at the end of the new |
|
148 // candidate buffer, by forcing the one that will become the new |
|
149 // highlighted one to be layout out highlighted before we are resized |
|
150 // (note that briefly, there will be two items highlighted, but at least |
|
151 // there will be no flicker) |
|
152 iSelected = aCount - 1; |
|
153 LayoutInputPane(aCount - 1); |
|
154 } |
|
155 |
|
156 // note that the old highlighted one isn't shown any more, so we don't need to lay it out again to hide its highlight |
|
157 SetInputPaneVisibility(); |
|
158 iSizeChangedObserver->SelectionPopupSizeChanged(iVisibleCount); |
|
159 DrawDeferred(); |
|
160 } |
|
161 } |
|
162 } |
|
163 |
|
164 void CAknFepUICtrlPinyinPopup::SetVisibleCount(TInt aCount) |
|
165 { |
|
166 if(iVisibleCount != aCount) |
|
167 { |
|
168 iVisibleCount = aCount; |
|
169 } |
|
170 } |
|
171 |
|
172 TInt CAknFepUICtrlPinyinPopup::VisibleSelectionCount() const |
|
173 { |
|
174 return iVisibleCount; |
|
175 } |
|
176 |
|
177 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::PhoneticSpellingArray(void) |
|
178 { |
|
179 return iSpellingArray; |
|
180 } |
|
181 |
|
182 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::PhoneticSpellingIndexArray(void) |
|
183 { |
|
184 return iSpellingIndexArray; |
|
185 } |
|
186 |
|
187 void CAknFepUICtrlPinyinPopup::SplitPhraseSpellingIntoPages(void) |
|
188 { |
|
189 iPages.Reset(); |
|
190 TPage curPage; |
|
191 TInt spellingNum = iSpellingArray->Count(); |
|
192 if(spellingNum == 0) |
|
193 { |
|
194 iVisibleCount = 0; |
|
195 return; |
|
196 } |
|
197 |
|
198 TInt index = 0; |
|
199 TBool beAppend = EFalse; |
|
200 |
|
201 while(index < spellingNum) |
|
202 { |
|
203 beAppend = EFalse; |
|
204 curPage.iStartIndex = index; |
|
205 curPage.iEndIndex = index; |
|
206 |
|
207 TInt spellingLeftNum = spellingNum - index > EMaxPhraseCandidate? EMaxPhraseCandidate:spellingNum - index; |
|
208 for(TInt j = 0; j < spellingLeftNum; j ++) |
|
209 { |
|
210 iInputPaneArray[j]->SetText((*iSpellingArray)[index + j]); |
|
211 } |
|
212 |
|
213 TAknWindowLineLayout layoutEntryItem = |
|
214 CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData(ELayoutEntryItem)); |
|
215 TAknTextLineLayout entryTextLine = |
|
216 CAknFepChineseUIDataConv::AnyToTextLine( iLafDataMgr->RequestData(EEntryTextLayout)); |
|
217 TInt layoutLinePrevLeft = 0; |
|
218 TInt layoutLinePrevWidth = 0; |
|
219 |
|
220 TAknLayoutRect layoutRectEntryItem; |
|
221 layoutRectEntryItem.LayoutRect(Rect(),layoutEntryItem); |
|
222 TRect rectEntryItem = layoutRectEntryItem.Rect(); |
|
223 |
|
224 TAknLayoutText layoutText; |
|
225 layoutText.LayoutText(rectEntryItem,entryTextLine); |
|
226 TRect rectText = layoutText.TextRect(); |
|
227 |
|
228 TInt rightLimit = iIndiFepArrowRight.Rect().iTl.iX; |
|
229 // value is 3 for 176*208 resolution |
|
230 TInt distance = rectText.iTl.iX - rectEntryItem.iTl.iX + rectEntryItem.iBr.iX - rectText.iBr.iX; |
|
231 |
|
232 for(TInt i = 0;i < spellingLeftNum;i ++) |
|
233 { |
|
234 if(i > 0) |
|
235 { |
|
236 rectText.iTl.iX = TInt16(layoutLinePrevLeft + layoutLinePrevWidth); |
|
237 } |
|
238 rectText.SetWidth(iInputPaneArray[i]->LabelTextWidthInPixels() + distance); |
|
239 |
|
240 // if label's layout out of screen, forms another display page |
|
241 // > change >= change for phrase creation. |
|
242 if((rectText.iTl.iX >= rightLimit) || ((rectText.iTl.iX + rectText.Width()) >= rightLimit)) |
|
243 { |
|
244 curPage.iEndIndex = index - 1; |
|
245 iPages.Append(curPage); |
|
246 beAppend = ETrue; |
|
247 break; |
|
248 } |
|
249 |
|
250 layoutLinePrevLeft = rectText.iTl.iX; |
|
251 layoutLinePrevWidth = rectText.Width(); |
|
252 |
|
253 index ++; |
|
254 |
|
255 if( i == EMaxPhraseCandidate -1 ) |
|
256 { |
|
257 curPage.iEndIndex = index - 1; |
|
258 iPages.Append(curPage); |
|
259 beAppend = ETrue; |
|
260 break; |
|
261 } |
|
262 |
|
263 } |
|
264 } |
|
265 |
|
266 if( beAppend == EFalse) |
|
267 { |
|
268 curPage.iEndIndex = index - 1; |
|
269 iPages.Append(curPage); |
|
270 } |
|
271 iCurDisplayPage = 0; |
|
272 SetVisibleSelectionCount(iPages[0].iEndIndex - iPages[0].iStartIndex + 1); |
|
273 } |
|
274 |
|
275 void CAknFepUICtrlPinyinPopup::SplitSpellingIntoPages(TInt aCount) |
|
276 { |
|
277 iPages.Reset(); |
|
278 TPage curPage; |
|
279 if(aCount == 0) |
|
280 { |
|
281 return; |
|
282 } |
|
283 TInt index = 0; |
|
284 TBool beAppend = EFalse; |
|
285 |
|
286 while(index < aCount) |
|
287 { |
|
288 beAppend = EFalse; |
|
289 curPage.iStartIndex = index; |
|
290 curPage.iEndIndex = index; |
|
291 TInt spellingLeftNum = aCount - index > EMaxCandidates? EMaxCandidates:aCount - index; |
|
292 |
|
293 TAknWindowLineLayout layoutEntryItem = |
|
294 CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData(ELayoutEntryItem)); |
|
295 TAknTextLineLayout entryTextLine = |
|
296 CAknFepChineseUIDataConv::AnyToTextLine( iLafDataMgr->RequestData(EEntryTextLayout)); |
|
297 TInt layoutLinePrevLeft = 0; |
|
298 TInt layoutLinePrevWidth = 0; |
|
299 |
|
300 TAknLayoutRect layoutRectEntryItem; |
|
301 layoutRectEntryItem.LayoutRect(Rect(),layoutEntryItem); |
|
302 TRect rectEntryItem = layoutRectEntryItem.Rect(); |
|
303 |
|
304 TAknLayoutText layoutText; |
|
305 layoutText.LayoutText(rectEntryItem,entryTextLine); |
|
306 TRect rectText = layoutText.TextRect(); |
|
307 |
|
308 TInt rightLimit = rectEntryItem.iTl.iX + rectEntryItem.Width(); |
|
309 // value is 3 for 176*208 resolution |
|
310 TInt distance = rectText.iTl.iX - rectEntryItem.iTl.iX + rectEntryItem.iBr.iX - rectText.iBr.iX; |
|
311 for(TInt i = 0;i < spellingLeftNum;i ++) |
|
312 { |
|
313 if(i > 0) |
|
314 { |
|
315 rectText.iTl.iX = TInt16(layoutLinePrevLeft + layoutLinePrevWidth); |
|
316 } |
|
317 rectText.SetWidth(iInputPaneArray[i]->LabelTextWidthInPixels() + distance); |
|
318 |
|
319 // if label's layout out of screen, forms another display page |
|
320 if((rectText.iTl.iX >= rightLimit) || ((rectText.iTl.iX + rectText.Width()) >= rightLimit)) |
|
321 { |
|
322 curPage.iEndIndex = index - 1; |
|
323 iPages.Append(curPage); |
|
324 beAppend = ETrue; |
|
325 break; |
|
326 } |
|
327 layoutLinePrevLeft = rectText.iTl.iX; |
|
328 layoutLinePrevWidth = rectText.Width(); |
|
329 index ++; |
|
330 |
|
331 if( i == EMaxPhraseCandidate -1 ) |
|
332 { |
|
333 curPage.iEndIndex = index - 1; |
|
334 iPages.Append(curPage); |
|
335 beAppend = ETrue; |
|
336 break; |
|
337 } |
|
338 |
|
339 } |
|
340 } |
|
341 |
|
342 if(beAppend == EFalse) |
|
343 { |
|
344 curPage.iEndIndex = index - 1; |
|
345 iPages.Append(curPage); |
|
346 } |
|
347 |
|
348 iCurDisplayPage = 0; |
|
349 SetVisibleSelectionCount(iPages[0].iEndIndex - iPages[0].iStartIndex + 1); |
|
350 SelectIndex(0); |
|
351 } |
|
352 |
|
353 void CAknFepUICtrlPinyinPopup::SetDisplayPage(TInt aSelection) |
|
354 { |
|
355 if(aSelection >= iVisibleCount) |
|
356 { |
|
357 for(TInt i = 0 ; i < iPages.Count(); i ++) |
|
358 { |
|
359 if((aSelection >= iPages[i].iStartIndex) && (aSelection <= iPages[i].iEndIndex)) |
|
360 { |
|
361 iCurDisplayPage = i; |
|
362 SetVisibleSelectionCount(iPages[i].iEndIndex - iPages[i].iStartIndex + 1); |
|
363 SelectIndex(aSelection - iPages[i].iStartIndex); |
|
364 break; |
|
365 } |
|
366 } |
|
367 } |
|
368 else |
|
369 { |
|
370 SelectIndex(aSelection); |
|
371 } |
|
372 UpdateInputPaneVisibility(); |
|
373 } |
|
374 |
|
375 TInt CAknFepUICtrlPinyinPopup::CurrentPageStartIndex(void) |
|
376 { |
|
377 return iPages[iCurDisplayPage].iStartIndex; |
|
378 } |
|
379 |
|
380 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::KeystrokeArray() |
|
381 { |
|
382 return iKeystrokeArray; |
|
383 } |
|
384 |
|
385 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::InEffectKeystrokeArray() |
|
386 { |
|
387 return iInEffectKeystrokeArray; |
|
388 } |
|
389 |
|
390 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::ShowKeystrokeArray() |
|
391 { |
|
392 return iShowKeystrokeArray; |
|
393 } |
|
394 |
|
395 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::OptimizeSpelling() |
|
396 { |
|
397 return iOptimizeSpelling; |
|
398 } |
|
399 |
|
400 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::TempSpelling() |
|
401 { |
|
402 return iTempSpelling; |
|
403 } |
|
404 |
|
405 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::ChooseChineseCharacterArray() |
|
406 { |
|
407 return iChooseChineseCharacterArray; |
|
408 } |
|
409 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::ChooseChineseCharacterArraySpelling() |
|
410 { |
|
411 return iChooseChineseCharacterArraySpelling; |
|
412 } |
|
413 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::ChooseChineseCharacterArrayKeystroke() |
|
414 { |
|
415 return iChooseChineseCharacterArrayKeystroke; |
|
416 } |
|
417 |
|
418 TBool CAknFepUICtrlPinyinPopup::GetTonemarkState() |
|
419 { |
|
420 return iTonemarkState; |
|
421 } |
|
422 |
|
423 void CAknFepUICtrlPinyinPopup::SetTonemarkState( TBool aState ) |
|
424 { |
|
425 iTonemarkState = aState; |
|
426 } |
|
427 |
|
428 void CAknFepUICtrlPinyinPopup::UpdateInputPaneVisibility() |
|
429 { |
|
430 TInt number = 0; |
|
431 if(iPages.Count() != 0) |
|
432 { |
|
433 number = iPages[iCurDisplayPage].iEndIndex - iPages[iCurDisplayPage].iStartIndex + 1; |
|
434 } |
|
435 if(number > iVisibleCount) |
|
436 { |
|
437 number = iVisibleCount; |
|
438 } |
|
439 for(TInt i = 0; i < EMaxPhraseCandidate; i++) |
|
440 { |
|
441 CAknFepUICtrlInputPane* inputPane = iInputPaneArray[i]; |
|
442 |
|
443 if(i < number) |
|
444 { |
|
445 inputPane->MakeVisible(ETrue); |
|
446 } |
|
447 else |
|
448 { |
|
449 inputPane->MakeVisible(EFalse); |
|
450 } |
|
451 } |
|
452 } |
|
453 |
|
454 TBool CAknFepUICtrlPinyinPopup::SetItemText(TInt aIndex, const TDesC& aText) |
|
455 { |
|
456 __ASSERT_DEBUG(aIndex < EMaxPhraseCandidate, AknFepUiInterfacePanic(EAknFepUiInterfacePanicAttemptedSetItemTextOutsideMaxCandidates)); |
|
457 __ASSERT_DEBUG(aIndex >= 0, AknFepUiInterfacePanic(EAknFepUiInterfacePanicAttemptedSetItemTextOutsideMaxCandidates)); |
|
458 |
|
459 if(aIndex > iVisibleCount) |
|
460 { |
|
461 return EFalse; |
|
462 } |
|
463 |
|
464 CAknFepUICtrlInputPane* inputPane = iInputPaneArray[aIndex]; |
|
465 inputPane->SetText(aText); |
|
466 return ETrue; |
|
467 } |
|
468 |
|
469 TBool CAknFepUICtrlPinyinPopup::SetPhraseItemTexts() |
|
470 { |
|
471 for(TInt i = 0; i < iVisibleCount; i ++) |
|
472 { |
|
473 TPtrC spelling = (*iSpellingArray)[i + iPages[iCurDisplayPage].iStartIndex]; // our index is zero based, engine index is one based |
|
474 SetItemText(i, spelling); |
|
475 } |
|
476 return ETrue; |
|
477 } |
|
478 |
|
479 TBool CAknFepUICtrlPinyinPopup::GetItemText(TInt aIndex, TDes& aText) const |
|
480 { |
|
481 __ASSERT_DEBUG(aIndex < EMaxCandidates, AknFepUiInterfacePanic(EAknFepUiInterfacePanicAttemptedSetItemTextOutsideMaxCandidates)); |
|
482 __ASSERT_DEBUG(aIndex >= 0, AknFepUiInterfacePanic(EAknFepUiInterfacePanicAttemptedSetItemTextOutsideMaxCandidates)); |
|
483 |
|
484 const CAknFepUICtrlInputPane* inputPane = iInputPaneArray[aIndex]; |
|
485 inputPane->GetText(aText); |
|
486 |
|
487 return ETrue; |
|
488 } |
|
489 |
|
490 void CAknFepUICtrlPinyinPopup::SetToneMark(const TDesC& aToneMark) |
|
491 { |
|
492 for(TInt i = 0; i < EMaxPhraseCandidate; i++) |
|
493 { |
|
494 CAknFepUICtrlInputPane* inputPane = iInputPaneArray[i]; |
|
495 inputPane->SetToneMark(aToneMark); |
|
496 } |
|
497 } |
|
498 |
|
499 void CAknFepUICtrlPinyinPopup::SetToneMark(TInt aIndex, const TDesC& aToneMark) |
|
500 { |
|
501 CAknFepUICtrlInputPane* inputPane = iInputPaneArray[aIndex]; |
|
502 inputPane->SetToneMark(aToneMark); |
|
503 |
|
504 LayoutInputPane(aIndex); |
|
505 } |
|
506 |
|
507 void CAknFepUICtrlPinyinPopup::GetToneMark(TInt aIndex, TDes& aToneMark) const |
|
508 { |
|
509 const CAknFepUICtrlInputPane* inputPane = iInputPaneArray[aIndex]; |
|
510 inputPane->GetToneMark(aToneMark); |
|
511 } |
|
512 |
|
513 void CAknFepUICtrlPinyinPopup::SetItemToneMarkValidity(TInt aIndex, TBool aValid) |
|
514 { |
|
515 CAknFepUICtrlInputPane* inputPane = iInputPaneArray[aIndex]; |
|
516 inputPane->SetToneMarkValidity(aValid); |
|
517 } |
|
518 |
|
519 |
|
520 |
|
521 TBool CAknFepUICtrlPinyinPopup::SelectNextPhrase() |
|
522 { |
|
523 TInt maxIndex = iVisibleCount - 1; |
|
524 TInt newIndex = iSelected; |
|
525 |
|
526 if((iSelected == maxIndex) ) |
|
527 { |
|
528 // is last page |
|
529 if(iCurDisplayPage == (iPages.Count() - 1)) |
|
530 { |
|
531 iCurDisplayPage = 0; |
|
532 } |
|
533 else |
|
534 { |
|
535 iCurDisplayPage ++; |
|
536 } |
|
537 SetVisibleSelectionCount(iPages[iCurDisplayPage].iEndIndex - iPages[iCurDisplayPage].iStartIndex + 1); |
|
538 SetFlag(EDispPageChanged); |
|
539 newIndex = 0; |
|
540 } |
|
541 else if(iSelected < maxIndex) |
|
542 { |
|
543 newIndex ++; |
|
544 } |
|
545 else if(iSelected > maxIndex) |
|
546 { |
|
547 return EFalse; |
|
548 } |
|
549 return SelectIndex(newIndex); |
|
550 } |
|
551 |
|
552 |
|
553 TBool CAknFepUICtrlPinyinPopup::SelectPrevPhrase() |
|
554 { |
|
555 TInt maxIndex = iVisibleCount - 1; |
|
556 TInt newIndex = iSelected; |
|
557 if(iSelected == 0) |
|
558 { |
|
559 // first page |
|
560 if(iCurDisplayPage == 0) |
|
561 { |
|
562 iCurDisplayPage = iPages.Count() - 1; |
|
563 } |
|
564 else |
|
565 { |
|
566 iCurDisplayPage --; |
|
567 } |
|
568 // loop to the end |
|
569 SetVisibleSelectionCount(iPages[iCurDisplayPage].iEndIndex - iPages[iCurDisplayPage].iStartIndex + 1); |
|
570 SetFlag(EDispPageChanged); |
|
571 newIndex = iVisibleCount - 1 ; |
|
572 } |
|
573 else if(iSelected > 0) |
|
574 { |
|
575 newIndex--; |
|
576 } |
|
577 else if(iSelected > maxIndex) |
|
578 { |
|
579 return EFalse; |
|
580 } |
|
581 return SelectIndex(newIndex); |
|
582 } |
|
583 |
|
584 TBool CAknFepUICtrlPinyinPopup::SelectIndex(TInt aIndex) |
|
585 { |
|
586 __ASSERT_DEBUG(aIndex < iVisibleCount, AknFepUiInterfacePanic(EAknFepUiInterfacePanicAttemptedSelectionOutsideVisibleCandidates)); |
|
587 __ASSERT_DEBUG(aIndex >= 0, AknFepUiInterfacePanic(EAknFepUiInterfacePanicAttemptedSelectionOutsideVisibleCandidates)); |
|
588 // If the value of the index changes, the control is redrawn to show the new position. |
|
589 if(iSelected != aIndex) |
|
590 { |
|
591 // only want to layout the two controls between which the selection is moving |
|
592 TInt oldSelected = iSelected; |
|
593 iSelected = aIndex; |
|
594 |
|
595 LayoutInputPane(oldSelected); |
|
596 LayoutInputPane(iSelected); |
|
597 } |
|
598 return ETrue; |
|
599 } |
|
600 |
|
601 TInt CAknFepUICtrlPinyinPopup::CurrentSelection() const |
|
602 { |
|
603 if(iPages.Count() != 0) |
|
604 { |
|
605 return iPages[iCurDisplayPage].iStartIndex + iSelected; |
|
606 } |
|
607 else |
|
608 { |
|
609 return 0; |
|
610 } |
|
611 } |
|
612 |
|
613 TInt CAknFepUICtrlPinyinPopup::CurrentVisibleSelection() const |
|
614 { |
|
615 return iSelected; |
|
616 } |
|
617 |
|
618 void CAknFepUICtrlPinyinPopup::PopupSizeChanged() |
|
619 { |
|
620 SizeChanged(); |
|
621 } |
|
622 |
|
623 void CAknFepUICtrlPinyinPopup::SizeChanged() |
|
624 { |
|
625 LayoutRects(); |
|
626 LayoutContainedControls(); |
|
627 LayoutFrames(); |
|
628 } |
|
629 |
|
630 TInt CAknFepUICtrlPinyinPopup::CountComponentControls() const |
|
631 { |
|
632 TInt count = 0; |
|
633 count += iInputPaneArray.Count(); |
|
634 |
|
635 CCoeControl* controls[] = |
|
636 { |
|
637 0 |
|
638 } ; |
|
639 |
|
640 for (TUint ii = 0 ; ii < (sizeof(controls) / sizeof(CCoeControl*)) ; ii++) |
|
641 { |
|
642 if(controls[ii]) |
|
643 { |
|
644 count++ ; |
|
645 } |
|
646 } |
|
647 return count ; |
|
648 } |
|
649 |
|
650 CCoeControl* CAknFepUICtrlPinyinPopup::ComponentControl(TInt aIndex) const |
|
651 { |
|
652 TInt candidateCount = iInputPaneArray.Count(); |
|
653 |
|
654 if(aIndex < candidateCount) |
|
655 { |
|
656 // because this method is const, the const [] operator is selected |
|
657 // which means that the pointer is const, so have to cast away constness |
|
658 // - a possible alternative is to make the array mutable |
|
659 return CONST_CAST(CAknFepUICtrlInputPane*, iInputPaneArray[aIndex]); |
|
660 } |
|
661 aIndex -= candidateCount; |
|
662 |
|
663 CCoeControl* controls[] = |
|
664 { |
|
665 0 |
|
666 } ; |
|
667 |
|
668 for (TUint ii = 0; (ii < sizeof(controls) / sizeof(CCoeControl*)) ; ii++) |
|
669 { |
|
670 if (controls[ii] && aIndex-- == 0) |
|
671 { |
|
672 return controls[ii] ; |
|
673 } |
|
674 } |
|
675 // shouldn't be called while no components. |
|
676 return NULL ; |
|
677 } |
|
678 |
|
679 void CAknFepUICtrlPinyinPopup::Draw(const TRect& /*aRect*/) const |
|
680 { |
|
681 CWindowGc& gc = SystemGc(); |
|
682 TBool skinnedDraw = EFalse; |
|
683 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
684 |
|
685 TRect outerRect; |
|
686 TRect innerRect; |
|
687 CalculateFrameRects(outerRect, innerRect); |
|
688 |
|
689 gc.Clear(outerRect); |
|
690 TRect tmpRect; |
|
691 tmpRect.iTl.iX = innerRect.iTl.iX; |
|
692 tmpRect.iTl.iY = outerRect.iTl.iY; |
|
693 tmpRect.SetWidth(innerRect.Width()); |
|
694 tmpRect.SetHeight(outerRect.Height()); |
|
695 skinnedDraw = AknsDrawUtils::DrawFrame(skin, gc, outerRect, tmpRect, |
|
696 KAknsIIDQsnFrPopupSub, KAknsIIDQsnFrPopupCenterSubmenu); |
|
697 |
|
698 // draw the rectangles |
|
699 if(!skinnedDraw) |
|
700 { |
|
701 iRectCoverMainPaneInput.DrawRect(gc); |
|
702 iRectFirstShadowInput.DrawRect(gc); |
|
703 iRectOutlineFrameInput.DrawRect(gc); |
|
704 iRectInsideAreaInput.DrawRect(gc); |
|
705 } |
|
706 |
|
707 if((iVisibleCount >= 1) && (iPages.Count() > 1)) |
|
708 { |
|
709 if(iCurDisplayPage != 0) |
|
710 { |
|
711 iIndiFepArrowLeft.DrawImage(gc, iNaviArrowBitmapLeft, iNaviArrowBitmapLeftMask); |
|
712 } |
|
713 |
|
714 if (iPages.Count() > iCurDisplayPage + 1) |
|
715 { |
|
716 iIndiFepArrowRight.DrawImage(gc, iNaviArrowBitmapRight, iNaviArrowBitmapRightMask); |
|
717 } |
|
718 } |
|
719 } |
|
720 |
|
721 TTypeUid::Ptr CAknFepUICtrlPinyinPopup::MopSupplyObject(TTypeUid aId) |
|
722 { |
|
723 if (aId.iUid == MAknsControlContext::ETypeId) |
|
724 return ( MAknsControlContext::SupplyMopObject(aId, iBgContext)); |
|
725 return CCoeControl::MopSupplyObject(aId); |
|
726 } |
|
727 |
|
728 void CAknFepUICtrlPinyinPopup::ConstructL(RWindow& /*aParent*/) |
|
729 { |
|
730 CreateWindowL(); |
|
731 ConstructBitmapsL(); |
|
732 RWindow& window = Window(); |
|
733 |
|
734 for(TInt i = 0; i < EMaxPhraseCandidate; i++) |
|
735 { |
|
736 CAknFepUICtrlInputPane* inputPane = |
|
737 CAknFepUICtrlInputPane::NewL(window, CAknFepUICtrlInputPane::ELayoutPhrasePinyinPopupPane, iLafDataMgr); |
|
738 inputPane->SetMopParent(this); |
|
739 CleanupStack::PushL(inputPane); |
|
740 // ownership is passed, unless allocation is unsuccessful, in which case we still have it on the stack |
|
741 User::LeaveIfError(iInputPaneArray.Append(inputPane)); |
|
742 CleanupStack::Pop(); // inputPane |
|
743 } |
|
744 |
|
745 iSpellingArray = new(ELeave)CDesCArrayFlat(1); |
|
746 iSpellingIndexArray = new(ELeave)CDesCArrayFlat(1); |
|
747 iKeystrokeArray = new(ELeave)CDesCArrayFlat(1); |
|
748 iShowKeystrokeArray = new(ELeave)CDesCArrayFlat(1); |
|
749 iOptimizeSpelling = new(ELeave)CDesCArrayFlat(1); |
|
750 iTempSpelling = new(ELeave)CDesCArrayFlat(1); |
|
751 iInEffectKeystrokeArray = new(ELeave)CDesCArrayFlat(1); |
|
752 iChooseChineseCharacterArray = new(ELeave)CDesCArrayFlat(1); |
|
753 iChooseChineseCharacterArrayKeystroke = new(ELeave)CDesCArrayFlat(1); |
|
754 iChooseChineseCharacterArraySpelling = new(ELeave)CDesCArrayFlat(1); |
|
755 //For stroke |
|
756 iKeystrokeArrayForStroke = new(ELeave)CDesCArrayFlat(1); |
|
757 iInEffectKeystrokeArrayForStroke = new(ELeave)CDesCArrayFlat(1); |
|
758 iShowKeystrokeArrayForStroke = new(ELeave)CDesCArrayFlat(1); |
|
759 iChooseChineseCharacterArrayForStroke = new(ELeave)CDesCArrayFlat(1); |
|
760 iChooseChineseCharacterArrayKeystrokeForStroke = new(ELeave)CDesCArrayFlat(1); |
|
761 |
|
762 iZhuyinSymbols = new(ELeave)CDesCArrayFlat(1); |
|
763 iZhuyinShowSymbols = new(ELeave)CDesCArrayFlat(1); |
|
764 iFirstValidZhuyinGrp = new(ELeave)CDesCArrayFlat(1); |
|
765 iChineseCharsDisped = new(ELeave)CDesCArrayFlat(1); |
|
766 iZhuyinSymbolsForChineseCharsDisped = new(ELeave)CDesCArrayFlat(1); |
|
767 |
|
768 SetNonFocusing(); |
|
769 window.SetOrdinalPosition(0, ECoeWinPriorityFep); // right at the front |
|
770 window.SetNonFading(ETrue); |
|
771 |
|
772 TRect outerRect = TRect(); |
|
773 TRect innerRect = TRect(); |
|
774 CalculateFrameRects(outerRect, innerRect); |
|
775 |
|
776 iBgContext = CAknsFrameBackgroundControlContext::NewL(KAknsIIDQsnFrPopupSub, outerRect, innerRect, ETrue); |
|
777 iLastResouce = 0; |
|
778 MakeVisible(EFalse); |
|
779 } |
|
780 |
|
781 void CAknFepUICtrlPinyinPopup::ConstructBitmapsL() |
|
782 { |
|
783 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
784 |
|
785 TFileName bmpFile; |
|
786 bmpFile.Copy(_L("z:")); |
|
787 bmpFile.Append(KDC_BITMAP_DIR); |
|
788 bmpFile.Append(KFepUiControlsBitmapFile); |
|
789 |
|
790 AknsUtils::CreateColorIconL( skin, |
|
791 KAknsIIDQgnIndiFepArrowLeft, |
|
792 KAknsIIDQsnIconColors, |
|
793 EAknsCIQsnIconColorsCG20, |
|
794 iNaviArrowBitmapLeft, |
|
795 iNaviArrowBitmapLeftMask, |
|
796 bmpFile, |
|
797 EMbmAknfepuictrlsQgn_indi_fep_arrow_left, |
|
798 EMbmAknfepuictrlsQgn_indi_fep_arrow_left_mask, |
|
799 AKN_LAF_COLOR( 0 ) |
|
800 ); |
|
801 |
|
802 AknsUtils::CreateColorIconL( skin, |
|
803 KAknsIIDQgnIndiFepArrowRight, |
|
804 KAknsIIDQsnIconColors, |
|
805 EAknsCIQsnIconColorsCG20, |
|
806 iNaviArrowBitmapRight, |
|
807 iNaviArrowBitmapRightMask, |
|
808 bmpFile, |
|
809 EMbmAknfepuictrlsQgn_indi_fep_arrow_right, |
|
810 EMbmAknfepuictrlsQgn_indi_fep_arrow_right_mask, |
|
811 AKN_LAF_COLOR( 0 ) |
|
812 ); |
|
813 } |
|
814 |
|
815 CAknFepUICtrlPinyinPopup::CAknFepUICtrlPinyinPopup( CAknFepUiLayoutDataMgr* aLafDataMgr ) |
|
816 : |
|
817 iSelected(0), |
|
818 iEnabled(EFalse), |
|
819 iVisibleCount(CAknFepUICtrlPinyinPopup::EMaxPhraseCandidate), |
|
820 iCurDisplayPage(0), |
|
821 iTonemarkState(1), |
|
822 iStrokeState(0), |
|
823 iHighLightFlag( 0 ), |
|
824 iFlags(0), |
|
825 iValidKeystrokeCount( 0 ), |
|
826 iPhraseCreation(0), |
|
827 iPhraseCreationEditingState( 0 ), |
|
828 iState(1), |
|
829 iChangeStateFromEditToSpelling( 0 ), |
|
830 iValidKeystrokeChanged( 0 ) |
|
831 { |
|
832 iLafDataMgr = aLafDataMgr; |
|
833 iEEPContent.Zero(); |
|
834 } |
|
835 |
|
836 void CAknFepUICtrlPinyinPopup::LayoutRects() |
|
837 { |
|
838 // left arrow |
|
839 iIndiFepArrowLeft = |
|
840 CAknFepChineseUIDataConv::AnyToLayoutRect( iLafDataMgr->RequestData( EIndiFepArrowLeft )); |
|
841 AknIconUtils::SetSize( iNaviArrowBitmapLeft, iIndiFepArrowLeft.Rect().Size()); |
|
842 |
|
843 // right arrow |
|
844 iIndiFepArrowRight = |
|
845 CAknFepChineseUIDataConv::AnyToLayoutRect( iLafDataMgr->RequestData( EIndiFepArrowRight )); |
|
846 AknIconUtils::SetSize( iNaviArrowBitmapRight, iIndiFepArrowRight.Rect().Size()); |
|
847 |
|
848 // cover main pane |
|
849 iRectCoverMainPaneInput = |
|
850 CAknFepChineseUIDataConv::AnyToLayoutRect( iLafDataMgr->RequestData( ERectCoverMainPaneInput )); |
|
851 // first shadow |
|
852 iRectFirstShadowInput = |
|
853 CAknFepChineseUIDataConv::AnyToLayoutRect( iLafDataMgr->RequestData( ERectFirstShadowInput )); |
|
854 // outline frame |
|
855 iRectOutlineFrameInput = |
|
856 CAknFepChineseUIDataConv::AnyToLayoutRect( iLafDataMgr->RequestData( ERectOutlineFrameInput )); |
|
857 // inside area |
|
858 iRectInsideAreaInput = |
|
859 CAknFepChineseUIDataConv::AnyToLayoutRect( iLafDataMgr->RequestData( ERectInsideAreaInput )); |
|
860 } |
|
861 |
|
862 void CAknFepUICtrlPinyinPopup::LayoutContainedControls() |
|
863 { |
|
864 LayoutInputPanes(); |
|
865 } |
|
866 |
|
867 void CAknFepUICtrlPinyinPopup::LayoutInputPanes() |
|
868 { |
|
869 for(TInt i = 0; i < EMaxPhraseCandidate; i++) |
|
870 { |
|
871 LayoutInputPane(i); |
|
872 } |
|
873 } |
|
874 |
|
875 void CAknFepUICtrlPinyinPopup::LayoutInputPane(TInt aIndex) |
|
876 { |
|
877 TRect rect = Rect(); |
|
878 |
|
879 CAknFepUICtrlInputPane* inputPane = iInputPaneArray[aIndex]; |
|
880 TAknWindowLineLayout layoutEntryItem = |
|
881 CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData(ELayoutEntryItem)); |
|
882 TAknTextLineLayout layoutLineText = |
|
883 CAknFepChineseUIDataConv::AnyToTextLine( iLafDataMgr->RequestData(EEntryTextLayout)); |
|
884 TAknLayoutRect layoutRectEntryItem; |
|
885 layoutRectEntryItem.LayoutRect(rect,layoutEntryItem); |
|
886 TRect rectEntryItem = layoutRectEntryItem.Rect(); |
|
887 |
|
888 TAknLayoutText layoutText; |
|
889 layoutText.LayoutText(rectEntryItem,layoutLineText); |
|
890 TRect rectText = layoutText.TextRect(); |
|
891 |
|
892 // value is 3 for 176*208 resolution |
|
893 TInt distance = rectText.iTl.iX - rectEntryItem.iTl.iX + rectEntryItem.iBr.iX - rectText.iBr.iX; |
|
894 |
|
895 if( aIndex > 0) |
|
896 { |
|
897 CAknFepUICtrlInputPane* inputPanePrev = iInputPaneArray[aIndex - 1]; |
|
898 rectText.iTl.iX = inputPanePrev->Rect().iBr.iX; |
|
899 } |
|
900 rectText.SetWidth(inputPane->LabelTextWidthInPixels() + distance); |
|
901 rectText.SetHeight(rect.Height()); |
|
902 |
|
903 inputPane->SetRect(rectText); |
|
904 inputPane->SetHighlighted(aIndex == iSelected); |
|
905 } |
|
906 |
|
907 void CAknFepUICtrlPinyinPopup::SetInputPaneVisibility() |
|
908 { |
|
909 TInt number = iVisibleCount; |
|
910 CWindowGc& gc = SystemGc(); |
|
911 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
912 MAknsControlContext* cc = AknsDrawUtils::ControlContext(this); |
|
913 TBool skinnedDraw = AknsDrawUtils::Background(skin, cc, this, gc, Rect(),KAknsDrawParamPrepareOnly); |
|
914 |
|
915 for(TInt i = 0; i < EMaxPhraseCandidate; i++) |
|
916 { |
|
917 CAknFepUICtrlInputPane* inputPane = iInputPaneArray[i]; |
|
918 |
|
919 //TBool skinnedDraw = AknsDrawUtils::HasBitmapBackground(skin, cc); |
|
920 if(skinnedDraw) |
|
921 { |
|
922 // show input panes, when skinned, as they must draw background context |
|
923 // to avoid (the one that is almost off-screen) flickering behind |
|
924 // however, need to hide the text so that is doesn't show |
|
925 inputPane->MakeTextVisible(i < number); |
|
926 } |
|
927 else |
|
928 { |
|
929 // if not skinned, must hide the offscreen input panes otherwise they |
|
930 // will draw over the border rectangle |
|
931 inputPane->MakeVisible(i < number); |
|
932 } |
|
933 } |
|
934 } |
|
935 |
|
936 void CAknFepUICtrlPinyinPopup::LayoutFrames() |
|
937 { |
|
938 TRect outerRect; |
|
939 TRect innerRect; |
|
940 CalculateFrameRects(outerRect, innerRect); |
|
941 iBgContext->SetFrameRects(outerRect, innerRect); |
|
942 iBgContext->SetParentPos(PositionRelativeToScreen()); |
|
943 } |
|
944 |
|
945 void CAknFepUICtrlPinyinPopup::CalculateFrameRects(TRect& aOuterRect, TRect& aInnerRect) const |
|
946 { |
|
947 TRect windowRect = |
|
948 CAknFepChineseUIDataConv::AnyToRect( iLafDataMgr->RequestData( EPopupRectEntry )); |
|
949 TInt rectHeight = windowRect.iBr.iY - windowRect.iTl.iY; |
|
950 TInt rectWidth = windowRect.Width(); |
|
951 windowRect.iTl.iX = 0; |
|
952 windowRect.iTl.iY = 0; |
|
953 windowRect.SetHeight(rectHeight); |
|
954 windowRect.SetWidth(rectWidth); |
|
955 |
|
956 TAknLayoutRect topLeft; |
|
957 topLeft.LayoutRect(windowRect, SkinLayout::Submenu_skin_placing_Line_2()); |
|
958 |
|
959 TAknLayoutRect bottomRight; |
|
960 bottomRight.LayoutRect(windowRect, SkinLayout::Submenu_skin_placing_Line_5()); |
|
961 |
|
962 aOuterRect = TRect(topLeft.Rect().iTl, bottomRight.Rect().iBr); |
|
963 aInnerRect = TRect(topLeft.Rect().iBr, bottomRight.Rect().iTl); |
|
964 } |
|
965 |
|
966 void CAknFepUICtrlPinyinPopup::SetNoneHighlighted() |
|
967 { |
|
968 TInt number = iVisibleCount; |
|
969 CWindowGc& gc = SystemGc(); |
|
970 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
971 MAknsControlContext* cc = AknsDrawUtils::ControlContext(this); |
|
972 TBool skinnedDraw = AknsDrawUtils::Background(skin, cc, this, gc, Rect(),KAknsDrawParamPrepareOnly); |
|
973 |
|
974 for(TInt i = 0; i < EMaxPhraseCandidate; i++) |
|
975 { |
|
976 CAknFepUICtrlInputPane* inputPane = iInputPaneArray[i]; |
|
977 |
|
978 //TBool skinnedDraw = AknsDrawUtils::HasBitmapBackground(skin, cc); |
|
979 if(skinnedDraw) |
|
980 { |
|
981 // show input panes, when skinned, as they must draw background context |
|
982 // to avoid (the one that is almost off-screen) flickering behind |
|
983 // however, need to hide the text so that is doesn't show |
|
984 inputPane->SetHighlighted( !(i < number) ); |
|
985 } |
|
986 } |
|
987 } |
|
988 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::KeystrokeArrayForStroke() |
|
989 { |
|
990 return iKeystrokeArrayForStroke; |
|
991 } |
|
992 |
|
993 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::InEffectKeystrokeArrayForStroke() |
|
994 { |
|
995 return iInEffectKeystrokeArrayForStroke; |
|
996 } |
|
997 |
|
998 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::ShowKeystrokeArrayForStroke() |
|
999 { |
|
1000 return iShowKeystrokeArrayForStroke; |
|
1001 } |
|
1002 |
|
1003 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::ChooseChineseCharacterArrayForStroke() |
|
1004 { |
|
1005 return iChooseChineseCharacterArrayForStroke; |
|
1006 } |
|
1007 |
|
1008 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::ChooseChineseCharacterArrayKeystrokeForStroke() |
|
1009 { |
|
1010 return iChooseChineseCharacterArrayKeystrokeForStroke; |
|
1011 } |
|
1012 |
|
1013 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::ZhuyinSymbols() |
|
1014 { |
|
1015 return this->iZhuyinSymbols; |
|
1016 } |
|
1017 |
|
1018 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::ZhuyinShowSymbols() |
|
1019 { |
|
1020 return this->iZhuyinShowSymbols; |
|
1021 } |
|
1022 |
|
1023 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::FirstValidZhuyinGrp() |
|
1024 { |
|
1025 return this->iFirstValidZhuyinGrp; |
|
1026 } |
|
1027 |
|
1028 void CAknFepUICtrlPinyinPopup::SetEEPContent ( const TDes& aDes ) |
|
1029 { |
|
1030 iEEPContent = aDes; |
|
1031 } |
|
1032 |
|
1033 TDes& CAknFepUICtrlPinyinPopup::GetEEPContent ( ) |
|
1034 { |
|
1035 return iEEPContent; |
|
1036 } |
|
1037 |
|
1038 void CAknFepUICtrlPinyinPopup::SetEEPContentValid ( TBool aValid ) |
|
1039 { |
|
1040 iEEPContentValid = aValid; |
|
1041 } |
|
1042 |
|
1043 TBool CAknFepUICtrlPinyinPopup::GetEEPContentValid ( ) |
|
1044 { |
|
1045 return iEEPContentValid; |
|
1046 } |
|
1047 |
|
1048 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::ChineseCharsDisped() |
|
1049 { |
|
1050 return this->iChineseCharsDisped; |
|
1051 } |
|
1052 |
|
1053 CDesCArrayFlat* CAknFepUICtrlPinyinPopup::ZhuyinSymbolsForChineseCharsDisped() |
|
1054 { |
|
1055 return this->iZhuyinSymbolsForChineseCharsDisped; |
|
1056 } |
|
1057 |
|
1058 void CAknFepUICtrlPinyinPopup::ResetStrokeArray() |
|
1059 { |
|
1060 //reset pinyin array |
|
1061 iSpellingArray->Reset(); |
|
1062 iSpellingArray->Compress(); |
|
1063 iSpellingIndexArray->Reset(); |
|
1064 iSpellingIndexArray->Compress(); |
|
1065 iKeystrokeArray->Reset(); |
|
1066 iKeystrokeArray->Compress(); |
|
1067 iInEffectKeystrokeArray->Reset(); |
|
1068 iInEffectKeystrokeArray->Compress(); |
|
1069 iShowKeystrokeArray->Reset(); |
|
1070 iShowKeystrokeArray->Compress(); |
|
1071 iChooseChineseCharacterArray->Reset(); |
|
1072 iChooseChineseCharacterArray->Compress(); |
|
1073 iChooseChineseCharacterArrayKeystroke->Reset(); |
|
1074 iChooseChineseCharacterArrayKeystroke->Compress(); |
|
1075 iChooseChineseCharacterArraySpelling->Reset(); |
|
1076 iChooseChineseCharacterArraySpelling->Compress(); |
|
1077 iOptimizeSpelling->Reset(); |
|
1078 iOptimizeSpelling->Compress(); |
|
1079 iTempSpelling->Reset(); |
|
1080 iTempSpelling->Compress(); |
|
1081 |
|
1082 //reset stroke array |
|
1083 iKeystrokeArrayForStroke->Reset(); |
|
1084 iKeystrokeArrayForStroke->Compress(); |
|
1085 iInEffectKeystrokeArrayForStroke->Reset(); |
|
1086 iInEffectKeystrokeArrayForStroke->Compress(); |
|
1087 iShowKeystrokeArrayForStroke->Reset(); |
|
1088 iShowKeystrokeArrayForStroke->Compress(); |
|
1089 iChooseChineseCharacterArrayForStroke->Reset(); |
|
1090 iChooseChineseCharacterArrayForStroke->Compress(); |
|
1091 iChooseChineseCharacterArrayKeystrokeForStroke->Reset(); |
|
1092 iChooseChineseCharacterArrayKeystrokeForStroke->Compress(); |
|
1093 |
|
1094 //reset zhuyin array |
|
1095 iZhuyinSymbols->Reset(); |
|
1096 iFirstValidZhuyinGrp->Reset(); |
|
1097 iChineseCharsDisped->Reset(); |
|
1098 iZhuyinSymbolsForChineseCharsDisped->Reset(); |
|
1099 |
|
1100 iZhuyinSymbols->Compress(); |
|
1101 iFirstValidZhuyinGrp->Compress(); |
|
1102 iChineseCharsDisped->Compress(); |
|
1103 iZhuyinSymbolsForChineseCharsDisped->Compress(); |
|
1104 |
|
1105 iLastResouce = 0; |
|
1106 iValidKeystrokeCount = 0; |
|
1107 iPhraseCreation = 0; |
|
1108 iPhraseCreationEditingState = 0; |
|
1109 iHighLightFlag = 0; |
|
1110 iChangeStateFromEditToSpelling = 0; |
|
1111 iValidKeystrokeChanged = 0; |
|
1112 |
|
1113 } |
|
1114 |
|
1115 void CAknFepUICtrlPinyinPopup::SetChangeState( TBool aChangeState ) |
|
1116 { |
|
1117 iChangeState = aChangeState ; |
|
1118 } |
|
1119 |
|
1120 TBool CAknFepUICtrlPinyinPopup::IsChangeStatet() const |
|
1121 { |
|
1122 return iChangeState; |
|
1123 } |
|
1124 |
|
1125 void CAknFepUICtrlPinyinPopup::SetState( TInt aState ) |
|
1126 { |
|
1127 iState = aState; |
|
1128 } |
|
1129 |
|
1130 TInt CAknFepUICtrlPinyinPopup::GetState() |
|
1131 { |
|
1132 return iState; |
|
1133 } |
|
1134 |
|
1135 void CAknFepUICtrlPinyinPopup::SetPhraseCreationState( TBool aState ) |
|
1136 { |
|
1137 iPhraseCreation = aState; |
|
1138 } |
|
1139 |
|
1140 TBool CAknFepUICtrlPinyinPopup::GetPhraseCreationState() |
|
1141 { |
|
1142 return iPhraseCreation; |
|
1143 } |
|
1144 |
|
1145 void CAknFepUICtrlPinyinPopup::SetPhraseCreationEditingState( TBool aState ) |
|
1146 { |
|
1147 iPhraseCreationEditingState = aState; |
|
1148 } |
|
1149 |
|
1150 TBool CAknFepUICtrlPinyinPopup::GetPhraseCreationEditingState() |
|
1151 { |
|
1152 return iPhraseCreationEditingState; |
|
1153 } |
|
1154 |
|
1155 // --------------------------------------------------------- |
|
1156 // Set flag whether from candidate state change state. |
|
1157 // --------------------------------------------------------- |
|
1158 // |
|
1159 void CAknFepUICtrlPinyinPopup::SetFromCandidateChangeStateFlag( TBool aFlag ) |
|
1160 { |
|
1161 iHighLightFlag = aFlag; |
|
1162 } |
|
1163 |
|
1164 // --------------------------------------------------------- |
|
1165 // Get flag whether from candidate state change state. |
|
1166 // --------------------------------------------------------- |
|
1167 // |
|
1168 TBool CAknFepUICtrlPinyinPopup::GetFromCandidateChangeStateFlag() |
|
1169 { |
|
1170 return iHighLightFlag; |
|
1171 } |
|
1172 |
|
1173 // --------------------------------------------------------- |
|
1174 // Set count of valid keystroke. |
|
1175 // --------------------------------------------------------- |
|
1176 // |
|
1177 void CAknFepUICtrlPinyinPopup::SetValidKeystrokeCount( TInt aCount ) |
|
1178 { |
|
1179 iValidKeystrokeCount = aCount; |
|
1180 } |
|
1181 |
|
1182 // --------------------------------------------------------- |
|
1183 // Set count of valid keystroke. |
|
1184 // --------------------------------------------------------- |
|
1185 // |
|
1186 TInt CAknFepUICtrlPinyinPopup::GetValidKeystrokeCount() |
|
1187 { |
|
1188 return iValidKeystrokeCount; |
|
1189 } |
|
1190 |
|
1191 // --------------------------------------------------------- |
|
1192 // Set last cba resouce id. |
|
1193 // --------------------------------------------------------- |
|
1194 // |
|
1195 void CAknFepUICtrlPinyinPopup::SetLastResouce( TInt aResouceId ) |
|
1196 { |
|
1197 iLastResouce = aResouceId; |
|
1198 } |
|
1199 |
|
1200 // --------------------------------------------------------- |
|
1201 // Get last cba resouce id. |
|
1202 // --------------------------------------------------------- |
|
1203 // |
|
1204 TInt CAknFepUICtrlPinyinPopup::GetLastResouce() |
|
1205 { |
|
1206 return iLastResouce; |
|
1207 } |
|
1208 |
|
1209 // --------------------------------------------------------- |
|
1210 // Set change state from Edit to Spelling flag. |
|
1211 // --------------------------------------------------------- |
|
1212 // |
|
1213 void CAknFepUICtrlPinyinPopup::SetFromEditToSpellingFlag( TBool aFlag ) |
|
1214 { |
|
1215 iChangeStateFromEditToSpelling = aFlag; |
|
1216 } |
|
1217 |
|
1218 // --------------------------------------------------------- |
|
1219 // Get change state from Edit to Spelling flag. |
|
1220 // --------------------------------------------------------- |
|
1221 // |
|
1222 TInt CAknFepUICtrlPinyinPopup::GetFromEditToSpellingFlag() |
|
1223 { |
|
1224 return iChangeStateFromEditToSpelling; |
|
1225 } |
|
1226 |
|
1227 // --------------------------------------------------------- |
|
1228 // Set valid keystroke change flag. |
|
1229 // --------------------------------------------------------- |
|
1230 // |
|
1231 void CAknFepUICtrlPinyinPopup::SetValidKeystrokeChange( TBool aFlag ) |
|
1232 { |
|
1233 iValidKeystrokeChanged = aFlag; |
|
1234 } |
|
1235 |
|
1236 // --------------------------------------------------------- |
|
1237 // Get valid keystroke change flag. |
|
1238 // --------------------------------------------------------- |
|
1239 // |
|
1240 TBool CAknFepUICtrlPinyinPopup::GetValidKeystrokeChange() |
|
1241 { |
|
1242 return iValidKeystrokeChanged; |
|
1243 } |
|
1244 |
|
1245 // --------------------------------------------------------- |
|
1246 // Set PreStateIsPredict flag. |
|
1247 // --------------------------------------------------------- |
|
1248 // |
|
1249 void CAknFepUICtrlPinyinPopup::SetPreStateIsPredictive( TBool aFlag ) |
|
1250 { |
|
1251 iPreStateIsPredictive = aFlag; |
|
1252 } |
|
1253 |
|
1254 // --------------------------------------------------------- |
|
1255 // Set PreStateIsPredict flag. |
|
1256 // --------------------------------------------------------- |
|
1257 // |
|
1258 TBool CAknFepUICtrlPinyinPopup::GetPreStateIsPredictive() |
|
1259 { |
|
1260 return iPreStateIsPredictive; |
|
1261 } |
|
1262 |
|
1263 void CAknFepUICtrlPinyinPopup::SetInputLayoutMiniQwertyZhuyin() |
|
1264 { |
|
1265 for(TInt i = 0; i < EMaxPhraseCandidate; i++) |
|
1266 { |
|
1267 iInputPaneArray[i]->SetLayout( CAknFepUICtrlInputPane::ELayoutPhraseMiniQwertyZhuyin ); |
|
1268 } |
|
1269 } |
|
1270 |
|
1271 void CAknFepUICtrlPinyinPopup::ResetInputLayoutMiniQwertyZhuyin() |
|
1272 { |
|
1273 for(TInt i = 0; i < EMaxPhraseCandidate; i++) |
|
1274 { |
|
1275 iInputPaneArray[i]->SetLayout( CAknFepUICtrlInputPane::ELayoutPhrasePinyinPopupPane ); |
|
1276 } |
|
1277 } |
|
1278 // End of file |