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