author | Simon Howkins <simonh@symbian.org> |
Mon, 15 Nov 2010 14:00:51 +0000 | |
branch | RCL_3 |
changeset 59 | 7febbd162ded |
parent 56 | 8152b1f1763a |
permissions | -rw-r--r-- |
44 | 1 |
/* |
2 |
* Copyright (c) 2009-2010 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: Implementation of main window of finger hwr. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// INCLUDE |
|
19 |
#include <coemain.h> |
|
20 |
#include <s32mem.h> |
|
21 |
||
22 |
#include <aknlayoutscalable_apps.cdl.h> |
|
23 |
#include <aknlayoutscalable_avkon.cdl.h> |
|
24 |
#include <AknLayoutDef.h> |
|
25 |
#include <AknUtils.h> |
|
26 |
#include <AknsUtils.h> |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
27 |
#include <akniconutils.h> |
44 | 28 |
#include <AknFepGlobalEnums.h> |
29 |
#include <aknfeppeninputenums.h> |
|
30 |
||
31 |
#include <peninputfingerhwrarwnd.rsg> |
|
32 |
#include <peninputlayoutmultilineicf.h> |
|
33 |
#include <peninputdropdownlist.h> |
|
34 |
#include <peninputrepeatbutton.h> |
|
35 |
#include <peninputlayoutbubblectrl.h> |
|
36 |
||
37 |
// USER INCLUDES |
|
38 |
#include "peninputfingerhwrarwnd.h" |
|
39 |
#include "peninputfingerhwrarlafmanager.h" |
|
40 |
#include "peninputfingerhwrarevent.h" |
|
41 |
#include "peninputfingerhwrarcontrolid.h" |
|
42 |
#include "peninputfingerhwrarstoreconstants.h" |
|
43 |
#include "peninputfingerhwrarmultipagevkb.h" |
|
44 |
#include "peninputfingerhwrarlayout.h" |
|
45 |
#include "peninputfingerhwrardatastore.h" |
|
46 |
#include "peninputfingerhwrarsymboltable.h" |
|
47 |
#include "peninputfingerhwrarnumsymboltable.h" |
|
48 |
#include "peninputfingerhwrarindicator.h" |
|
49 |
#include "peninputfingerhwrarwritingwnd.h" |
|
50 |
||
51 |
const TUint32 KDefaultTextColor = 0x000000; |
|
52 |
const TUint KDefaultFrameColor = 0x000000; |
|
53 |
const TUint32 KDefaultWriteBoxBgColor = 0xdddddd; |
|
54 |
const TUint32 KDefaultWriteBoxFrameColor = 0x000000; |
|
55 |
||
56 |
// --------------------------------------------------------------------------- |
|
57 |
// Symbian Constructor |
|
58 |
// --------------------------------------------------------------------------- |
|
59 |
// |
|
60 |
CPeninputFingerHwrArWnd* CPeninputFingerHwrArWnd::NewL( CFepUiLayout* aFepUiLayout, |
|
61 |
TInt aControlId, TBool aLandscapeStyle ) |
|
62 |
{ |
|
63 |
CPeninputFingerHwrArWnd* self = NewLC( aFepUiLayout, aControlId, aLandscapeStyle ); |
|
64 |
CleanupStack::Pop( self ); |
|
65 |
||
66 |
return self; |
|
67 |
} |
|
68 |
||
69 |
// --------------------------------------------------------------------------- |
|
70 |
// Symbian Constructor |
|
71 |
// --------------------------------------------------------------------------- |
|
72 |
// |
|
73 |
CPeninputFingerHwrArWnd* CPeninputFingerHwrArWnd::NewLC( CFepUiLayout* aFepUiLayout, |
|
74 |
TInt aControlId, TBool aLandscapeStyle ) |
|
75 |
{ |
|
76 |
CPeninputFingerHwrArWnd* self = new ( ELeave ) CPeninputFingerHwrArWnd( aFepUiLayout, aControlId ); |
|
77 |
CleanupStack::PushL( self ); |
|
78 |
self->ConstructL( aLandscapeStyle ); |
|
79 |
||
80 |
return self; |
|
81 |
} |
|
82 |
||
83 |
// --------------------------------------------------------------------------- |
|
84 |
// c++ destructor |
|
85 |
// --------------------------------------------------------------------------- |
|
86 |
// |
|
87 |
CPeninputFingerHwrArWnd::~CPeninputFingerHwrArWnd() |
|
88 |
{ |
|
89 |
#ifdef RD_TACTILE_FEEDBACK |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
90 |
if(UiLayout()) |
44 | 91 |
{ |
92 |
UiLayout()->DeRegisterFeedbackArea(reinterpret_cast<TInt>(iWritingBox), |
|
93 |
iWritingBox->Rect()); |
|
94 |
} |
|
95 |
#endif |
|
96 |
delete iLafManager; |
|
97 |
} |
|
98 |
||
99 |
// --------------------------------------------------------------------------- |
|
100 |
// Construct control from resource. |
|
101 |
// --------------------------------------------------------------------------- |
|
102 |
// |
|
103 |
void CPeninputFingerHwrArWnd::ConstructFromResourceL() |
|
104 |
{ |
|
105 |
if ( iResourceId == KInvalidResId ) |
|
106 |
{ |
|
107 |
User::Leave( KErrArgument ); |
|
108 |
} |
|
109 |
||
110 |
TResourceReader reader; |
|
111 |
CCoeEnv::Static()->CreateResourceReaderLC( reader, iResourceId ); |
|
112 |
||
113 |
TInt supportskin = reader.ReadInt16(); |
|
114 |
||
115 |
if ( iFirstTimeConstruct && ( supportskin != KNotSupportSkin ) ) |
|
116 |
{ |
|
117 |
UiLayout()->AddControlL( this ); |
|
118 |
} |
|
119 |
||
120 |
// read shadow resources |
|
121 |
TInt32 shadow = reader.ReadInt32(); |
|
122 |
ReadShadowInfoL( shadow ); |
|
123 |
||
124 |
// read icf resource |
|
125 |
TInt32 icf = reader.ReadInt32(); |
|
126 |
ReadICFInfoL( icf ); |
|
127 |
||
128 |
||
129 |
if ( iFirstTimeConstruct ) |
|
130 |
{ |
|
131 |
const TInt32 boxwndResId = reader.ReadInt32(); |
|
132 |
const TInt32 bgImageResId = reader.ReadInt32(); |
|
133 |
||
134 |
ReadWritingBoxInfoL( boxwndResId ); |
|
135 |
ReadBackgroundInfoL( bgImageResId ); |
|
136 |
} |
|
137 |
else |
|
138 |
{ |
|
139 |
CControlGroup::ConstructFromResourceL(); |
|
140 |
||
141 |
const TInt32 boxwndResId = reader.ReadInt32(); |
|
142 |
const TInt32 bgImageResId = reader.ReadInt32(); |
|
143 |
ReadWritingBoxInfoL( boxwndResId ); |
|
144 |
ReadBackgroundInfoL( bgImageResId ); |
|
145 |
} |
|
146 |
||
147 |
CleanupStack::PopAndDestroy(); // reader |
|
148 |
||
149 |
// read keypad image info |
|
150 |
if ( iNumSymbolTable ) |
|
151 |
{ |
|
152 |
TSize keysize = iLafManager->VirtualNumpadCellSize().Size(); |
|
153 |
iNumSymbolTable->LoadVkbKeyImageL(R_FINGER_HWR_NUMPAD_IMAGE, keysize ); |
|
154 |
||
155 |
RArray<TRect> rects; |
|
156 |
CleanupClosePushL( rects ); |
|
157 |
iLafManager->GetNumVirtualKeyRects( rects ); |
|
158 |
LoadNumSymbolVirtualKeysL( R_FINGER_HWR_NUMPAD, rects ); |
|
159 |
CleanupStack::PopAndDestroy(); //rects |
|
160 |
} |
|
161 |
||
162 |
if ( iSymbolTable ) |
|
163 |
{ |
|
164 |
TSize keysize = iLafManager->VirtualSctpadCellSize().Size(); |
|
165 |
iSymbolTable->LoadVkbKeyImageL(R_FINGER_HWR_SCTPAD_IMAGE, keysize ); |
|
166 |
||
167 |
RArray<TRect> rects; |
|
168 |
CleanupClosePushL( rects ); |
|
169 |
iLafManager->GetVirtualKeyRects( rects ); |
|
170 |
if(iLafManager->IsLandscape()) |
|
171 |
{ |
|
172 |
LoadSymbolVirtualKeysL(R_ARABIC_FINGER_HWR_LANDSCAPE_SYMBOL_TABLE, rects); |
|
173 |
} |
|
174 |
else |
|
175 |
{ |
|
176 |
LoadSymbolVirtualKeysL(R_ARABIC_FINGER_HWR_PORTRAIT_SYMBOL_TABLE, rects); |
|
177 |
} |
|
178 |
CleanupStack::PopAndDestroy(); //rects |
|
179 |
} |
|
180 |
||
181 |
if (!iFirstTimeConstruct) |
|
182 |
{ |
|
183 |
Draw(); |
|
184 |
} |
|
185 |
||
186 |
iFirstTimeConstruct = EFalse; |
|
187 |
} |
|
188 |
||
189 |
||
190 |
// --------------------------------------------------------------------------- |
|
191 |
// Draw window. |
|
192 |
// --------------------------------------------------------------------------- |
|
193 |
// |
|
194 |
void CPeninputFingerHwrArWnd::Draw() |
|
195 |
{ |
|
196 |
if(AbleToDraw()) |
|
197 |
{ |
|
198 |
DrawOpaqueMaskBackground( Rect() ); |
|
199 |
||
200 |
if( BackgroundBmp() && BackgroundBmp()->SizeInPixels() != Rect().Size() ) |
|
201 |
{ |
|
202 |
AknIconUtils::SetSize(BackgroundBmp(), Rect().Size(), EAspectRatioNotPreserved); |
|
203 |
} |
|
204 |
||
205 |
DrawBackground(); |
|
206 |
||
207 |
CControlGroup::Draw(); |
|
208 |
||
209 |
// Update whole area |
|
210 |
UpdateArea( Rect(), EFalse ); |
|
211 |
} |
|
212 |
} |
|
213 |
||
214 |
// --------------------------------------------------------------------------- |
|
215 |
// Resize. |
|
216 |
// --------------------------------------------------------------------------- |
|
217 |
// |
|
218 |
void CPeninputFingerHwrArWnd::SizeChangedL() |
|
219 |
{ |
|
220 |
iLafManager->ReadLafInfo(); |
|
221 |
ResetLayoutL(); |
|
222 |
||
223 |
||
224 |
iCandidateList->SizeChanged( iLafManager->CandidateUnitWidth(), |
|
225 |
iLafManager->CandidateUnitHeight(), |
|
226 |
iLafManager->CandidateUnitWidth(), |
|
227 |
iLafManager->CandidateLTPos(), |
|
228 |
3/*KCandidateCountPerRow*/, |
|
229 |
2 ); |
|
230 |
iContextField->SetTextMargin ( iLafManager->IcfLeftMargin(), |
|
231 |
iLafManager->IcfRightMargin(), |
|
232 |
iLafManager->IcfTopMargin(), |
|
233 |
iLafManager->IcfBottomMargin() ); |
|
234 |
||
235 |
iContextField->SetLineSpace( iLafManager->IcfLineSpaceMargin() ); |
|
236 |
iContextField->SizeChangedL( iLafManager->IcfRect(), |
|
237 |
iLafManager->IcfTextHeight(), |
|
238 |
iLafManager->IcfFont()->FontMaxHeight(), |
|
239 |
iLafManager->IcfFont() ); |
|
240 |
||
241 |
CalculateGuideLinePos(); |
|
242 |
Draw(); |
|
243 |
} |
|
244 |
||
245 |
// --------------------------------------------------------------------------- |
|
246 |
// Handle window open |
|
247 |
// --------------------------------------------------------------------------- |
|
248 |
// |
|
249 |
void CPeninputFingerHwrArWnd::HandleWindowOpenCommandL() |
|
250 |
{ |
|
251 |
CalculateGuideLinePos(); |
|
252 |
} |
|
253 |
||
254 |
// --------------------------------------------------------------------------- |
|
255 |
// accept editor's text alignment. |
|
256 |
// --------------------------------------------------------------------------- |
|
257 |
// |
|
258 |
void CPeninputFingerHwrArWnd::SetTextAlignmentL( TInt aAlignment, TInt aLangId ) |
|
259 |
{ |
|
260 |
if ( iContextField ) |
|
261 |
{ |
|
262 |
iContextField->SetTextAlignmentL( aAlignment, aLangId ); |
|
263 |
} |
|
264 |
} |
|
265 |
||
266 |
// --------------------------------------------------------------------------- |
|
267 |
// accept editor's text |
|
268 |
// --------------------------------------------------------------------------- |
|
269 |
// |
|
270 |
void CPeninputFingerHwrArWnd::SetEditorTextL( const TFepInputContextFieldData& aData ) |
|
271 |
{ |
|
272 |
if ( iContextField ) |
|
273 |
{ |
|
274 |
iContextField->SetTextL( aData ); |
|
275 |
} |
|
276 |
} |
|
277 |
||
278 |
// --------------------------------------------------------------------------- |
|
279 |
// accept editor's promopt txt. |
|
280 |
// --------------------------------------------------------------------------- |
|
281 |
// |
|
282 |
void CPeninputFingerHwrArWnd::SetPromptTextL( TUint8* aPromoptData ) |
|
283 |
{ |
|
284 |
RDesReadStream readStream; |
|
285 |
||
286 |
TPtr8 countPtr(aPromoptData, 2*sizeof(TInt), 2*sizeof(TInt)); |
|
287 |
readStream.Open(countPtr); |
|
288 |
CleanupClosePushL(readStream); |
|
289 |
const TInt dataCount = readStream.ReadInt32L(); |
|
290 |
const TInt textCount = readStream.ReadInt32L(); |
|
291 |
CleanupStack::PopAndDestroy(&readStream); |
|
292 |
||
293 |
TPtr8 ptr( aPromoptData+2*sizeof(TInt), dataCount+textCount, dataCount+textCount ); |
|
294 |
readStream.Open(ptr); |
|
295 |
CleanupClosePushL(readStream); |
|
296 |
||
297 |
HBufC8* dataBuf = HBufC8::NewLC(dataCount); |
|
298 |
TPtr8 dataBufPtr = dataBuf->Des(); |
|
299 |
readStream.ReadL(dataBufPtr, dataCount); |
|
300 |
||
301 |
TFepPromptText* pIcfData = |
|
302 |
reinterpret_cast<TFepPromptText*>(const_cast<TUint8*>(dataBufPtr.Ptr())); |
|
303 |
||
304 |
HBufC* textBuf; |
|
305 |
if (textCount > 0) |
|
306 |
{ |
|
307 |
textBuf = HBufC::NewLC(textCount/2); |
|
308 |
TPtr textBufPtr = textBuf->Des(); |
|
309 |
readStream.ReadL(textBufPtr, textCount/2); |
|
310 |
||
311 |
const HBufC* icfPromptText = iContextField->PromptText(); |
|
312 |
||
313 |
if (!icfPromptText || icfPromptText->Compare(textBuf->Des()) != 0 ) |
|
314 |
{ |
|
315 |
iContextField->SetPromptTextL( textBuf->Des(), pIcfData->iCleanContent ); |
|
316 |
} |
|
317 |
||
318 |
CleanupStack::PopAndDestroy(textBuf); |
|
319 |
} |
|
320 |
else |
|
321 |
{ |
|
322 |
iContextField->SetPromptTextL(KNullDesC, pIcfData->iCleanContent); |
|
323 |
} |
|
324 |
||
325 |
CleanupStack::PopAndDestroy(dataBuf); |
|
326 |
CleanupStack::PopAndDestroy(&readStream); |
|
327 |
} |
|
328 |
||
329 |
// --------------------------------------------------------------------------- |
|
330 |
// Dim option button |
|
331 |
// --------------------------------------------------------------------------- |
|
332 |
// |
|
333 |
void CPeninputFingerHwrArWnd::SetEnableSettingBtn(const TBool aEnable) |
|
334 |
{ |
|
335 |
if ( aEnable ) |
|
336 |
{ |
|
337 |
iOptionBtn->SetDimmed(EFalse); |
|
338 |
} |
|
339 |
else |
|
340 |
{ |
|
341 |
iOptionBtn->SetDimmed(ETrue); |
|
342 |
iOptionBtn->SetActive(EFalse); |
|
343 |
} |
|
344 |
||
345 |
} |
|
346 |
||
347 |
// --------------------------------------------------------------------------- |
|
348 |
// accept editor's bubble text. |
|
349 |
// --------------------------------------------------------------------------- |
|
350 |
// |
|
351 |
void CPeninputFingerHwrArWnd::SetBubbleTextL( const TDesC& aInfo ) |
|
352 |
{ |
|
353 |
if ( aInfo.Length() > 0 ) |
|
354 |
{ |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
355 |
iContextField->ShowBubble( aInfo, iContextField->MsgBubbleCtrl()->Rect() ); |
44 | 356 |
} |
357 |
else |
|
358 |
{ |
|
359 |
iContextField->HideBubble(); |
|
360 |
} |
|
361 |
} |
|
362 |
||
363 |
// --------------------------------------------------------------------------- |
|
364 |
// get strokes from hwr writing box. |
|
365 |
// --------------------------------------------------------------------------- |
|
366 |
// |
|
367 |
const RArray<TPoint>& CPeninputFingerHwrArWnd::StrokeList() |
|
368 |
{ |
|
369 |
return iWritingBox->StrokeList(); |
|
370 |
} |
|
371 |
||
372 |
// --------------------------------------------------------------------------- |
|
373 |
// set end mark of hwr |
|
374 |
// --------------------------------------------------------------------------- |
|
375 |
// |
|
376 |
void CPeninputFingerHwrArWnd::SetStrokeEndMark( const TPoint& aEndMark ) |
|
377 |
{ |
|
378 |
iWritingBox->SetStrokeEndMark( aEndMark ); |
|
379 |
} |
|
380 |
||
381 |
// --------------------------------------------------------------------------- |
|
382 |
// set guide line on or off. |
|
383 |
// --------------------------------------------------------------------------- |
|
384 |
// |
|
385 |
void CPeninputFingerHwrArWnd::SetGuideLineOn(const TBool aGuideLineOn) |
|
386 |
{ |
|
387 |
iGuideLineOn = aGuideLineOn; |
|
388 |
DrawGuideLine(); |
|
389 |
} |
|
390 |
||
391 |
// --------------------------------------------------------------------------- |
|
392 |
// set pen color of hwr writing. |
|
393 |
// --------------------------------------------------------------------------- |
|
394 |
// |
|
395 |
void CPeninputFingerHwrArWnd::SetBoxPenColor( const TInt aPenColor ) |
|
396 |
{ |
|
397 |
iWritingBox->SetPenColor( aPenColor ); |
|
398 |
} |
|
399 |
||
400 |
// --------------------------------------------------------------------------- |
|
401 |
// set pen size of hwr writing. |
|
402 |
// --------------------------------------------------------------------------- |
|
403 |
// |
|
404 |
void CPeninputFingerHwrArWnd::SetBoxPenSize( const TSize aPenSize ) |
|
405 |
{ |
|
406 |
iWritingBox->SetPenSize( aPenSize ); |
|
407 |
} |
|
408 |
||
409 |
// --------------------------------------------------------------------------- |
|
410 |
// set writing speed hwr writing. |
|
411 |
// --------------------------------------------------------------------------- |
|
412 |
// |
|
413 |
void CPeninputFingerHwrArWnd::SetBoxWritingSpeed( TTimeIntervalMicroSeconds32& aCharDelay ) |
|
414 |
{ |
|
415 |
iWritingBox->SetCharacterDelay( aCharDelay ); |
|
416 |
TInt strokeDelay = aCharDelay.Int()/5; |
|
417 |
TTimeIntervalMicroSeconds32 sDelay(strokeDelay); |
|
418 |
iWritingBox->SetStrokeDelay( sDelay); |
|
419 |
} |
|
420 |
||
421 |
// --------------------------------------------------------------------------- |
|
422 |
// retrieve rect of hwr writingbox. |
|
423 |
// --------------------------------------------------------------------------- |
|
424 |
// |
|
425 |
TRect CPeninputFingerHwrArWnd::WritingBoxRect() |
|
426 |
{ |
|
427 |
return iWritingBox->Rect(); |
|
428 |
} |
|
429 |
||
430 |
||
431 |
// --------------------------------------------------------------------------- |
|
432 |
// Cancel wrting |
|
433 |
// --------------------------------------------------------------------------- |
|
434 |
// |
|
435 |
void CPeninputFingerHwrArWnd::CancelWriting() |
|
436 |
{ |
|
437 |
iWritingBox->CancelCharWriting(); |
|
438 |
} |
|
439 |
||
440 |
// --------------------------------------------------------------------------- |
|
441 |
// Change SCT page. |
|
442 |
// --------------------------------------------------------------------------- |
|
443 |
// |
|
444 |
void CPeninputFingerHwrArWnd::ShowSymbolPage( TInt aPageNo, TInt aPos ) |
|
445 |
{ |
|
446 |
iSymbolTable->NavigatePage(aPageNo,aPos); |
|
447 |
} |
|
448 |
||
449 |
// --------------------------------------------------------------------------- |
|
450 |
// retrieve the ICF control. |
|
451 |
// --------------------------------------------------------------------------- |
|
452 |
// |
|
453 |
CFepLayoutMultiLineIcf* CPeninputFingerHwrArWnd::Icf() |
|
454 |
{ |
|
455 |
return iContextField; |
|
456 |
} |
|
457 |
||
458 |
||
459 |
// --------------------------------------------------------------------------- |
|
460 |
// retrieve the candicate list control. |
|
461 |
// --------------------------------------------------------------------------- |
|
462 |
// |
|
463 |
CFepCtrlDropdownList* CPeninputFingerHwrArWnd::CandidateList() |
|
464 |
{ |
|
465 |
return iCandidateList; |
|
466 |
} |
|
467 |
||
468 |
// --------------------------------------------------------------------------- |
|
469 |
// Open the candidate list |
|
470 |
// --------------------------------------------------------------------------- |
|
471 |
// |
|
472 |
void CPeninputFingerHwrArWnd::OpenCandidateList() |
|
473 |
{ |
|
474 |
CPeninputFingerHwrArLayout* hwrLayout = NULL; |
|
475 |
hwrLayout = static_cast<CPeninputFingerHwrArLayout*>( UiLayout() ); |
|
476 |
CPeninputFingerHwrArDataStore& datastore = hwrLayout->DataStore(); |
|
477 |
||
478 |
const RPointerArray<HBufC>& candidates = datastore.Candidate(); |
|
479 |
||
480 |
if(candidates.Count() > 0) |
|
481 |
{ |
|
482 |
CFepCtrlDropdownList::TListType unexpandable = CFepCtrlDropdownList::EListExpandableMultiRowWithoutIconWithBubble; |
|
483 |
||
484 |
iCandidateList->Hide( EFalse ); |
|
485 |
TRAP_IGNORE(iCandidateList->SetCandidatesL( candidates, unexpandable )); |
|
486 |
iCandidateList->SetHighlightCell( 0, datastore.Highlight() ); |
|
487 |
iArrowLeftBtn->Hide(ETrue); |
|
488 |
iArrowRightBtn->Hide(ETrue); |
|
489 |
iSpaceBtn->Hide(ETrue); |
|
490 |
iEnterBtn->Hide(ETrue); |
|
491 |
} |
|
492 |
} |
|
493 |
||
494 |
// --------------------------------------------------------------------------- |
|
495 |
// Close the candidate list |
|
496 |
// --------------------------------------------------------------------------- |
|
497 |
// |
|
498 |
void CPeninputFingerHwrArWnd::CloseCandidateList() |
|
499 |
{ |
|
500 |
iCandidateList->ResetAndClear(CFepCtrlDropdownList::EListExpandableMultiRowWithoutIconWithBubble); |
|
501 |
// hide all the dropdown list in standby state |
|
502 |
iCandidateList->Hide( ETrue ); |
|
503 |
iArrowLeftBtn->Hide(EFalse); |
|
504 |
iArrowRightBtn->Hide(EFalse); |
|
505 |
iSpaceBtn->Hide(EFalse); |
|
506 |
iEnterBtn->Hide(EFalse); |
|
507 |
} |
|
508 |
||
509 |
// --------------------------------------------------------------------------- |
|
510 |
// dim arrow buttons. |
|
511 |
// --------------------------------------------------------------------------- |
|
512 |
// |
|
513 |
void CPeninputFingerHwrArWnd::DimArrowKeys( TBool aDimArrow ) |
|
514 |
{ |
|
515 |
iArrowLeftBtn->SetDimmed( aDimArrow ); |
|
516 |
iArrowRightBtn->SetDimmed( aDimArrow ); |
|
517 |
iSpaceBtn->SetDimmed( aDimArrow ); |
|
518 |
iEnterBtn->SetDimmed( aDimArrow ); |
|
519 |
} |
|
520 |
||
521 |
// --------------------------------------------------------------------------- |
|
522 |
// c++ constructor |
|
523 |
// --------------------------------------------------------------------------- |
|
524 |
// |
|
525 |
CPeninputFingerHwrArWnd::CPeninputFingerHwrArWnd( |
|
526 |
CFepUiLayout* aFepUiLayout, TInt aControlId ) |
|
527 |
: CControlGroup( aFepUiLayout,aControlId ), iFirstTimeConstruct( ETrue ) |
|
528 |
{ |
|
529 |
} |
|
530 |
||
531 |
// --------------------------------------------------------------------------- |
|
532 |
// Symbian second-phase constructor |
|
533 |
// --------------------------------------------------------------------------- |
|
534 |
// |
|
535 |
void CPeninputFingerHwrArWnd::ConstructL( TBool /*aLandscapeStyle*/ ) |
|
536 |
{ |
|
537 |
BaseConstructL(); |
|
538 |
||
539 |
iLafManager = CPeninputFingerHwrArLafManager::NewL(); |
|
540 |
iLafManager->ReadLafInfo(); |
|
541 |
||
542 |
//crate writing |
|
543 |
CreateWritingBoxL(); |
|
544 |
||
545 |
//create the handwriting indicator |
|
546 |
iHandwritingIndicator = CPeninputArabicFingerHwrIndicator::NewL(UiLayout(),EHwrCtrlIdHandwringIndicator); |
|
547 |
iWritingBox->InstallIndicator(iHandwritingIndicator); |
|
548 |
iWritingBox->ShowIndicator(ETrue); |
|
549 |
||
550 |
//create icf |
|
551 |
CreateContextFieldL(); |
|
552 |
||
553 |
//create candidate lists |
|
554 |
CreateCandidateListL(); |
|
555 |
||
556 |
//create virtual sct pad |
|
557 |
CreateSymbolTableL(); |
|
558 |
||
559 |
//create number mode virtual sct pad |
|
560 |
CreateNumSymbolTableL(); |
|
561 |
||
562 |
//create control buttons |
|
563 |
CreateButtonsL(); |
|
564 |
||
565 |
//set controls postion and extent |
|
566 |
SizeChangedL(); |
|
567 |
||
568 |
#ifdef RD_TACTILE_FEEDBACK |
|
569 |
if (UiLayout()->SupportTactileFeedback()) |
|
570 |
{ |
|
571 |
UiLayout()->RegisterFeedbackArea(reinterpret_cast<TInt>(iWritingBox), |
|
572 |
iWritingBox->Rect(), |
|
573 |
iWritingBox->TactileFeedbackType()); |
|
574 |
} |
|
575 |
#endif |
|
576 |
||
577 |
//switch to standby view |
|
578 |
SwitchToStandbyView(); |
|
579 |
} |
|
580 |
||
581 |
// --------------------------------------------------------------------------- |
|
582 |
// create icf. |
|
583 |
// --------------------------------------------------------------------------- |
|
584 |
// |
|
585 |
void CPeninputFingerHwrArWnd::CreateContextFieldL() |
|
586 |
{ |
|
587 |
const CFont* icffont =iLafManager->IcfFont(); |
|
588 |
||
589 |
iContextField = CFepLayoutMultiLineIcf::NewL( |
|
590 |
iLafManager->IcfRect(), |
|
591 |
UiLayout(), |
|
592 |
EHwrCtrlIdInputContextField, |
|
593 |
icffont->HeightInPixels(), |
|
594 |
icffont->FontMaxHeight(), |
|
595 |
icffont ); |
|
596 |
||
597 |
iContextField->SetTextMargin ( iLafManager->IcfLeftMargin(), |
|
598 |
iLafManager->IcfRightMargin(), |
|
599 |
iLafManager->IcfTopMargin(), |
|
600 |
iLafManager->IcfBottomMargin() ); |
|
601 |
||
602 |
iContextField->SetLineSpace( iLafManager->IcfLineSpaceMargin() ); |
|
603 |
||
604 |
iContextField->SizeChangedL( iLafManager->IcfRect(), |
|
605 |
iLafManager->IcfTextHeight(), |
|
606 |
iLafManager->IcfFont()->FontMaxHeight(), |
|
607 |
iLafManager->IcfFont() ); |
|
608 |
||
609 |
TAknWindowLineLayout bubbleLineLayout = AknLayoutScalable_Apps::popup_char_count_window().LayoutLine(); |
|
610 |
TAknTextLineLayout bubbleTextLayout = AknLayoutScalable_Apps::popup_char_count_window_t1( 0 ).LayoutLine(); |
|
611 |
||
612 |
iContextField->MsgBubbleCtrl()->SetTextFormat( bubbleTextLayout ); |
|
613 |
iContextField->MsgBubbleCtrl()->SetTextColorIndex( EAknsCIQsnTextColorsCG67 ); |
|
614 |
||
615 |
//Change the ID when ID into release |
|
616 |
iContextField->MsgBubbleCtrl()->SetBitmapParam( NULL, |
|
617 |
NULL, |
|
618 |
KAknsIIDQsnFrInputPreviewSideL, |
|
619 |
KAknsIIDQsnFrInputPreviewMiddle, |
|
620 |
KAknsIIDQsnFrInputPreviewSideR ); |
|
621 |
iContextField->SetMsgBubbleCtrlSize( TSize( bubbleLineLayout.iW,bubbleLineLayout.iH ) ); |
|
622 |
||
623 |
iContextField->SetLineSeparatorAfterPrompt(ETrue); |
|
624 |
||
625 |
//transfer to headerPane |
|
626 |
AddControlL( iContextField ); |
|
627 |
||
628 |
//add layout as event observer |
|
629 |
iContextField->AddEventObserver( UiLayout() ); |
|
630 |
iContextField->SetFocus(); |
|
631 |
||
632 |
} |
|
633 |
||
634 |
// --------------------------------------------------------------------------- |
|
635 |
// create candidate lists. |
|
636 |
// --------------------------------------------------------------------------- |
|
637 |
// |
|
638 |
void CPeninputFingerHwrArWnd::CreateCandidateListL() |
|
639 |
{ |
|
640 |
TDropdownListDrawInfo candiDrawInfo( |
|
641 |
KAknsIIDQsnFrFunctionButtonInactive, |
|
642 |
KAknsIIDQsnFrFunctionButtonNormal, |
|
643 |
KAknsIIDQsnFrFunctionButtonPressed, |
|
644 |
KAknsIIDQsnFrItutButtonCandiSideL, |
|
645 |
KAknsIIDQsnFrItutButtonCandiMiddle, |
|
646 |
KAknsIIDQsnFrItutButtonCandiSideR, |
|
647 |
KAknsIIDQsnFrItutButtonCandiPressedSideL, |
|
648 |
KAknsIIDQsnFrItutButtonCandiPressedMiddle, |
|
649 |
KAknsIIDQsnFrItutButtonCandiPressedSideR, |
|
650 |
TRgb( 194, 221, 242 ), |
|
651 |
ETrue ); |
|
652 |
||
653 |
TInt unitWidth = iLafManager->CandidateUnitWidth(); |
|
654 |
TInt unitHeight = iLafManager->CandidateUnitHeight(); |
|
655 |
TPoint ltPosition = iLafManager->CandidateLTPos(); |
|
656 |
const CFont *font = iLafManager->CandidateFont(); |
|
657 |
iCandidateList = CFepCtrlDropdownList::NewL(UiLayout(), |
|
658 |
EHwrCtrlIdCandidateList, |
|
659 |
R_FSHWR_CANDIDATE_DROP_DOWN_LIST, |
|
660 |
ltPosition, |
|
661 |
font , |
|
662 |
TSize(unitWidth,unitHeight), |
|
663 |
unitWidth, |
|
664 |
3,2, |
|
665 |
unitHeight, |
|
666 |
0, |
|
667 |
0, |
|
668 |
CFepCtrlDropdownList::ECandFromRToL, |
|
669 |
EFalse); |
|
670 |
AddControlL( iCandidateList ); |
|
671 |
||
672 |
TInt horizontalMargin = iLafManager->CandidateHorizontalMargin(); |
|
673 |
TInt verticalMargin = iLafManager->CandidateVerticalMargin(); |
|
674 |
iCandidateList->SetCellMargin( horizontalMargin, verticalMargin ); |
|
675 |
iCandidateList->SetFont( font ); |
|
676 |
||
677 |
// set the needed events |
|
678 |
iCandidateList->SetEventIdForCandidateSelected( EHwrEventCandidateSelected ); |
|
679 |
iCandidateList->AddEventObserver( UiLayout() ); |
|
680 |
||
681 |
// hide the candidate list |
|
682 |
iCandidateList->Hide( ETrue ); |
|
683 |
iCandidateList->SetDropdownListImgID( candiDrawInfo ); |
|
684 |
} |
|
685 |
||
686 |
// --------------------------------------------------------------------------- |
|
687 |
// create writing box. |
|
688 |
// --------------------------------------------------------------------------- |
|
689 |
// |
|
690 |
void CPeninputFingerHwrArWnd::CreateWritingBoxL() |
|
691 |
{ |
|
692 |
iWritingBox = CPeninputArabicFingerHwrWritingWnd::NewL( TRect( 0,0,0,0 ), UiLayout(), |
|
693 |
EHwrCtrlIdWritingBox, EFalse ); |
|
694 |
||
695 |
AddControlL( iWritingBox ); |
|
696 |
||
697 |
||
698 |
//set it to window |
|
699 |
iWritingBox->SetStrokeEndMark( TPoint( -1,0 ) ); |
|
700 |
iWritingBox->AddEventObserver( UiLayout() ); |
|
701 |
iWritingBox->EnableTraceOutsideWindow( EFalse ); |
|
702 |
iWritingBox->SetWndTransparencyFactor( 0 ); |
|
703 |
iWritingBox->InstallPenTraceDecoratorL( KNullDesC,EFalse); |
|
704 |
} |
|
705 |
||
706 |
// --------------------------------------------------------------------------- |
|
707 |
// create all function buttons. |
|
708 |
// --------------------------------------------------------------------------- |
|
709 |
// |
|
710 |
void CPeninputFingerHwrArWnd::CreateButtonsL() |
|
711 |
{ |
|
712 |
iCloseBtn = CreateEventBtnL( EHwrCtrlIdClose, R_AKN_FEP_HWR_CLOSE ); |
|
713 |
iOptionBtn = CreateEventBtnL( EHwrCtrlIdLanguageOption, R_AKN_FEP_HWR_OPTION ); |
|
714 |
||
715 |
iBackspaceBtn = CreateRepBtnL( EHwrCtrlIdBackspace, R_AKN_FEP_HWR_BACK_SPACE, |
|
716 |
EHwrEventKeyBack, EKeyBackspace ); |
|
717 |
||
718 |
iArrowLeftBtn = CreateRepBtnL( EHwrCtrlIdArrowLeft, R_AKN_FEP_HWR_ARROWLEFT, |
|
719 |
EHwrEventNavKeyClicked, EKeyLeftArrow ); |
|
720 |
iArrowRightBtn = CreateRepBtnL( EHwrCtrlIdArrowRight, R_AKN_FEP_HWR_ARROWRIGHT, |
|
721 |
EHwrEventNavKeyClicked, EKeyRightArrow ); |
|
722 |
iEnterBtn = CreateEventBtnL(EHwrCtrlIdBtnEnter,R_AKN_FEP_HWR_ENTER); |
|
723 |
iSpaceBtn = CreateEventBtnL(EHwrCtrlIdBtnSpace,R_AKN_FEP_HWR_SPACE); |
|
724 |
// Create 3-pieces color icon for space button |
|
725 |
CPenInput3PiecesColorIcons* colorIcons = |
|
726 |
CPenInput3PiecesColorIcons::NewL( R_AKN_FEP_VKB_SPACE_ICON1, |
|
727 |
R_AKN_FEP_VKB_SPACE_ICON2, |
|
728 |
R_AKN_FEP_VKB_SPACE_ICON3 ); |
|
729 |
iSpaceBtn->Set3PiecesColorIcons( colorIcons ); |
|
730 |
iSymbolTableBtn = CreateEventBtnL( EHwrCtrlIdSymbolButton, R_AKN_FEP_HWR_SYMBOL_TABLE_BUTTON ); |
|
731 |
} |
|
732 |
||
733 |
// --------------------------------------------------------------------------- |
|
734 |
// create virtual sct pad. |
|
735 |
// --------------------------------------------------------------------------- |
|
736 |
// |
|
737 |
void CPeninputFingerHwrArWnd::CreateSymbolTableL() |
|
738 |
{ |
|
739 |
iSymbolTable = CPeninputArabicFingerHwrSymbolTable::NewL(UiLayout(),EHwrCtrlIdSymbolTableVkbGroup); |
|
740 |
iSymbolTable->Hide(ETrue); |
|
741 |
iSymbolTable->SetResourceId(R_FINGERHWR_ARABIC_SYMBOLTABLE); |
|
742 |
iSymbolTable->ConstructFromResourceL(); |
|
743 |
AddControlL( iSymbolTable ); |
|
744 |
iSymbolTable->AddEventObserver( UiLayout() ); |
|
745 |
} |
|
746 |
||
747 |
// --------------------------------------------------------------------------- |
|
748 |
// create virtual number mode sct pad. |
|
749 |
// --------------------------------------------------------------------------- |
|
750 |
// |
|
751 |
void CPeninputFingerHwrArWnd::CreateNumSymbolTableL() |
|
752 |
{ |
|
753 |
iNumSymbolTable = CPeninputArabicFingerHwrNumSymbolTable::NewL(UiLayout(),EHwrCtrlIdNumSymbolTableVkbGroup); |
|
754 |
iNumSymbolTable->Hide(ETrue); |
|
755 |
iNumSymbolTable->SetResourceId(R_FINGERHWR_ARABIC_NUMBERTABLE); |
|
756 |
iNumSymbolTable->ConstructFromResourceL(); |
|
757 |
AddControlL( iNumSymbolTable ); |
|
758 |
iNumSymbolTable->AddEventObserver( UiLayout() ); |
|
759 |
} |
|
760 |
||
761 |
// --------------------------------------------------------------------------- |
|
762 |
// EventButton creation helper. |
|
763 |
// --------------------------------------------------------------------------- |
|
764 |
// |
|
765 |
CAknFepCtrlEventButton* CPeninputFingerHwrArWnd::CreateEventBtnL( TInt aCtrlId, |
|
766 |
TInt32 aResId, TInt aEvent/*= 0xFFFF*/,TInt aUnicode/*=0*/ ) |
|
767 |
{ |
|
768 |
CAknFepCtrlEventButton* button = CAknFepCtrlEventButton::NewL( |
|
769 |
UiLayout(), aCtrlId, aEvent, aUnicode, |
|
770 |
KAknsIIDQsnFrFunctionButtonNormal, |
|
771 |
KAknsIIDQsnFrFunctionButtonPressed, |
|
772 |
KAknsIIDQsnFrFunctionButtonInactive ); |
|
773 |
||
774 |
button->SetResourceId( aResId ); |
|
775 |
button->ConstructFromResourceL(); |
|
776 |
button->AddEventObserver( UiLayout() ); |
|
777 |
AddControlL( button ); |
|
778 |
return button; |
|
779 |
} |
|
780 |
||
781 |
// --------------------------------------------------------------------------- |
|
782 |
// RepeatButton creation helper. |
|
783 |
// --------------------------------------------------------------------------- |
|
784 |
// |
|
785 |
CAknFepCtrlRepeatButton* CPeninputFingerHwrArWnd::CreateRepBtnL( const TInt aCtrlId, |
|
786 |
TInt32 aResId, const TInt aEvent, const TInt aUnicode ) |
|
787 |
{ |
|
788 |
CAknFepCtrlRepeatButton* button = CAknFepCtrlRepeatButton::NewL( |
|
789 |
UiLayout(), aCtrlId, aEvent, aUnicode, |
|
790 |
KAknsIIDQsnFrFunctionButtonNormal, |
|
791 |
KAknsIIDQsnFrFunctionButtonPressed, |
|
792 |
KAknsIIDQsnFrFunctionButtonInactive ); |
|
793 |
||
794 |
button->SetResourceId( aResId ); |
|
795 |
button->ConstructFromResourceL( ); |
|
796 |
button->AddEventObserver( UiLayout() ); |
|
797 |
AddControlL( button ); |
|
798 |
||
799 |
return button; |
|
800 |
} |
|
801 |
||
802 |
// --------------------------------------------------------------------------- |
|
803 |
// load virtual sct keys. |
|
804 |
// --------------------------------------------------------------------------- |
|
805 |
// |
|
806 |
void CPeninputFingerHwrArWnd::LoadSymbolVirtualKeysL( const TInt aResId, |
|
807 |
const RArray<TRect>& aCellRects ) |
|
808 |
{ |
|
809 |
TAknTextLineLayout txtlayout = iLafManager->SctpadKeyTxtLayout(); |
|
810 |
iSymbolTable->KeyPad()->SetTextLineLayout( txtlayout ); |
|
811 |
||
812 |
TInt fontid = txtlayout.FontId(); |
|
813 |
const CFont* font = AknLayoutUtils::FontFromId( fontid ); |
|
814 |
iSymbolTable->KeyPad()->SetFont( font ); |
|
815 |
||
816 |
iSymbolTable->LoadVirtualKeypadKeyL(aResId,aCellRects); |
|
817 |
} |
|
818 |
||
819 |
// --------------------------------------------------------------------------- |
|
820 |
// load virtual number mode sct keys. |
|
821 |
// --------------------------------------------------------------------------- |
|
822 |
// |
|
823 |
void CPeninputFingerHwrArWnd::LoadNumSymbolVirtualKeysL( const TInt aResId, |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
824 |
const RArray<TRect>& aCellRects ) |
44 | 825 |
{ |
826 |
TAknTextLineLayout txtlayout = iLafManager->NumpadKeyTxtLayout(); |
|
827 |
iNumSymbolTable->KeyPad()->SetTextLineLayout( txtlayout ); |
|
828 |
||
829 |
TInt fontid = txtlayout.FontId(); |
|
830 |
const CFont* font = AknLayoutUtils::FontFromId( fontid ); |
|
831 |
iNumSymbolTable->KeyPad()->SetFont( font ); |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
832 |
|
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
833 |
iNumSymbolTable->LoadVirtualKeypadKeyL(aResId,aCellRects); |
44 | 834 |
} |
835 |
||
836 |
// --------------------------------------------------------------------------- |
|
837 |
// relayout full ui, reset all controls position. |
|
838 |
// --------------------------------------------------------------------------- |
|
839 |
// |
|
840 |
void CPeninputFingerHwrArWnd::ResetLayoutL() |
|
841 |
{ |
|
842 |
TRect rcScreen = iLafManager->LayoutRect(); |
|
843 |
SetRect( rcScreen ); |
|
844 |
||
845 |
TRect rect; |
|
846 |
||
847 |
//Move ICF |
|
848 |
rect = iLafManager->CtrlRect( iContextField->ControlId() ); |
|
849 |
iContextField->SetRect( rect ); |
|
850 |
||
851 |
//Move Writing box |
|
852 |
rect = iLafManager->CtrlRect( iWritingBox->ControlId() ); |
|
853 |
iWritingBox->SetRect( rect ); |
|
854 |
||
855 |
//resize indicator |
|
856 |
iHandwritingIndicator->ConstructFromResourceL(R_AKN_FEP_HWR_INDICATOR_ICON); |
|
857 |
iHandwritingIndicator->SizeChanged(iLafManager->GetIndicatorRect(),ETrue); |
|
858 |
||
859 |
//Move buttons |
|
860 |
TSize siBtnPadding = iLafManager->ButtonInnerPadding(); |
|
861 |
TInt pdx = siBtnPadding.iWidth; |
|
862 |
TInt pdy = siBtnPadding.iHeight; |
|
863 |
||
864 |
rect = iLafManager->CtrlRect( iCloseBtn->ControlId() ); |
|
865 |
MoveIconButton( iCloseBtn, rect, pdx, pdy, ETrue ); |
|
866 |
||
867 |
rect = iLafManager->CtrlRect( iSymbolTableBtn->ControlId() ); |
|
868 |
MoveIconButton( iSymbolTableBtn, rect, pdx, pdy, ETrue ); |
|
869 |
||
870 |
rect = iLafManager->CtrlRect( iBackspaceBtn->ControlId() ); |
|
871 |
MoveIconButton( iBackspaceBtn, rect, pdx, pdy, ETrue ); |
|
872 |
||
873 |
rect = iLafManager->CtrlRect( iOptionBtn->ControlId() ); |
|
874 |
MoveIconButton( iOptionBtn, rect, pdx, pdy, ETrue ); |
|
875 |
||
876 |
pdx = iLafManager->GetArrowPaddingSize().iWidth; |
|
877 |
pdy = iLafManager->GetArrowPaddingSize().iHeight; |
|
878 |
||
879 |
rect = iLafManager->CtrlRect( iArrowLeftBtn->ControlId() ); |
|
880 |
MoveIconButton( iArrowLeftBtn, rect, pdx, pdy, ETrue ); |
|
881 |
||
882 |
rect = iLafManager->CtrlRect( iArrowRightBtn->ControlId() ); |
|
883 |
MoveIconButton( iArrowRightBtn, rect, pdx, pdy, ETrue ); |
|
884 |
||
885 |
rect = iLafManager->CtrlRect( iSpaceBtn->ControlId() ); |
|
886 |
MoveIconButton( iSpaceBtn, rect, pdx, pdy, ETrue ); |
|
887 |
||
888 |
TRect pieceInnerRect = rect; |
|
889 |
pieceInnerRect.Shrink(pdx*2,pdy); |
|
890 |
||
891 |
// that's a not good algrithm in funciton AknPenInputDrawUtils::Draw3PiecesColorIcon for drawing 3Pieces icons |
|
892 |
// as when the outter rect's height was not equal to the inter rect's height, the target rects the left icons and right icons |
|
893 |
// would be bitblited onto are set to be Rect(0.0.0.0.0) [[which should not be that behavior]]. |
|
894 |
// Please theck the codes: AknPenInputDrawUtils::Draw3PiecesColorIcon: this function should be Updated. |
|
895 |
iSpaceBtn->SetDraw3PieceFrameInfo( |
|
896 |
TDraw3PiecesFrame(KAknsIIDQgnIndiInputSpaceL, |
|
897 |
KAknsIIDQgnIndiInputSpaceMiddle, |
|
898 |
KAknsIIDQgnIndiInputSpaceR, |
|
899 |
pieceInnerRect)); |
|
900 |
||
901 |
rect = iLafManager->CtrlRect( iEnterBtn->ControlId() ); |
|
902 |
MoveIconButton( iEnterBtn, rect, pdx, pdy, ETrue ); |
|
903 |
||
904 |
// load vkb key image |
|
905 |
TSize keysize = iLafManager->VirtualSctpadCellSize().Size(); |
|
906 |
iSymbolTable->LoadVkbKeyImageL(R_FINGER_HWR_SCTPAD_IMAGE, keysize ); |
|
907 |
||
908 |
// get the key rect |
|
909 |
RArray<TRect> rects; |
|
910 |
CleanupClosePushL( rects ); |
|
911 |
iLafManager->GetVirtualKeyRects( rects ); |
|
912 |
||
913 |
// load keys |
|
914 |
if(iLafManager->IsLandscape()) |
|
915 |
{ |
|
916 |
LoadSymbolVirtualKeysL(R_ARABIC_FINGER_HWR_LANDSCAPE_SYMBOL_TABLE, rects); |
|
917 |
} |
|
918 |
else |
|
919 |
{ |
|
920 |
LoadSymbolVirtualKeysL(R_ARABIC_FINGER_HWR_PORTRAIT_SYMBOL_TABLE, rects); |
|
921 |
} |
|
922 |
||
923 |
CleanupStack::PopAndDestroy();//rects |
|
924 |
||
925 |
//move virtual Sctpad |
|
926 |
TInt rows = iLafManager->VirtualSctpadRowCount(); |
|
927 |
TInt cols = iLafManager->VirtualSctpadColCount(); |
|
928 |
||
929 |
rect = iLafManager->CtrlRect(iSymbolTable->ControlId()); |
|
930 |
iSymbolTable->SetRect(rect); |
|
931 |
||
932 |
iSymbolTable->SizeChanged(iLafManager->GetVirtualKeyRect(), |
|
933 |
iLafManager->GetSymBtnArray(), rows, cols, |
|
934 |
iLafManager->IsLandscape()); |
|
935 |
//number mode symbol table |
|
936 |
// load number mode vkb key image |
|
937 |
TSize numkeysize = iLafManager->VirtualNumpadCellSize().Size(); |
|
938 |
iNumSymbolTable->LoadVkbKeyImageL(R_FINGER_HWR_NUMPAD_IMAGE, numkeysize ); |
|
939 |
||
940 |
// get the key rect |
|
941 |
RArray<TRect> numrects; |
|
942 |
CleanupClosePushL( numrects ); |
|
943 |
iLafManager->GetNumVirtualKeyRects( numrects ); |
|
944 |
||
945 |
// load keys |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
946 |
LoadNumSymbolVirtualKeysL(R_FINGER_HWR_NUMPAD, numrects); |
44 | 947 |
|
948 |
CleanupStack::PopAndDestroy();//rects |
|
949 |
||
950 |
//move virtual Sctpad |
|
951 |
TInt numpadrows = iLafManager->VirtualNumSctpadRowCount(); |
|
952 |
TInt numpadcols = iLafManager->VirtualNumSctpadColCount(); |
|
953 |
||
954 |
rect = iLafManager->CtrlRect(iNumSymbolTable->ControlId()); |
|
955 |
iNumSymbolTable->SetRect(rect); |
|
956 |
||
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
957 |
iNumSymbolTable->SizeChanged(iLafManager->GetVirtualNumKeyRect(), |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
958 |
iLafManager->GetSymBtnArray(), numpadrows, numpadcols, |
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
959 |
iLafManager->IsLandscape()); |
44 | 960 |
} |
961 |
||
962 |
||
963 |
// --------------------------------------------------------------------------- |
|
964 |
// layout for chinese range standby. |
|
965 |
// --------------------------------------------------------------------------- |
|
966 |
// |
|
967 |
void CPeninputFingerHwrArWnd::SwitchToStandbyView() |
|
968 |
{ |
|
969 |
// hide following controls |
|
970 |
iCandidateList->Hide( ETrue ); |
|
971 |
iSymbolTable->Hide( ETrue); |
|
972 |
iNumSymbolTable->Hide(ETrue); |
|
973 |
||
974 |
// show following controls |
|
975 |
iArrowLeftBtn->Hide( EFalse ); |
|
976 |
iArrowRightBtn->Hide( EFalse ); |
|
977 |
iSpaceBtn->Hide( EFalse ); |
|
978 |
iEnterBtn->Hide( EFalse ); |
|
979 |
iOptionBtn->Hide( EFalse ); |
|
980 |
iSymbolTableBtn->SetHighlight( EFalse); |
|
981 |
iContextField->SetReady(ETrue); |
|
982 |
Draw(); |
|
983 |
} |
|
984 |
||
985 |
// --------------------------------------------------------------------------- |
|
986 |
// layout for symbol range standby. |
|
987 |
// --------------------------------------------------------------------------- |
|
988 |
// |
|
989 |
void CPeninputFingerHwrArWnd::SwitchToSymbolTableView() |
|
990 |
{ |
|
991 |
CPeninputFingerHwrArLayout* hwrLayout = NULL; |
|
992 |
hwrLayout = static_cast<CPeninputFingerHwrArLayout*>( UiLayout() ); |
|
993 |
CPeninputFingerHwrArDataStore& datastore = hwrLayout->DataStore(); |
|
994 |
TBool IsNumberOnly = datastore.IsNumberOnlyMode(); |
|
995 |
// show following controls |
|
996 |
iWritingBox->Hide( EFalse ); |
|
997 |
if(IsNumberOnly) |
|
998 |
{ |
|
999 |
iSymbolTable->Hide( ETrue ); |
|
1000 |
iNumSymbolTable->Hide(EFalse); |
|
1001 |
} |
|
1002 |
else |
|
1003 |
{ |
|
1004 |
iSymbolTable->Hide( EFalse ); |
|
1005 |
iNumSymbolTable->Hide(ETrue); |
|
1006 |
} |
|
1007 |
iOptionBtn->Hide( EFalse ); |
|
1008 |
||
1009 |
// hide follwing controls |
|
1010 |
iCandidateList->Hide( ETrue ); |
|
1011 |
iArrowLeftBtn->Hide( ETrue ); |
|
1012 |
iArrowRightBtn->Hide( ETrue ); |
|
1013 |
iSpaceBtn->Hide( ETrue ); |
|
1014 |
iEnterBtn->Hide( ETrue ); |
|
1015 |
||
1016 |
// set the symboltable button highlighted |
|
1017 |
iSymbolTableBtn->SetHighlight( ETrue ); |
|
1018 |
||
1019 |
// avoid overlap refresh problem after opening symbil table |
|
1020 |
// so set this control to be not ready |
|
1021 |
iContextField->SetReady(EFalse); |
|
1022 |
||
1023 |
if(IsNumberOnly) |
|
1024 |
{ |
|
1025 |
iNumSymbolTable->OpenSymbolTable(); |
|
1026 |
iNumSymbolTable->BringToTop(); |
|
1027 |
} |
|
1028 |
else |
|
1029 |
{ |
|
1030 |
iSymbolTable->OpenSymbolTable(); |
|
1031 |
iSymbolTable->BringToTop(); |
|
1032 |
} |
|
1033 |
} |
|
1034 |
||
1035 |
||
1036 |
// --------------------------------------------------------------------------- |
|
1037 |
// EventButton layout helper. Move button to specified rect. |
|
1038 |
// --------------------------------------------------------------------------- |
|
1039 |
// |
|
1040 |
void CPeninputFingerHwrArWnd::MoveIconButton( CAknFepCtrlEventButton* aButton, |
|
1041 |
const TRect& aRect, TInt aXPadding, TInt aYPadding, TBool aReloadImages ) |
|
1042 |
{ |
|
1043 |
if ( !aButton ) |
|
1044 |
{ |
|
1045 |
return; |
|
1046 |
} |
|
1047 |
||
1048 |
aButton->SetRect( aRect ); |
|
1049 |
TRect rcInner = aRect; |
|
1050 |
if ( rcInner.Width()> rcInner.Height() ) |
|
1051 |
{ |
|
1052 |
TInt dx = ( rcInner.Width() - rcInner.Height() ) / 4; |
|
1053 |
rcInner.Move( dx, 0 ); |
|
1054 |
rcInner.SetWidth( rcInner.Height() + 2*dx); |
|
1055 |
} |
|
1056 |
else |
|
1057 |
{ |
|
1058 |
TInt dy = ( rcInner.Height() - rcInner.Width() ) / 4; |
|
1059 |
rcInner.Move( 0, dy ); |
|
1060 |
rcInner.SetHeight( rcInner.Width() + 2*dy); |
|
1061 |
} |
|
1062 |
rcInner.Shrink( aXPadding, aYPadding ); |
|
1063 |
if(aButton->ControlId() == EHwrCtrlIdBtnSpace) |
|
1064 |
{ |
|
1065 |
// config 3 pieces icon info |
|
1066 |
TRect middleIconRect = rcInner; |
|
1067 |
middleIconRect.Shrink(2,2); |
|
1068 |
( static_cast<CAknFepCtrlCommonButton*> (aButton) )->SetDraw3PieceFrameInfo( |
|
1069 |
TDraw3PiecesFrame(KAknsIIDQgnIndiInputSpaceL, |
|
1070 |
KAknsIIDQgnIndiInputSpaceMiddle, |
|
1071 |
KAknsIIDQgnIndiInputSpaceR, |
|
1072 |
middleIconRect)); |
|
1073 |
} |
|
1074 |
aButton->SizeChanged( aRect, rcInner, aReloadImages ); |
|
1075 |
} |
|
1076 |
||
1077 |
// --------------------------------------------------------------------------- |
|
1078 |
// Read control's shadow info. |
|
1079 |
// --------------------------------------------------------------------------- |
|
1080 |
// |
|
1081 |
void CPeninputFingerHwrArWnd::ReadShadowInfoL( const TInt aResId ) |
|
1082 |
{ |
|
1083 |
TResourceReader resReader; |
|
1084 |
CCoeEnv::Static()->CreateResourceReaderLC( resReader, aResId ); |
|
1085 |
||
1086 |
TPtrC bmpFileName = resReader.ReadTPtrC(); |
|
1087 |
TInt32 imgMajorSkinId = resReader.ReadInt32(); |
|
1088 |
||
1089 |
TAknsItemID id; |
|
1090 |
TInt skinitemid; |
|
1091 |
||
1092 |
MAknsSkinInstance* skininstance = AknsUtils::SkinInstance(); |
|
1093 |
||
1094 |
for ( TInt i = 0; i < KShadowBmpBr + 1; i++ ) |
|
1095 |
{ |
|
1096 |
const TInt16 bmpId = resReader.ReadInt16(); |
|
1097 |
const TInt16 bmpMskId = resReader.ReadInt16(); |
|
1098 |
skinitemid = resReader.ReadInt16(); |
|
1099 |
||
1100 |
id.Set( TInt( imgMajorSkinId ), skinitemid ); |
|
1101 |
||
1102 |
if ( bmpId != KInvalidImg ) |
|
1103 |
{ |
|
1104 |
CFbsBitmap* shadowImg = NULL; |
|
1105 |
CFbsBitmap* shadowMaskImg = NULL; |
|
1106 |
||
1107 |
if ( bmpMskId != KInvalidImg ) |
|
1108 |
{ |
|
1109 |
AknsUtils::CreateIconL( skininstance, |
|
1110 |
id, |
|
1111 |
shadowImg, |
|
1112 |
shadowMaskImg, |
|
1113 |
bmpFileName, |
|
1114 |
bmpId, |
|
1115 |
bmpMskId ); |
|
1116 |
} |
|
1117 |
else |
|
1118 |
{ |
|
1119 |
AknsUtils::CreateIconL( skininstance, |
|
1120 |
id, |
|
1121 |
shadowImg, |
|
1122 |
bmpFileName, |
|
1123 |
bmpId ); |
|
1124 |
} |
|
1125 |
||
1126 |
SetShadowBmp( shadowImg, shadowMaskImg, TShadowBitmapIndex( i ) ); |
|
1127 |
} |
|
1128 |
} |
|
1129 |
CleanupStack::PopAndDestroy( 1 ); // reader |
|
1130 |
||
1131 |
} |
|
1132 |
||
1133 |
// --------------------------------------------------------------------------- |
|
1134 |
// Read control's background info. |
|
1135 |
// --------------------------------------------------------------------------- |
|
1136 |
// |
|
1137 |
void CPeninputFingerHwrArWnd::ReadBackgroundInfoL( const TInt aResId ) |
|
1138 |
{ |
|
1139 |
if ( aResId == 0 ) |
|
1140 |
return; |
|
1141 |
||
1142 |
if ( BackgroundBmp() ) |
|
1143 |
{ |
|
1144 |
CFbsBitmap* bkBmp = BackgroundBmp(); |
|
1145 |
delete bkBmp; |
|
1146 |
SetBackgroundBmp( NULL ); |
|
1147 |
} |
|
1148 |
if ( BkMaskBmp() ) |
|
1149 |
{ |
|
1150 |
CFbsBitmap* bkMaskBmp = BkMaskBmp(); |
|
1151 |
delete bkMaskBmp; |
|
1152 |
SetBackgroundMaskBmp( NULL ); |
|
1153 |
} |
|
1154 |
||
1155 |
TResourceReader resReader; |
|
1156 |
CCoeEnv::Static()->CreateResourceReaderLC( resReader, aResId ); |
|
1157 |
||
1158 |
TPtrC bmpFileName = resReader.ReadTPtrC(); |
|
1159 |
TInt32 imgMajorSkinId = resReader.ReadInt32(); |
|
1160 |
||
1161 |
TAknsItemID id; |
|
1162 |
TInt skinitemid; |
|
1163 |
||
1164 |
MAknsSkinInstance* skininstance = AknsUtils::SkinInstance(); |
|
1165 |
const TInt16 bmpId = resReader.ReadInt16(); |
|
1166 |
const TInt16 bmpMskId = resReader.ReadInt16(); |
|
1167 |
skinitemid = resReader.ReadInt16(); |
|
1168 |
id.Set( TInt( imgMajorSkinId ), skinitemid ); |
|
1169 |
||
1170 |
if ( bmpId != KInvalidImg ) |
|
1171 |
{ |
|
1172 |
CFbsBitmap* backgroundImg = NULL; |
|
1173 |
CFbsBitmap* backgroundMaskImg = NULL; |
|
1174 |
if ( bmpMskId != KInvalidImg ) |
|
1175 |
{ |
|
1176 |
AknsUtils::CreateIconL( skininstance, id, backgroundImg, |
|
1177 |
backgroundMaskImg, bmpFileName, bmpId, bmpMskId ); |
|
1178 |
} |
|
1179 |
else |
|
1180 |
{ |
|
1181 |
AknsUtils::CreateIconL( skininstance, id, backgroundImg, |
|
1182 |
bmpFileName, bmpId ); |
|
1183 |
} |
|
1184 |
||
1185 |
SetBackgroundBmp( backgroundImg ); |
|
1186 |
SetBackgroundMaskBmp( backgroundMaskImg ); |
|
1187 |
} |
|
1188 |
CleanupStack::PopAndDestroy( 1 ); //reader |
|
1189 |
} |
|
1190 |
||
1191 |
// --------------------------------------------------------------------------- |
|
1192 |
// read icf appearance info. |
|
1193 |
// --------------------------------------------------------------------------- |
|
1194 |
// |
|
1195 |
void CPeninputFingerHwrArWnd::ReadICFInfoL( const TInt aResId ) |
|
1196 |
{ |
|
1197 |
if ( aResId == 0 ) |
|
1198 |
{ |
|
1199 |
return; |
|
1200 |
} |
|
1201 |
||
1202 |
TResourceReader icfreader; |
|
1203 |
CCoeEnv::Static()->CreateResourceReaderLC( icfreader, aResId ); |
|
1204 |
||
1205 |
TInt32 colorMajorSkinId = icfreader.ReadInt32(); |
|
1206 |
TInt skinitemid = icfreader.ReadInt16(); |
|
1207 |
TInt coloridx = icfreader.ReadInt16(); |
|
1208 |
||
1209 |
TAknsItemID colorid; |
|
1210 |
colorid.Set( TInt( colorMajorSkinId ), skinitemid ); |
|
1211 |
||
1212 |
TRgb icftextcolor; |
|
1213 |
MAknsSkinInstance* skininstance = AknsUtils::SkinInstance(); |
|
1214 |
TInt error = AknsUtils::GetCachedColor( skininstance, icftextcolor, |
|
1215 |
colorid, coloridx ); |
|
1216 |
||
1217 |
if ( error != KErrNone ) |
|
1218 |
{ |
|
1219 |
icftextcolor = TRgb( KDefaultTextColor ); |
|
1220 |
} |
|
1221 |
||
1222 |
iContextField->SetTextColorL( icftextcolor ); |
|
1223 |
||
1224 |
// Set highlight color |
|
1225 |
TRgb icfhightlightcolor; |
|
1226 |
error = AknsUtils::GetCachedColor( skininstance, |
|
1227 |
icfhightlightcolor, |
|
1228 |
KAknsIIDQsnHighlightColors, |
|
1229 |
EAknsCIQsnHighlightColorsCG2 ); |
|
1230 |
if ( error == KErrNone ) |
|
1231 |
{ |
|
1232 |
iContextField->SetTextSelColorL( icfhightlightcolor ); |
|
1233 |
} |
|
1234 |
||
1235 |
skinitemid = icfreader.ReadInt16(); |
|
1236 |
coloridx = icfreader.ReadInt16(); |
|
1237 |
||
1238 |
colorid.Set( TInt( colorMajorSkinId ), skinitemid ); |
|
1239 |
||
1240 |
TRgb icfframecolor; |
|
1241 |
error = AknsUtils::GetCachedColor( skininstance, icfframecolor, |
|
1242 |
colorid, coloridx ); |
|
1243 |
||
1244 |
if ( error != KErrNone ) |
|
1245 |
{ |
|
1246 |
icfframecolor = TRgb( KDefaultFrameColor ); |
|
1247 |
} |
|
1248 |
||
1249 |
iContextField->SetBorderColor( icfframecolor ); |
|
1250 |
iContextField->SetBgImgSkinId( KAknsIIDQgnGrafFepInputBg ); |
|
1251 |
CleanupStack::PopAndDestroy( 1 ); // icfreader |
|
1252 |
} |
|
1253 |
||
1254 |
// --------------------------------------------------------------------------- |
|
1255 |
// read writingbox appearance info. |
|
1256 |
// --------------------------------------------------------------------------- |
|
1257 |
// |
|
1258 |
void CPeninputFingerHwrArWnd::ReadWritingBoxInfoL( const TInt aResId ) |
|
1259 |
{ |
|
1260 |
if ( aResId == 0 ) |
|
1261 |
{ |
|
1262 |
return; |
|
1263 |
} |
|
1264 |
||
1265 |
TResourceReader reader; |
|
1266 |
CCoeEnv::Static()->CreateResourceReaderLC( reader, aResId ); |
|
1267 |
||
1268 |
// get write box bg color |
|
1269 |
TInt32 colorMajorSkinId = reader.ReadInt32(); |
|
1270 |
TInt skinitemid = reader.ReadInt16(); |
|
1271 |
TInt coloridx = reader.ReadInt16(); |
|
1272 |
||
1273 |
TAknsItemID colorid; |
|
1274 |
colorid.Set( TInt( colorMajorSkinId ), skinitemid ); |
|
1275 |
||
1276 |
TRgb boxcolor; |
|
1277 |
MAknsSkinInstance* skininstance = AknsUtils::SkinInstance(); |
|
1278 |
TInt error = AknsUtils::GetCachedColor( skininstance, |
|
1279 |
boxcolor, |
|
1280 |
colorid, |
|
1281 |
coloridx ); |
|
1282 |
||
1283 |
if ( error != KErrNone ) |
|
1284 |
{ |
|
1285 |
boxcolor = TRgb( KDefaultWriteBoxBgColor ); |
|
1286 |
} |
|
1287 |
||
1288 |
iWritingBox->SetBkColor( boxcolor ); |
|
1289 |
||
1290 |
skinitemid = reader.ReadInt16(); |
|
1291 |
coloridx = reader.ReadInt16(); |
|
1292 |
||
1293 |
colorid.Set( TInt( colorMajorSkinId ), skinitemid ); |
|
1294 |
||
1295 |
TRgb boxframecolor; |
|
1296 |
error = AknsUtils::GetCachedColor( skininstance, |
|
1297 |
boxframecolor, |
|
1298 |
colorid, |
|
1299 |
coloridx ); |
|
1300 |
||
1301 |
if ( error != KErrNone ) |
|
1302 |
{ |
|
1303 |
boxframecolor = TRgb( KDefaultWriteBoxFrameColor ); |
|
1304 |
} |
|
1305 |
||
1306 |
iWritingBox->SetFrameCol( boxframecolor ); |
|
1307 |
||
1308 |
CleanupStack::PopAndDestroy(); // reader |
|
1309 |
} |
|
1310 |
||
1311 |
// --------------------------------------------------------------------------- |
|
1312 |
// show bublble or not |
|
1313 |
// --------------------------------------------------------------------------- |
|
1314 |
// |
|
1315 |
void CPeninputFingerHwrArWnd::ShowBubble(TInt aShow) |
|
1316 |
{ |
|
1317 |
if (aShow > 0) |
|
1318 |
{ |
|
1319 |
TRect outrect,innerrect; |
|
1320 |
iCandidateList->ShowBubble(ETrue); |
|
1321 |
||
1322 |
// Set priview popup size |
|
1323 |
iCandidateList->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview); |
|
1324 |
||
1325 |
outrect = iLafManager->PreviewBubbleRect(); |
|
1326 |
innerrect = iLafManager->PreviewBubbleInnerRect(); |
|
1327 |
iCandidateList->SetTextFormat(iLafManager->PreviewBubbleTextLayout()); |
|
1328 |
iCandidateList->SetBubbleTextFont(iLafManager->PreviewBubbleFont()); |
|
1329 |
iCandidateList->SetBubbleSize(TSize(outrect.Width(),outrect.Height())); // Read laf |
|
1330 |
iCandidateList->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX, |
|
1331 |
innerrect.iTl.iY - outrect.iTl.iY, |
|
1332 |
outrect.iBr.iX - innerrect.iBr.iX, |
|
1333 |
outrect.iBr.iY - innerrect.iBr.iY); |
|
1334 |
||
1335 |
} |
|
1336 |
else |
|
1337 |
{ |
|
1338 |
iCandidateList->ShowBubble(EFalse); |
|
1339 |
} |
|
1340 |
} |
|
1341 |
||
1342 |
// -------------------------------------------------------------------------- |
|
1343 |
// CPeninputHwrBxAbWnd::CalculateGuideLinePos |
|
1344 |
// (other items were commented in a header) |
|
1345 |
// -------------------------------------------------------------------------- |
|
1346 |
// |
|
1347 |
void CPeninputFingerHwrArWnd::CalculateGuideLinePos() |
|
1348 |
{ |
|
1349 |
TRect rect = iWritingBox->Rect(); |
|
1350 |
TInt leftrightmargin = rect.Size().iWidth / 10; |
|
1351 |
||
1352 |
CPeninputFingerHwrArLayout* hwrLayout = NULL; |
|
1353 |
hwrLayout = static_cast<CPeninputFingerHwrArLayout*>( UiLayout() ); |
|
1354 |
||
1355 |
TInt bottommargin = 0; |
|
1356 |
hwrLayout->DataStore().GetBottomGuideLinePos(bottommargin); |
|
1357 |
||
1358 |
iGuideLineBottomTl.iX = rect.iTl.iX + leftrightmargin; |
|
1359 |
iGuideLineBottomTl.iY = rect.iTl.iY + bottommargin; |
|
1360 |
||
1361 |
iGuideLineBottomBr.iX = rect.iBr.iX - leftrightmargin; |
|
1362 |
iGuideLineBottomBr.iY = rect.iTl.iY + bottommargin; |
|
1363 |
||
1364 |
iWritingBox->SetBottomGuideLinePosition(iGuideLineBottomTl, iGuideLineBottomBr); |
|
1365 |
} |
|
1366 |
||
1367 |
// -------------------------------------------------------------------------- |
|
1368 |
// CPeninputFingerHwrArWnd::DrawGuideLine |
|
1369 |
// (other items were commented in a header) |
|
1370 |
// -------------------------------------------------------------------------- |
|
1371 |
// |
|
1372 |
void CPeninputFingerHwrArWnd::DrawGuideLine() |
|
1373 |
{ |
|
1374 |
if(iGuideLineOn) |
|
1375 |
{ |
|
1376 |
TInt style = CTransparentHwrWndExt::EGuideLineBottom; |
|
1377 |
iWritingBox->SetGuideLineStyle( style ); |
|
1378 |
||
1379 |
// if size changing, or guide line pos has not been set |
|
1380 |
CalculateGuideLinePos(); |
|
1381 |
||
1382 |
iWritingBox->HideGuideLine(ETrue); |
|
1383 |
} |
|
1384 |
else |
|
1385 |
{ |
|
1386 |
iWritingBox->HideGuideLine(EFalse); |
|
1387 |
} |
|
1388 |
||
1389 |
iWritingBox->RefreshUI(); |
|
1390 |
} |
|
1391 |
||
1392 |
// -------------------------------------------------------------------------- |
|
1393 |
// CPeninputFingerHwrArWnd::OpenSymbolTable |
|
1394 |
// Open the symbol table |
|
1395 |
// -------------------------------------------------------------------------- |
|
1396 |
// |
|
1397 |
void CPeninputFingerHwrArWnd::OpenSymbolTable() |
|
1398 |
{ |
|
1399 |
if(!iSymbolTable->IsPopup() && !iNumSymbolTable->IsPopup()) |
|
1400 |
{ |
|
1401 |
SwitchToSymbolTableView(); |
|
1402 |
} |
|
1403 |
} |
|
1404 |
||
1405 |
// -------------------------------------------------------------------------- |
|
1406 |
// CPeninputFingerHwrArWnd::CloseSymbolTable |
|
1407 |
// Close the symbol table |
|
1408 |
// -------------------------------------------------------------------------- |
|
1409 |
// |
|
1410 |
void CPeninputFingerHwrArWnd::CloseSymbolTable() |
|
1411 |
{ |
|
1412 |
if(iSymbolTable->IsPopup()) |
|
1413 |
{ |
|
1414 |
iSymbolTable->CloseSymbolTable(); |
|
1415 |
iSymbolTable->BringToBack(); |
|
1416 |
SwitchToStandbyView(); |
|
1417 |
} |
|
1418 |
else if(iNumSymbolTable->IsPopup()) |
|
1419 |
{ |
|
1420 |
iNumSymbolTable->CloseSymbolTable(); |
|
1421 |
iNumSymbolTable->BringToBack(); |
|
1422 |
SwitchToStandbyView(); |
|
1423 |
} |
|
1424 |
} |
|
1425 |
||
1426 |
// -------------------------------------------------------------------------- |
|
1427 |
// CPeninputFingerHwrArWnd::IsSymbolTableShowingUp |
|
1428 |
// Check if the symbol table has been shown up |
|
1429 |
// -------------------------------------------------------------------------- |
|
1430 |
// |
|
1431 |
TBool CPeninputFingerHwrArWnd::IsSymbolTableShowingUp() |
|
1432 |
{ |
|
1433 |
TBool ret = iSymbolTable->IsPopup() | iNumSymbolTable->IsPopup(); |
|
1434 |
return ret; |
|
1435 |
} |
|
1436 |
||
1437 |
// -------------------------------------------------------------------------- |
|
1438 |
// CPeninputFingerHwrArWnd::IsCandidateShowup |
|
1439 |
// Check if the candadiate list has been shown up |
|
1440 |
// -------------------------------------------------------------------------- |
|
1441 |
// |
|
1442 |
TBool CPeninputFingerHwrArWnd::IsCandidateShowup() |
|
1443 |
{ |
|
1444 |
if(!iCandidateList->Hiden()) |
|
1445 |
{ |
|
1446 |
return ETrue; |
|
1447 |
} |
|
1448 |
return EFalse; |
|
1449 |
} |
|
1450 |
||
1451 |
// -------------------------------------------------------------------------- |
|
1452 |
// CPeninputFingerHwrArWnd::IsCandidateShowup |
|
1453 |
// Check if the candadiate list has been shown up |
|
1454 |
// -------------------------------------------------------------------------- |
|
1455 |
// |
|
1456 |
void CPeninputFingerHwrArWnd::HideIndicator() |
|
1457 |
{ |
|
1458 |
iWritingBox->ShowIndicator(EFalse); |
|
1459 |
} |
|
1460 |
||
1461 |
// -------------------------------------------------------------------------- |
|
1462 |
// CPeninputFingerHwrArWnd::GetCharBeforeCursor |
|
1463 |
// Get the char by its position in ICF editor |
|
1464 |
// -------------------------------------------------------------------------- |
|
1465 |
// |
|
1466 |
TBool CPeninputFingerHwrArWnd::GetCharBeforeCursor(TInt aCharPos, TUint16& aCharBeforeCursor) |
|
1467 |
{ |
|
1468 |
TBuf<1> dataBeforeCursor; |
|
1469 |
iContextField->ExtractText( dataBeforeCursor, aCharPos, 1 ); |
|
1470 |
||
1471 |
TBool isFound = EFalse; |
|
1472 |
if(dataBeforeCursor!= KNullDesC) |
|
1473 |
{ |
|
1474 |
aCharBeforeCursor = dataBeforeCursor[0]; |
|
1475 |
isFound = ETrue; |
|
1476 |
} |
|
1477 |
||
1478 |
return isFound; |
|
1479 |
} |
|
1480 |
||
1481 |
// --------------------------------------------------------------------------- |
|
1482 |
// accept editor's number mapping restriction. |
|
1483 |
// --------------------------------------------------------------------------- |
|
1484 |
// |
|
1485 |
void CPeninputFingerHwrArWnd::SetNumericMapping( const TDesC& aNumMapping ) |
|
1486 |
{ |
|
56
8152b1f1763a
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
50
diff
changeset
|
1487 |
iNumSymbolTable->SetNumericMapping(aNumMapping); |
44 | 1488 |
} |
1489 |
// --------------------------------------------------------------------------- |
|
1490 |
// set native number mode on or off. |
|
1491 |
// --------------------------------------------------------------------------- |
|
1492 |
// |
|
1493 |
void CPeninputFingerHwrArWnd::SetNativeNumMode(const TBool aIsNativeNumMode) |
|
1494 |
{ |
|
1495 |
iNumSymbolTable->SetNativeNumMode(aIsNativeNumMode); |
|
1496 |
} |
|
1497 |
// --------------------------------------------------------------------------- |
|
1498 |
// set icf language. |
|
1499 |
// --------------------------------------------------------------------------- |
|
1500 |
// |
|
1501 |
void CPeninputFingerHwrArWnd::SetIcfLanguage( TInt aLang ) |
|
1502 |
{ |
|
1503 |
iContextField->SetLanguageId(aLang); |
|
1504 |
} |
|
1505 |
||
1506 |
// End Of File |