21
|
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>
|
|
27 |
#include <akniconutils.h>
|
|
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
|
|
90 |
if(UiLayout() && iWritingBox)
|
|
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 |
{
|
|
355 |
TRect rect(iLafManager->IndicatorBubbleRect());
|
|
356 |
iContextField->MsgBubbleCtrl()->SetRect(rect);
|
|
357 |
// iContextField->ShowBubble( aInfo, iContextField->MsgBubbleCtrl()->Rect());
|
|
358 |
iContextField->ShowBubble( aInfo, rect);
|
|
359 |
}
|
|
360 |
else
|
|
361 |
{
|
|
362 |
iContextField->HideBubble();
|
|
363 |
}
|
|
364 |
}
|
|
365 |
|
|
366 |
// ---------------------------------------------------------------------------
|
|
367 |
// get strokes from hwr writing box.
|
|
368 |
// ---------------------------------------------------------------------------
|
|
369 |
//
|
|
370 |
const RArray<TPoint>& CPeninputFingerHwrArWnd::StrokeList()
|
|
371 |
{
|
|
372 |
return iWritingBox->StrokeList();
|
|
373 |
}
|
|
374 |
|
|
375 |
// ---------------------------------------------------------------------------
|
|
376 |
// set end mark of hwr
|
|
377 |
// ---------------------------------------------------------------------------
|
|
378 |
//
|
|
379 |
void CPeninputFingerHwrArWnd::SetStrokeEndMark( const TPoint& aEndMark )
|
|
380 |
{
|
|
381 |
iWritingBox->SetStrokeEndMark( aEndMark );
|
|
382 |
}
|
|
383 |
|
|
384 |
// ---------------------------------------------------------------------------
|
|
385 |
// set guide line on or off.
|
|
386 |
// ---------------------------------------------------------------------------
|
|
387 |
//
|
|
388 |
void CPeninputFingerHwrArWnd::SetGuideLineOn(const TBool aGuideLineOn)
|
|
389 |
{
|
|
390 |
iGuideLineOn = aGuideLineOn;
|
|
391 |
DrawGuideLine();
|
|
392 |
}
|
|
393 |
|
|
394 |
// ---------------------------------------------------------------------------
|
|
395 |
// set pen color of hwr writing.
|
|
396 |
// ---------------------------------------------------------------------------
|
|
397 |
//
|
|
398 |
void CPeninputFingerHwrArWnd::SetBoxPenColor( const TInt aPenColor )
|
|
399 |
{
|
|
400 |
iWritingBox->SetPenColor( aPenColor );
|
|
401 |
}
|
|
402 |
|
|
403 |
// ---------------------------------------------------------------------------
|
|
404 |
// set pen size of hwr writing.
|
|
405 |
// ---------------------------------------------------------------------------
|
|
406 |
//
|
|
407 |
void CPeninputFingerHwrArWnd::SetBoxPenSize( const TSize aPenSize )
|
|
408 |
{
|
|
409 |
iWritingBox->SetPenSize( aPenSize );
|
|
410 |
}
|
|
411 |
|
|
412 |
// ---------------------------------------------------------------------------
|
|
413 |
// set writing speed hwr writing.
|
|
414 |
// ---------------------------------------------------------------------------
|
|
415 |
//
|
|
416 |
void CPeninputFingerHwrArWnd::SetBoxWritingSpeed( TTimeIntervalMicroSeconds32& aCharDelay )
|
|
417 |
{
|
|
418 |
iWritingBox->SetCharacterDelay( aCharDelay );
|
|
419 |
TInt strokeDelay = aCharDelay.Int()/5;
|
|
420 |
TTimeIntervalMicroSeconds32 sDelay(strokeDelay);
|
|
421 |
iWritingBox->SetStrokeDelay( sDelay);
|
|
422 |
}
|
|
423 |
|
|
424 |
// ---------------------------------------------------------------------------
|
|
425 |
// retrieve rect of hwr writingbox.
|
|
426 |
// ---------------------------------------------------------------------------
|
|
427 |
//
|
|
428 |
TRect CPeninputFingerHwrArWnd::WritingBoxRect()
|
|
429 |
{
|
|
430 |
return iWritingBox->Rect();
|
|
431 |
}
|
|
432 |
|
|
433 |
|
|
434 |
// ---------------------------------------------------------------------------
|
|
435 |
// Cancel wrting
|
|
436 |
// ---------------------------------------------------------------------------
|
|
437 |
//
|
|
438 |
void CPeninputFingerHwrArWnd::CancelWriting()
|
|
439 |
{
|
|
440 |
iWritingBox->CancelCharWriting();
|
|
441 |
}
|
|
442 |
|
|
443 |
// ---------------------------------------------------------------------------
|
|
444 |
// Change SCT page.
|
|
445 |
// ---------------------------------------------------------------------------
|
|
446 |
//
|
|
447 |
void CPeninputFingerHwrArWnd::ShowSymbolPage( TInt aPageNo, TInt aPos )
|
|
448 |
{
|
|
449 |
iSymbolTable->NavigatePage(aPageNo,aPos);
|
|
450 |
}
|
|
451 |
|
|
452 |
// ---------------------------------------------------------------------------
|
|
453 |
// retrieve the ICF control.
|
|
454 |
// ---------------------------------------------------------------------------
|
|
455 |
//
|
|
456 |
CFepLayoutMultiLineIcf* CPeninputFingerHwrArWnd::Icf()
|
|
457 |
{
|
|
458 |
return iContextField;
|
|
459 |
}
|
|
460 |
|
|
461 |
|
|
462 |
// ---------------------------------------------------------------------------
|
|
463 |
// retrieve the candicate list control.
|
|
464 |
// ---------------------------------------------------------------------------
|
|
465 |
//
|
|
466 |
CFepCtrlDropdownList* CPeninputFingerHwrArWnd::CandidateList()
|
|
467 |
{
|
|
468 |
return iCandidateList;
|
|
469 |
}
|
|
470 |
|
|
471 |
// ---------------------------------------------------------------------------
|
|
472 |
// Open the candidate list
|
|
473 |
// ---------------------------------------------------------------------------
|
|
474 |
//
|
|
475 |
void CPeninputFingerHwrArWnd::OpenCandidateList()
|
|
476 |
{
|
|
477 |
CPeninputFingerHwrArLayout* hwrLayout = NULL;
|
|
478 |
hwrLayout = static_cast<CPeninputFingerHwrArLayout*>( UiLayout() );
|
|
479 |
CPeninputFingerHwrArDataStore& datastore = hwrLayout->DataStore();
|
|
480 |
|
|
481 |
const RPointerArray<HBufC>& candidates = datastore.Candidate();
|
|
482 |
|
|
483 |
if(candidates.Count() > 0)
|
|
484 |
{
|
|
485 |
CFepCtrlDropdownList::TListType unexpandable = CFepCtrlDropdownList::EListExpandableMultiRowWithoutIconWithBubble;
|
|
486 |
|
|
487 |
iCandidateList->Hide( EFalse );
|
|
488 |
TRAP_IGNORE(iCandidateList->SetCandidatesL( candidates, unexpandable ));
|
|
489 |
iCandidateList->SetHighlightCell( 0, datastore.Highlight() );
|
|
490 |
iArrowLeftBtn->Hide(ETrue);
|
|
491 |
iArrowRightBtn->Hide(ETrue);
|
|
492 |
iSpaceBtn->Hide(ETrue);
|
|
493 |
iEnterBtn->Hide(ETrue);
|
|
494 |
}
|
|
495 |
}
|
|
496 |
|
|
497 |
// ---------------------------------------------------------------------------
|
|
498 |
// Close the candidate list
|
|
499 |
// ---------------------------------------------------------------------------
|
|
500 |
//
|
|
501 |
void CPeninputFingerHwrArWnd::CloseCandidateList()
|
|
502 |
{
|
|
503 |
iCandidateList->ResetAndClear(CFepCtrlDropdownList::EListExpandableMultiRowWithoutIconWithBubble);
|
|
504 |
// hide all the dropdown list in standby state
|
|
505 |
iCandidateList->Hide( ETrue );
|
|
506 |
iArrowLeftBtn->Hide(EFalse);
|
|
507 |
iArrowRightBtn->Hide(EFalse);
|
|
508 |
iSpaceBtn->Hide(EFalse);
|
|
509 |
iEnterBtn->Hide(EFalse);
|
|
510 |
}
|
|
511 |
|
|
512 |
// ---------------------------------------------------------------------------
|
|
513 |
// dim arrow buttons.
|
|
514 |
// ---------------------------------------------------------------------------
|
|
515 |
//
|
|
516 |
void CPeninputFingerHwrArWnd::DimArrowKeys( TBool aDimArrow )
|
|
517 |
{
|
|
518 |
iArrowLeftBtn->SetDimmed( aDimArrow );
|
|
519 |
iArrowRightBtn->SetDimmed( aDimArrow );
|
|
520 |
iSpaceBtn->SetDimmed( aDimArrow );
|
|
521 |
iEnterBtn->SetDimmed( aDimArrow );
|
|
522 |
}
|
|
523 |
|
|
524 |
// ---------------------------------------------------------------------------
|
|
525 |
// c++ constructor
|
|
526 |
// ---------------------------------------------------------------------------
|
|
527 |
//
|
|
528 |
CPeninputFingerHwrArWnd::CPeninputFingerHwrArWnd(
|
|
529 |
CFepUiLayout* aFepUiLayout, TInt aControlId )
|
|
530 |
: CControlGroup( aFepUiLayout,aControlId ), iFirstTimeConstruct( ETrue )
|
|
531 |
{
|
|
532 |
}
|
|
533 |
|
|
534 |
// ---------------------------------------------------------------------------
|
|
535 |
// Symbian second-phase constructor
|
|
536 |
// ---------------------------------------------------------------------------
|
|
537 |
//
|
|
538 |
void CPeninputFingerHwrArWnd::ConstructL( TBool /*aLandscapeStyle*/ )
|
|
539 |
{
|
|
540 |
BaseConstructL();
|
|
541 |
|
|
542 |
iLafManager = CPeninputFingerHwrArLafManager::NewL();
|
|
543 |
iLafManager->ReadLafInfo();
|
|
544 |
|
|
545 |
//crate writing
|
|
546 |
CreateWritingBoxL();
|
|
547 |
|
|
548 |
//create the handwriting indicator
|
|
549 |
iHandwritingIndicator = CPeninputArabicFingerHwrIndicator::NewL(UiLayout(),EHwrCtrlIdHandwringIndicator);
|
|
550 |
iWritingBox->InstallIndicator(iHandwritingIndicator);
|
|
551 |
iWritingBox->ShowIndicator(ETrue);
|
|
552 |
|
|
553 |
//create icf
|
|
554 |
CreateContextFieldL();
|
|
555 |
|
|
556 |
//create candidate lists
|
|
557 |
CreateCandidateListL();
|
|
558 |
|
|
559 |
//create virtual sct pad
|
|
560 |
CreateSymbolTableL();
|
|
561 |
|
|
562 |
//create number mode virtual sct pad
|
|
563 |
CreateNumSymbolTableL();
|
|
564 |
|
|
565 |
//create control buttons
|
|
566 |
CreateButtonsL();
|
|
567 |
|
|
568 |
//set controls postion and extent
|
|
569 |
SizeChangedL();
|
|
570 |
|
|
571 |
#ifdef RD_TACTILE_FEEDBACK
|
|
572 |
if (UiLayout()->SupportTactileFeedback())
|
|
573 |
{
|
|
574 |
UiLayout()->RegisterFeedbackArea(reinterpret_cast<TInt>(iWritingBox),
|
|
575 |
iWritingBox->Rect(),
|
|
576 |
iWritingBox->TactileFeedbackType());
|
|
577 |
}
|
|
578 |
#endif
|
|
579 |
|
|
580 |
//switch to standby view
|
|
581 |
SwitchToStandbyView();
|
|
582 |
}
|
|
583 |
|
|
584 |
// ---------------------------------------------------------------------------
|
|
585 |
// create icf.
|
|
586 |
// ---------------------------------------------------------------------------
|
|
587 |
//
|
|
588 |
void CPeninputFingerHwrArWnd::CreateContextFieldL()
|
|
589 |
{
|
|
590 |
const CFont* icffont =iLafManager->IcfFont();
|
|
591 |
|
|
592 |
iContextField = CFepLayoutMultiLineIcf::NewL(
|
|
593 |
iLafManager->IcfRect(),
|
|
594 |
UiLayout(),
|
|
595 |
EHwrCtrlIdInputContextField,
|
|
596 |
icffont->HeightInPixels(),
|
|
597 |
icffont->FontMaxHeight(),
|
|
598 |
icffont );
|
|
599 |
|
|
600 |
iContextField->SetTextMargin ( iLafManager->IcfLeftMargin(),
|
|
601 |
iLafManager->IcfRightMargin(),
|
|
602 |
iLafManager->IcfTopMargin(),
|
|
603 |
iLafManager->IcfBottomMargin() );
|
|
604 |
|
|
605 |
iContextField->SetLineSpace( iLafManager->IcfLineSpaceMargin() );
|
|
606 |
|
|
607 |
iContextField->SizeChangedL( iLafManager->IcfRect(),
|
|
608 |
iLafManager->IcfTextHeight(),
|
|
609 |
iLafManager->IcfFont()->FontMaxHeight(),
|
|
610 |
iLafManager->IcfFont() );
|
|
611 |
|
|
612 |
TAknWindowLineLayout bubbleLineLayout = AknLayoutScalable_Apps::popup_char_count_window().LayoutLine();
|
|
613 |
TAknTextLineLayout bubbleTextLayout = AknLayoutScalable_Apps::popup_char_count_window_t1( 0 ).LayoutLine();
|
|
614 |
|
|
615 |
iContextField->MsgBubbleCtrl()->SetTextFormat( bubbleTextLayout );
|
|
616 |
iContextField->MsgBubbleCtrl()->SetTextColorIndex( EAknsCIQsnTextColorsCG67 );
|
|
617 |
|
|
618 |
//Change the ID when ID into release
|
|
619 |
iContextField->MsgBubbleCtrl()->SetBitmapParam( NULL,
|
|
620 |
NULL,
|
|
621 |
KAknsIIDQsnFrInputPreviewSideL,
|
|
622 |
KAknsIIDQsnFrInputPreviewMiddle,
|
|
623 |
KAknsIIDQsnFrInputPreviewSideR );
|
|
624 |
iContextField->SetMsgBubbleCtrlSize( TSize( bubbleLineLayout.iW,bubbleLineLayout.iH ) );
|
|
625 |
iContextField->MsgBubbleCtrl()->SetTextL(KNullDesC);
|
|
626 |
|
|
627 |
iContextField->SetLineSeparatorAfterPrompt(ETrue);
|
|
628 |
|
|
629 |
//transfer to headerPane
|
|
630 |
AddControlL( iContextField );
|
|
631 |
|
|
632 |
//add layout as event observer
|
|
633 |
iContextField->AddEventObserver( UiLayout() );
|
|
634 |
iContextField->SetFocus();
|
|
635 |
|
|
636 |
}
|
|
637 |
|
|
638 |
// ---------------------------------------------------------------------------
|
|
639 |
// create candidate lists.
|
|
640 |
// ---------------------------------------------------------------------------
|
|
641 |
//
|
|
642 |
void CPeninputFingerHwrArWnd::CreateCandidateListL()
|
|
643 |
{
|
|
644 |
TDropdownListDrawInfo candiDrawInfo(
|
|
645 |
KAknsIIDQsnFrFunctionButtonInactive,
|
|
646 |
KAknsIIDQsnFrFunctionButtonNormal,
|
|
647 |
KAknsIIDQsnFrFunctionButtonPressed,
|
|
648 |
KAknsIIDQsnFrItutButtonCandiSideL,
|
|
649 |
KAknsIIDQsnFrItutButtonCandiMiddle,
|
|
650 |
KAknsIIDQsnFrItutButtonCandiSideR,
|
|
651 |
KAknsIIDQsnFrItutButtonCandiPressedSideL,
|
|
652 |
KAknsIIDQsnFrItutButtonCandiPressedMiddle,
|
|
653 |
KAknsIIDQsnFrItutButtonCandiPressedSideR,
|
|
654 |
TRgb( 194, 221, 242 ),
|
|
655 |
ETrue );
|
|
656 |
|
|
657 |
TInt unitWidth = iLafManager->CandidateUnitWidth();
|
|
658 |
TInt unitHeight = iLafManager->CandidateUnitHeight();
|
|
659 |
TPoint ltPosition = iLafManager->CandidateLTPos();
|
|
660 |
const CFont *font = iLafManager->CandidateFont();
|
|
661 |
iCandidateList = CFepCtrlDropdownList::NewL(UiLayout(),
|
|
662 |
EHwrCtrlIdCandidateList,
|
|
663 |
R_FSHWR_CANDIDATE_DROP_DOWN_LIST,
|
|
664 |
ltPosition,
|
|
665 |
font ,
|
|
666 |
TSize(unitWidth,unitHeight),
|
|
667 |
unitWidth,
|
|
668 |
3,2,
|
|
669 |
unitHeight,
|
|
670 |
0,
|
|
671 |
0,
|
|
672 |
CFepCtrlDropdownList::ECandFromRToL,
|
|
673 |
EFalse);
|
|
674 |
AddControlL( iCandidateList );
|
|
675 |
|
|
676 |
TInt horizontalMargin = iLafManager->CandidateHorizontalMargin();
|
|
677 |
TInt verticalMargin = iLafManager->CandidateVerticalMargin();
|
|
678 |
iCandidateList->SetCellMargin( horizontalMargin, verticalMargin );
|
|
679 |
iCandidateList->SetFont( font );
|
|
680 |
|
|
681 |
// set the needed events
|
|
682 |
iCandidateList->SetEventIdForCandidateSelected( EHwrEventCandidateSelected );
|
|
683 |
iCandidateList->AddEventObserver( UiLayout() );
|
|
684 |
|
|
685 |
// hide the candidate list
|
|
686 |
iCandidateList->Hide( ETrue );
|
|
687 |
iCandidateList->SetDropdownListImgID( candiDrawInfo );
|
|
688 |
}
|
|
689 |
|
|
690 |
// ---------------------------------------------------------------------------
|
|
691 |
// create writing box.
|
|
692 |
// ---------------------------------------------------------------------------
|
|
693 |
//
|
|
694 |
void CPeninputFingerHwrArWnd::CreateWritingBoxL()
|
|
695 |
{
|
|
696 |
iWritingBox = CPeninputArabicFingerHwrWritingWnd::NewL( TRect( 0,0,0,0 ), UiLayout(),
|
|
697 |
EHwrCtrlIdWritingBox, EFalse );
|
|
698 |
|
|
699 |
AddControlL( iWritingBox );
|
|
700 |
|
|
701 |
|
|
702 |
//set it to window
|
|
703 |
iWritingBox->SetStrokeEndMark( TPoint( -1,0 ) );
|
|
704 |
iWritingBox->AddEventObserver( UiLayout() );
|
|
705 |
iWritingBox->EnableTraceOutsideWindow( EFalse );
|
|
706 |
iWritingBox->SetWndTransparencyFactor( 0 );
|
|
707 |
iWritingBox->InstallPenTraceDecoratorL( KNullDesC,EFalse);
|
|
708 |
}
|
|
709 |
|
|
710 |
// ---------------------------------------------------------------------------
|
|
711 |
// create all function buttons.
|
|
712 |
// ---------------------------------------------------------------------------
|
|
713 |
//
|
|
714 |
void CPeninputFingerHwrArWnd::CreateButtonsL()
|
|
715 |
{
|
|
716 |
iCloseBtn = CreateEventBtnL( EHwrCtrlIdClose, R_AKN_FEP_HWR_CLOSE );
|
|
717 |
iOptionBtn = CreateEventBtnL( EHwrCtrlIdLanguageOption, R_AKN_FEP_HWR_OPTION );
|
|
718 |
|
|
719 |
iBackspaceBtn = CreateRepBtnL( EHwrCtrlIdBackspace, R_AKN_FEP_HWR_BACK_SPACE,
|
|
720 |
EHwrEventKeyBack, EKeyBackspace );
|
|
721 |
|
|
722 |
iArrowLeftBtn = CreateRepBtnL( EHwrCtrlIdArrowLeft, R_AKN_FEP_HWR_ARROWLEFT,
|
|
723 |
EHwrEventNavKeyClicked, EKeyLeftArrow );
|
|
724 |
iArrowRightBtn = CreateRepBtnL( EHwrCtrlIdArrowRight, R_AKN_FEP_HWR_ARROWRIGHT,
|
|
725 |
EHwrEventNavKeyClicked, EKeyRightArrow );
|
|
726 |
iEnterBtn = CreateEventBtnL(EHwrCtrlIdBtnEnter,R_AKN_FEP_HWR_ENTER);
|
|
727 |
iSpaceBtn = CreateEventBtnL(EHwrCtrlIdBtnSpace,R_AKN_FEP_HWR_SPACE);
|
|
728 |
// Create 3-pieces color icon for space button
|
|
729 |
CPenInput3PiecesColorIcons* colorIcons =
|
|
730 |
CPenInput3PiecesColorIcons::NewL( R_AKN_FEP_VKB_SPACE_ICON1,
|
|
731 |
R_AKN_FEP_VKB_SPACE_ICON2,
|
|
732 |
R_AKN_FEP_VKB_SPACE_ICON3 );
|
|
733 |
iSpaceBtn->Set3PiecesColorIcons( colorIcons );
|
|
734 |
iSymbolTableBtn = CreateEventBtnL( EHwrCtrlIdSymbolButton, R_AKN_FEP_HWR_SYMBOL_TABLE_BUTTON );
|
|
735 |
}
|
|
736 |
|
|
737 |
// ---------------------------------------------------------------------------
|
|
738 |
// create virtual sct pad.
|
|
739 |
// ---------------------------------------------------------------------------
|
|
740 |
//
|
|
741 |
void CPeninputFingerHwrArWnd::CreateSymbolTableL()
|
|
742 |
{
|
|
743 |
iSymbolTable = CPeninputArabicFingerHwrSymbolTable::NewL(UiLayout(),EHwrCtrlIdSymbolTableVkbGroup);
|
|
744 |
iSymbolTable->Hide(ETrue);
|
|
745 |
iSymbolTable->SetResourceId(R_FINGERHWR_ARABIC_SYMBOLTABLE);
|
|
746 |
iSymbolTable->ConstructFromResourceL();
|
|
747 |
AddControlL( iSymbolTable );
|
|
748 |
iSymbolTable->AddEventObserver( UiLayout() );
|
|
749 |
}
|
|
750 |
|
|
751 |
// ---------------------------------------------------------------------------
|
|
752 |
// create virtual number mode sct pad.
|
|
753 |
// ---------------------------------------------------------------------------
|
|
754 |
//
|
|
755 |
void CPeninputFingerHwrArWnd::CreateNumSymbolTableL()
|
|
756 |
{
|
|
757 |
iNumSymbolTable = CPeninputArabicFingerHwrNumSymbolTable::NewL(UiLayout(),EHwrCtrlIdNumSymbolTableVkbGroup);
|
|
758 |
iNumSymbolTable->Hide(ETrue);
|
|
759 |
iNumSymbolTable->SetResourceId(R_FINGERHWR_ARABIC_NUMBERTABLE);
|
|
760 |
iNumSymbolTable->ConstructFromResourceL();
|
|
761 |
AddControlL( iNumSymbolTable );
|
|
762 |
iNumSymbolTable->AddEventObserver( UiLayout() );
|
|
763 |
}
|
|
764 |
|
|
765 |
// ---------------------------------------------------------------------------
|
|
766 |
// EventButton creation helper.
|
|
767 |
// ---------------------------------------------------------------------------
|
|
768 |
//
|
|
769 |
CAknFepCtrlEventButton* CPeninputFingerHwrArWnd::CreateEventBtnL( TInt aCtrlId,
|
|
770 |
TInt32 aResId, TInt aEvent/*= 0xFFFF*/,TInt aUnicode/*=0*/ )
|
|
771 |
{
|
|
772 |
CAknFepCtrlEventButton* button = CAknFepCtrlEventButton::NewL(
|
|
773 |
UiLayout(), aCtrlId, aEvent, aUnicode,
|
|
774 |
KAknsIIDQsnFrFunctionButtonNormal,
|
|
775 |
KAknsIIDQsnFrFunctionButtonPressed,
|
|
776 |
KAknsIIDQsnFrFunctionButtonInactive );
|
|
777 |
|
|
778 |
button->SetResourceId( aResId );
|
|
779 |
button->ConstructFromResourceL();
|
|
780 |
button->AddEventObserver( UiLayout() );
|
|
781 |
AddControlL( button );
|
|
782 |
return button;
|
|
783 |
}
|
|
784 |
|
|
785 |
// ---------------------------------------------------------------------------
|
|
786 |
// RepeatButton creation helper.
|
|
787 |
// ---------------------------------------------------------------------------
|
|
788 |
//
|
|
789 |
CAknFepCtrlRepeatButton* CPeninputFingerHwrArWnd::CreateRepBtnL( const TInt aCtrlId,
|
|
790 |
TInt32 aResId, const TInt aEvent, const TInt aUnicode )
|
|
791 |
{
|
|
792 |
CAknFepCtrlRepeatButton* button = CAknFepCtrlRepeatButton::NewL(
|
|
793 |
UiLayout(), aCtrlId, aEvent, aUnicode,
|
|
794 |
KAknsIIDQsnFrFunctionButtonNormal,
|
|
795 |
KAknsIIDQsnFrFunctionButtonPressed,
|
|
796 |
KAknsIIDQsnFrFunctionButtonInactive );
|
|
797 |
|
|
798 |
button->SetResourceId( aResId );
|
|
799 |
button->ConstructFromResourceL( );
|
|
800 |
button->AddEventObserver( UiLayout() );
|
|
801 |
AddControlL( button );
|
|
802 |
|
|
803 |
return button;
|
|
804 |
}
|
|
805 |
|
|
806 |
// ---------------------------------------------------------------------------
|
|
807 |
// load virtual sct keys.
|
|
808 |
// ---------------------------------------------------------------------------
|
|
809 |
//
|
|
810 |
void CPeninputFingerHwrArWnd::LoadSymbolVirtualKeysL( const TInt aResId,
|
|
811 |
const RArray<TRect>& aCellRects )
|
|
812 |
{
|
|
813 |
TAknTextLineLayout txtlayout = iLafManager->SctpadKeyTxtLayout();
|
|
814 |
iSymbolTable->KeyPad()->SetTextLineLayout( txtlayout );
|
|
815 |
|
|
816 |
TInt fontid = txtlayout.FontId();
|
|
817 |
const CFont* font = AknLayoutUtils::FontFromId( fontid );
|
|
818 |
iSymbolTable->KeyPad()->SetFont( font );
|
|
819 |
|
|
820 |
iSymbolTable->LoadVirtualKeypadKeyL(aResId,aCellRects);
|
|
821 |
}
|
|
822 |
|
|
823 |
// ---------------------------------------------------------------------------
|
|
824 |
// load virtual number mode sct keys.
|
|
825 |
// ---------------------------------------------------------------------------
|
|
826 |
//
|
|
827 |
void CPeninputFingerHwrArWnd::LoadNumSymbolVirtualKeysL( const TInt aResId,
|
|
828 |
const RArray<TRect>& aCellRects, TBool aReload)
|
|
829 |
{
|
|
830 |
TAknTextLineLayout txtlayout = iLafManager->NumpadKeyTxtLayout();
|
|
831 |
iNumSymbolTable->KeyPad()->SetTextLineLayout( txtlayout );
|
|
832 |
|
|
833 |
TInt fontid = txtlayout.FontId();
|
|
834 |
const CFont* font = AknLayoutUtils::FontFromId( fontid );
|
|
835 |
iNumSymbolTable->KeyPad()->SetFont( font );
|
|
836 |
if(aReload)
|
|
837 |
{
|
|
838 |
iNumSymbolTable->LoadVirtualKeypadKeyL(aResId,aCellRects);
|
|
839 |
}
|
|
840 |
else
|
|
841 |
{
|
|
842 |
iNumSymbolTable->UpdateAllVirtualKeysRect(aCellRects);
|
|
843 |
}
|
|
844 |
}
|
|
845 |
|
|
846 |
// ---------------------------------------------------------------------------
|
|
847 |
// relayout full ui, reset all controls position.
|
|
848 |
// ---------------------------------------------------------------------------
|
|
849 |
//
|
|
850 |
void CPeninputFingerHwrArWnd::ResetLayoutL()
|
|
851 |
{
|
|
852 |
TRect rcScreen = iLafManager->LayoutRect();
|
|
853 |
SetRect( rcScreen );
|
|
854 |
|
|
855 |
TRect rect;
|
|
856 |
|
|
857 |
//Move ICF
|
|
858 |
rect = iLafManager->CtrlRect( iContextField->ControlId() );
|
|
859 |
iContextField->SetRect( rect );
|
|
860 |
|
|
861 |
//Move Writing box
|
|
862 |
rect = iLafManager->CtrlRect( iWritingBox->ControlId() );
|
|
863 |
iWritingBox->SetRect( rect );
|
|
864 |
|
|
865 |
//resize indicator
|
|
866 |
iHandwritingIndicator->ConstructFromResourceL(R_AKN_FEP_HWR_INDICATOR_ICON);
|
|
867 |
iHandwritingIndicator->SizeChanged(iLafManager->GetIndicatorRect(),ETrue);
|
|
868 |
|
|
869 |
//Move buttons
|
|
870 |
TSize siBtnPadding = iLafManager->ButtonInnerPadding();
|
|
871 |
TInt pdx = siBtnPadding.iWidth;
|
|
872 |
TInt pdy = siBtnPadding.iHeight;
|
|
873 |
|
|
874 |
rect = iLafManager->CtrlRect( iCloseBtn->ControlId() );
|
|
875 |
MoveIconButton( iCloseBtn, rect, pdx, pdy, ETrue );
|
|
876 |
|
|
877 |
rect = iLafManager->CtrlRect( iSymbolTableBtn->ControlId() );
|
|
878 |
MoveIconButton( iSymbolTableBtn, rect, pdx, pdy, ETrue );
|
|
879 |
|
|
880 |
rect = iLafManager->CtrlRect( iBackspaceBtn->ControlId() );
|
|
881 |
MoveIconButton( iBackspaceBtn, rect, pdx, pdy, ETrue );
|
|
882 |
|
|
883 |
rect = iLafManager->CtrlRect( iOptionBtn->ControlId() );
|
|
884 |
MoveIconButton( iOptionBtn, rect, pdx, pdy, ETrue );
|
|
885 |
|
|
886 |
pdx = iLafManager->GetArrowPaddingSize().iWidth;
|
|
887 |
pdy = iLafManager->GetArrowPaddingSize().iHeight;
|
|
888 |
|
|
889 |
rect = iLafManager->CtrlRect( iArrowLeftBtn->ControlId() );
|
|
890 |
MoveIconButton( iArrowLeftBtn, rect, pdx, pdy, ETrue );
|
|
891 |
|
|
892 |
rect = iLafManager->CtrlRect( iArrowRightBtn->ControlId() );
|
|
893 |
MoveIconButton( iArrowRightBtn, rect, pdx, pdy, ETrue );
|
|
894 |
|
|
895 |
rect = iLafManager->CtrlRect( iSpaceBtn->ControlId() );
|
|
896 |
MoveIconButton( iSpaceBtn, rect, pdx, pdy, ETrue );
|
|
897 |
|
|
898 |
TRect pieceInnerRect = rect;
|
|
899 |
pieceInnerRect.Shrink(pdx*2,pdy);
|
|
900 |
|
|
901 |
// that's a not good algrithm in funciton AknPenInputDrawUtils::Draw3PiecesColorIcon for drawing 3Pieces icons
|
|
902 |
// 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
|
|
903 |
// would be bitblited onto are set to be Rect(0.0.0.0.0) [[which should not be that behavior]].
|
|
904 |
// Please theck the codes: AknPenInputDrawUtils::Draw3PiecesColorIcon: this function should be Updated.
|
|
905 |
iSpaceBtn->SetDraw3PieceFrameInfo(
|
|
906 |
TDraw3PiecesFrame(KAknsIIDQgnIndiInputSpaceL,
|
|
907 |
KAknsIIDQgnIndiInputSpaceMiddle,
|
|
908 |
KAknsIIDQgnIndiInputSpaceR,
|
|
909 |
pieceInnerRect));
|
|
910 |
|
|
911 |
rect = iLafManager->CtrlRect( iEnterBtn->ControlId() );
|
|
912 |
MoveIconButton( iEnterBtn, rect, pdx, pdy, ETrue );
|
|
913 |
|
|
914 |
// load vkb key image
|
|
915 |
TSize keysize = iLafManager->VirtualSctpadCellSize().Size();
|
|
916 |
iSymbolTable->LoadVkbKeyImageL(R_FINGER_HWR_SCTPAD_IMAGE, keysize );
|
|
917 |
|
|
918 |
// get the key rect
|
|
919 |
RArray<TRect> rects;
|
|
920 |
CleanupClosePushL( rects );
|
|
921 |
iLafManager->GetVirtualKeyRects( rects );
|
|
922 |
|
|
923 |
// load keys
|
|
924 |
if(iLafManager->IsLandscape())
|
|
925 |
{
|
|
926 |
LoadSymbolVirtualKeysL(R_ARABIC_FINGER_HWR_LANDSCAPE_SYMBOL_TABLE, rects);
|
|
927 |
}
|
|
928 |
else
|
|
929 |
{
|
|
930 |
LoadSymbolVirtualKeysL(R_ARABIC_FINGER_HWR_PORTRAIT_SYMBOL_TABLE, rects);
|
|
931 |
}
|
|
932 |
|
|
933 |
CleanupStack::PopAndDestroy();//rects
|
|
934 |
|
|
935 |
//move virtual Sctpad
|
|
936 |
TInt rows = iLafManager->VirtualSctpadRowCount();
|
|
937 |
TInt cols = iLafManager->VirtualSctpadColCount();
|
|
938 |
|
|
939 |
rect = iLafManager->CtrlRect(iSymbolTable->ControlId());
|
|
940 |
iSymbolTable->SetRect(rect);
|
|
941 |
|
|
942 |
iSymbolTable->SizeChanged(iLafManager->GetVirtualKeyRect(),
|
|
943 |
iLafManager->GetSymBtnArray(), rows, cols,
|
|
944 |
iLafManager->IsLandscape());
|
|
945 |
//number mode symbol table
|
|
946 |
// load number mode vkb key image
|
|
947 |
TSize numkeysize = iLafManager->VirtualNumpadCellSize().Size();
|
|
948 |
iNumSymbolTable->LoadVkbKeyImageL(R_FINGER_HWR_NUMPAD_IMAGE, numkeysize );
|
|
949 |
|
|
950 |
// get the key rect
|
|
951 |
RArray<TRect> numrects;
|
|
952 |
CleanupClosePushL( numrects );
|
|
953 |
iLafManager->GetNumVirtualKeyRects( numrects );
|
|
954 |
|
|
955 |
// load keys
|
|
956 |
LoadNumSymbolVirtualKeysL(R_FINGER_HWR_NUMPAD, numrects,EFalse);
|
|
957 |
|
|
958 |
CleanupStack::PopAndDestroy();//rects
|
|
959 |
|
|
960 |
//move virtual Sctpad
|
|
961 |
TInt numpadrows = iLafManager->VirtualNumSctpadRowCount();
|
|
962 |
TInt numpadcols = iLafManager->VirtualNumSctpadColCount();
|
|
963 |
|
|
964 |
rect = iLafManager->CtrlRect(iNumSymbolTable->ControlId());
|
|
965 |
iNumSymbolTable->SetRect(rect);
|
|
966 |
|
|
967 |
iNumSymbolTable->SizeChanged(iLafManager->GetVirtualNumKeyRect());
|
|
968 |
}
|
|
969 |
|
|
970 |
|
|
971 |
// ---------------------------------------------------------------------------
|
|
972 |
// layout for chinese range standby.
|
|
973 |
// ---------------------------------------------------------------------------
|
|
974 |
//
|
|
975 |
void CPeninputFingerHwrArWnd::SwitchToStandbyView()
|
|
976 |
{
|
|
977 |
// hide following controls
|
|
978 |
iCandidateList->Hide( ETrue );
|
|
979 |
iSymbolTable->Hide( ETrue);
|
|
980 |
iNumSymbolTable->Hide(ETrue);
|
|
981 |
|
|
982 |
// show following controls
|
|
983 |
iArrowLeftBtn->Hide( EFalse );
|
|
984 |
iArrowRightBtn->Hide( EFalse );
|
|
985 |
iSpaceBtn->Hide( EFalse );
|
|
986 |
iEnterBtn->Hide( EFalse );
|
|
987 |
iOptionBtn->Hide( EFalse );
|
|
988 |
iSymbolTableBtn->SetHighlight( EFalse);
|
|
989 |
iContextField->SetReady(ETrue);
|
|
990 |
Draw();
|
|
991 |
}
|
|
992 |
|
|
993 |
// ---------------------------------------------------------------------------
|
|
994 |
// layout for symbol range standby.
|
|
995 |
// ---------------------------------------------------------------------------
|
|
996 |
//
|
|
997 |
void CPeninputFingerHwrArWnd::SwitchToSymbolTableView()
|
|
998 |
{
|
|
999 |
CPeninputFingerHwrArLayout* hwrLayout = NULL;
|
|
1000 |
hwrLayout = static_cast<CPeninputFingerHwrArLayout*>( UiLayout() );
|
|
1001 |
CPeninputFingerHwrArDataStore& datastore = hwrLayout->DataStore();
|
|
1002 |
TBool IsNumberOnly = datastore.IsNumberOnlyMode();
|
|
1003 |
// show following controls
|
|
1004 |
iWritingBox->Hide( EFalse );
|
|
1005 |
if(IsNumberOnly)
|
|
1006 |
{
|
|
1007 |
iSymbolTable->Hide( ETrue );
|
|
1008 |
iNumSymbolTable->Hide(EFalse);
|
|
1009 |
}
|
|
1010 |
else
|
|
1011 |
{
|
|
1012 |
iSymbolTable->Hide( EFalse );
|
|
1013 |
iNumSymbolTable->Hide(ETrue);
|
|
1014 |
}
|
|
1015 |
iOptionBtn->Hide( EFalse );
|
|
1016 |
|
|
1017 |
// hide follwing controls
|
|
1018 |
iCandidateList->Hide( ETrue );
|
|
1019 |
iArrowLeftBtn->Hide( ETrue );
|
|
1020 |
iArrowRightBtn->Hide( ETrue );
|
|
1021 |
iSpaceBtn->Hide( ETrue );
|
|
1022 |
iEnterBtn->Hide( ETrue );
|
|
1023 |
|
|
1024 |
// set the symboltable button highlighted
|
|
1025 |
iSymbolTableBtn->SetHighlight( ETrue );
|
|
1026 |
|
|
1027 |
// avoid overlap refresh problem after opening symbil table
|
|
1028 |
// so set this control to be not ready
|
|
1029 |
iContextField->SetReady(EFalse);
|
|
1030 |
|
|
1031 |
if(IsNumberOnly)
|
|
1032 |
{
|
|
1033 |
iNumSymbolTable->OpenSymbolTable();
|
|
1034 |
iNumSymbolTable->BringToTop();
|
|
1035 |
}
|
|
1036 |
else
|
|
1037 |
{
|
|
1038 |
iSymbolTable->OpenSymbolTable();
|
|
1039 |
iSymbolTable->BringToTop();
|
|
1040 |
}
|
|
1041 |
}
|
|
1042 |
|
|
1043 |
|
|
1044 |
// ---------------------------------------------------------------------------
|
|
1045 |
// EventButton layout helper. Move button to specified rect.
|
|
1046 |
// ---------------------------------------------------------------------------
|
|
1047 |
//
|
|
1048 |
void CPeninputFingerHwrArWnd::MoveIconButton( CAknFepCtrlEventButton* aButton,
|
|
1049 |
const TRect& aRect, TInt aXPadding, TInt aYPadding, TBool aReloadImages )
|
|
1050 |
{
|
|
1051 |
if ( !aButton )
|
|
1052 |
{
|
|
1053 |
return;
|
|
1054 |
}
|
|
1055 |
|
|
1056 |
aButton->SetRect( aRect );
|
|
1057 |
TRect rcInner = aRect;
|
|
1058 |
if ( rcInner.Width()> rcInner.Height() )
|
|
1059 |
{
|
|
1060 |
TInt dx = ( rcInner.Width() - rcInner.Height() ) / 4;
|
|
1061 |
rcInner.Move( dx, 0 );
|
|
1062 |
rcInner.SetWidth( rcInner.Height() + 2*dx);
|
|
1063 |
}
|
|
1064 |
else
|
|
1065 |
{
|
|
1066 |
TInt dy = ( rcInner.Height() - rcInner.Width() ) / 4;
|
|
1067 |
rcInner.Move( 0, dy );
|
|
1068 |
rcInner.SetHeight( rcInner.Width() + 2*dy);
|
|
1069 |
}
|
|
1070 |
rcInner.Shrink( aXPadding, aYPadding );
|
|
1071 |
if(aButton->ControlId() == EHwrCtrlIdBtnSpace)
|
|
1072 |
{
|
|
1073 |
// config 3 pieces icon info
|
|
1074 |
TRect middleIconRect = rcInner;
|
|
1075 |
middleIconRect.Shrink(2,2);
|
|
1076 |
( static_cast<CAknFepCtrlCommonButton*> (aButton) )->SetDraw3PieceFrameInfo(
|
|
1077 |
TDraw3PiecesFrame(KAknsIIDQgnIndiInputSpaceL,
|
|
1078 |
KAknsIIDQgnIndiInputSpaceMiddle,
|
|
1079 |
KAknsIIDQgnIndiInputSpaceR,
|
|
1080 |
middleIconRect));
|
|
1081 |
}
|
|
1082 |
aButton->SizeChanged( aRect, rcInner, aReloadImages );
|
|
1083 |
}
|
|
1084 |
|
|
1085 |
// ---------------------------------------------------------------------------
|
|
1086 |
// Read control's shadow info.
|
|
1087 |
// ---------------------------------------------------------------------------
|
|
1088 |
//
|
|
1089 |
void CPeninputFingerHwrArWnd::ReadShadowInfoL( const TInt aResId )
|
|
1090 |
{
|
|
1091 |
TResourceReader resReader;
|
|
1092 |
CCoeEnv::Static()->CreateResourceReaderLC( resReader, aResId );
|
|
1093 |
|
|
1094 |
TPtrC bmpFileName = resReader.ReadTPtrC();
|
|
1095 |
TInt32 imgMajorSkinId = resReader.ReadInt32();
|
|
1096 |
|
|
1097 |
TAknsItemID id;
|
|
1098 |
TInt skinitemid;
|
|
1099 |
|
|
1100 |
MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
|
|
1101 |
|
|
1102 |
for ( TInt i = 0; i < KShadowBmpBr + 1; i++ )
|
|
1103 |
{
|
|
1104 |
const TInt16 bmpId = resReader.ReadInt16();
|
|
1105 |
const TInt16 bmpMskId = resReader.ReadInt16();
|
|
1106 |
skinitemid = resReader.ReadInt16();
|
|
1107 |
|
|
1108 |
id.Set( TInt( imgMajorSkinId ), skinitemid );
|
|
1109 |
|
|
1110 |
if ( bmpId != KInvalidImg )
|
|
1111 |
{
|
|
1112 |
CFbsBitmap* shadowImg = NULL;
|
|
1113 |
CFbsBitmap* shadowMaskImg = NULL;
|
|
1114 |
|
|
1115 |
if ( bmpMskId != KInvalidImg )
|
|
1116 |
{
|
|
1117 |
AknsUtils::CreateIconL( skininstance,
|
|
1118 |
id,
|
|
1119 |
shadowImg,
|
|
1120 |
shadowMaskImg,
|
|
1121 |
bmpFileName,
|
|
1122 |
bmpId,
|
|
1123 |
bmpMskId );
|
|
1124 |
}
|
|
1125 |
else
|
|
1126 |
{
|
|
1127 |
AknsUtils::CreateIconL( skininstance,
|
|
1128 |
id,
|
|
1129 |
shadowImg,
|
|
1130 |
bmpFileName,
|
|
1131 |
bmpId );
|
|
1132 |
}
|
|
1133 |
|
|
1134 |
SetShadowBmp( shadowImg, shadowMaskImg, TShadowBitmapIndex( i ) );
|
|
1135 |
}
|
|
1136 |
}
|
|
1137 |
CleanupStack::PopAndDestroy( 1 ); // reader
|
|
1138 |
|
|
1139 |
}
|
|
1140 |
|
|
1141 |
// ---------------------------------------------------------------------------
|
|
1142 |
// Read control's background info.
|
|
1143 |
// ---------------------------------------------------------------------------
|
|
1144 |
//
|
|
1145 |
void CPeninputFingerHwrArWnd::ReadBackgroundInfoL( const TInt aResId )
|
|
1146 |
{
|
|
1147 |
if ( aResId == 0 )
|
|
1148 |
return;
|
|
1149 |
|
|
1150 |
if ( BackgroundBmp() )
|
|
1151 |
{
|
|
1152 |
CFbsBitmap* bkBmp = BackgroundBmp();
|
|
1153 |
delete bkBmp;
|
|
1154 |
SetBackgroundBmp( NULL );
|
|
1155 |
}
|
|
1156 |
if ( BkMaskBmp() )
|
|
1157 |
{
|
|
1158 |
CFbsBitmap* bkMaskBmp = BkMaskBmp();
|
|
1159 |
delete bkMaskBmp;
|
|
1160 |
SetBackgroundMaskBmp( NULL );
|
|
1161 |
}
|
|
1162 |
|
|
1163 |
TResourceReader resReader;
|
|
1164 |
CCoeEnv::Static()->CreateResourceReaderLC( resReader, aResId );
|
|
1165 |
|
|
1166 |
TPtrC bmpFileName = resReader.ReadTPtrC();
|
|
1167 |
TInt32 imgMajorSkinId = resReader.ReadInt32();
|
|
1168 |
|
|
1169 |
TAknsItemID id;
|
|
1170 |
TInt skinitemid;
|
|
1171 |
|
|
1172 |
MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
|
|
1173 |
const TInt16 bmpId = resReader.ReadInt16();
|
|
1174 |
const TInt16 bmpMskId = resReader.ReadInt16();
|
|
1175 |
skinitemid = resReader.ReadInt16();
|
|
1176 |
id.Set( TInt( imgMajorSkinId ), skinitemid );
|
|
1177 |
|
|
1178 |
if ( bmpId != KInvalidImg )
|
|
1179 |
{
|
|
1180 |
CFbsBitmap* backgroundImg = NULL;
|
|
1181 |
CFbsBitmap* backgroundMaskImg = NULL;
|
|
1182 |
if ( bmpMskId != KInvalidImg )
|
|
1183 |
{
|
|
1184 |
AknsUtils::CreateIconL( skininstance, id, backgroundImg,
|
|
1185 |
backgroundMaskImg, bmpFileName, bmpId, bmpMskId );
|
|
1186 |
}
|
|
1187 |
else
|
|
1188 |
{
|
|
1189 |
AknsUtils::CreateIconL( skininstance, id, backgroundImg,
|
|
1190 |
bmpFileName, bmpId );
|
|
1191 |
}
|
|
1192 |
|
|
1193 |
SetBackgroundBmp( backgroundImg );
|
|
1194 |
SetBackgroundMaskBmp( backgroundMaskImg );
|
|
1195 |
}
|
|
1196 |
CleanupStack::PopAndDestroy( 1 ); //reader
|
|
1197 |
}
|
|
1198 |
|
|
1199 |
// ---------------------------------------------------------------------------
|
|
1200 |
// read icf appearance info.
|
|
1201 |
// ---------------------------------------------------------------------------
|
|
1202 |
//
|
|
1203 |
void CPeninputFingerHwrArWnd::ReadICFInfoL( const TInt aResId )
|
|
1204 |
{
|
|
1205 |
if ( aResId == 0 )
|
|
1206 |
{
|
|
1207 |
return;
|
|
1208 |
}
|
|
1209 |
|
|
1210 |
TResourceReader icfreader;
|
|
1211 |
CCoeEnv::Static()->CreateResourceReaderLC( icfreader, aResId );
|
|
1212 |
|
|
1213 |
TInt32 colorMajorSkinId = icfreader.ReadInt32();
|
|
1214 |
TInt skinitemid = icfreader.ReadInt16();
|
|
1215 |
TInt coloridx = icfreader.ReadInt16();
|
|
1216 |
|
|
1217 |
TAknsItemID colorid;
|
|
1218 |
colorid.Set( TInt( colorMajorSkinId ), skinitemid );
|
|
1219 |
|
|
1220 |
TRgb icftextcolor;
|
|
1221 |
MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
|
|
1222 |
TInt error = AknsUtils::GetCachedColor( skininstance, icftextcolor,
|
|
1223 |
colorid, coloridx );
|
|
1224 |
|
|
1225 |
if ( error != KErrNone )
|
|
1226 |
{
|
|
1227 |
icftextcolor = TRgb( KDefaultTextColor );
|
|
1228 |
}
|
|
1229 |
|
|
1230 |
iContextField->SetTextColorL( icftextcolor );
|
|
1231 |
|
|
1232 |
// Set highlight color
|
|
1233 |
TRgb icfhightlightcolor;
|
|
1234 |
error = AknsUtils::GetCachedColor( skininstance,
|
|
1235 |
icfhightlightcolor,
|
|
1236 |
KAknsIIDQsnHighlightColors,
|
|
1237 |
EAknsCIQsnHighlightColorsCG2 );
|
|
1238 |
if ( error == KErrNone )
|
|
1239 |
{
|
|
1240 |
iContextField->SetTextSelColorL( icfhightlightcolor );
|
|
1241 |
}
|
|
1242 |
|
|
1243 |
skinitemid = icfreader.ReadInt16();
|
|
1244 |
coloridx = icfreader.ReadInt16();
|
|
1245 |
|
|
1246 |
colorid.Set( TInt( colorMajorSkinId ), skinitemid );
|
|
1247 |
|
|
1248 |
TRgb icfframecolor;
|
|
1249 |
error = AknsUtils::GetCachedColor( skininstance, icfframecolor,
|
|
1250 |
colorid, coloridx );
|
|
1251 |
|
|
1252 |
if ( error != KErrNone )
|
|
1253 |
{
|
|
1254 |
icfframecolor = TRgb( KDefaultFrameColor );
|
|
1255 |
}
|
|
1256 |
|
|
1257 |
iContextField->SetBorderColor( icfframecolor );
|
|
1258 |
iContextField->SetBgImgSkinId( KAknsIIDQgnGrafFepInputBg );
|
|
1259 |
CleanupStack::PopAndDestroy( 1 ); // icfreader
|
|
1260 |
}
|
|
1261 |
|
|
1262 |
// ---------------------------------------------------------------------------
|
|
1263 |
// read writingbox appearance info.
|
|
1264 |
// ---------------------------------------------------------------------------
|
|
1265 |
//
|
|
1266 |
void CPeninputFingerHwrArWnd::ReadWritingBoxInfoL( const TInt aResId )
|
|
1267 |
{
|
|
1268 |
if ( aResId == 0 )
|
|
1269 |
{
|
|
1270 |
return;
|
|
1271 |
}
|
|
1272 |
|
|
1273 |
TResourceReader reader;
|
|
1274 |
CCoeEnv::Static()->CreateResourceReaderLC( reader, aResId );
|
|
1275 |
|
|
1276 |
// get write box bg color
|
|
1277 |
TInt32 colorMajorSkinId = reader.ReadInt32();
|
|
1278 |
TInt skinitemid = reader.ReadInt16();
|
|
1279 |
TInt coloridx = reader.ReadInt16();
|
|
1280 |
|
|
1281 |
TAknsItemID colorid;
|
|
1282 |
colorid.Set( TInt( colorMajorSkinId ), skinitemid );
|
|
1283 |
|
|
1284 |
TRgb boxcolor;
|
|
1285 |
MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
|
|
1286 |
TInt error = AknsUtils::GetCachedColor( skininstance,
|
|
1287 |
boxcolor,
|
|
1288 |
colorid,
|
|
1289 |
coloridx );
|
|
1290 |
|
|
1291 |
if ( error != KErrNone )
|
|
1292 |
{
|
|
1293 |
boxcolor = TRgb( KDefaultWriteBoxBgColor );
|
|
1294 |
}
|
|
1295 |
|
|
1296 |
iWritingBox->SetBkColor( boxcolor );
|
|
1297 |
|
|
1298 |
skinitemid = reader.ReadInt16();
|
|
1299 |
coloridx = reader.ReadInt16();
|
|
1300 |
|
|
1301 |
colorid.Set( TInt( colorMajorSkinId ), skinitemid );
|
|
1302 |
|
|
1303 |
TRgb boxframecolor;
|
|
1304 |
error = AknsUtils::GetCachedColor( skininstance,
|
|
1305 |
boxframecolor,
|
|
1306 |
colorid,
|
|
1307 |
coloridx );
|
|
1308 |
|
|
1309 |
if ( error != KErrNone )
|
|
1310 |
{
|
|
1311 |
boxframecolor = TRgb( KDefaultWriteBoxFrameColor );
|
|
1312 |
}
|
|
1313 |
|
|
1314 |
iWritingBox->SetFrameCol( boxframecolor );
|
|
1315 |
|
|
1316 |
CleanupStack::PopAndDestroy(); // reader
|
|
1317 |
}
|
|
1318 |
|
|
1319 |
// ---------------------------------------------------------------------------
|
|
1320 |
// show bublble or not
|
|
1321 |
// ---------------------------------------------------------------------------
|
|
1322 |
//
|
|
1323 |
void CPeninputFingerHwrArWnd::ShowBubble(TInt aShow)
|
|
1324 |
{
|
|
1325 |
if (aShow > 0)
|
|
1326 |
{
|
|
1327 |
TRect outrect,innerrect;
|
|
1328 |
iCandidateList->ShowBubble(ETrue);
|
|
1329 |
|
|
1330 |
// Set priview popup size
|
|
1331 |
iCandidateList->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview);
|
|
1332 |
|
|
1333 |
outrect = iLafManager->PreviewBubbleRect();
|
|
1334 |
innerrect = iLafManager->PreviewBubbleInnerRect();
|
|
1335 |
iCandidateList->SetTextFormat(iLafManager->PreviewBubbleTextLayout());
|
|
1336 |
iCandidateList->SetBubbleTextFont(iLafManager->PreviewBubbleFont());
|
|
1337 |
iCandidateList->SetBubbleSize(TSize(outrect.Width(),outrect.Height())); // Read laf
|
|
1338 |
iCandidateList->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX,
|
|
1339 |
innerrect.iTl.iY - outrect.iTl.iY,
|
|
1340 |
outrect.iBr.iX - innerrect.iBr.iX,
|
|
1341 |
outrect.iBr.iY - innerrect.iBr.iY);
|
|
1342 |
|
|
1343 |
}
|
|
1344 |
else
|
|
1345 |
{
|
|
1346 |
iCandidateList->ShowBubble(EFalse);
|
|
1347 |
}
|
|
1348 |
}
|
|
1349 |
|
|
1350 |
// --------------------------------------------------------------------------
|
|
1351 |
// CPeninputHwrBxAbWnd::CalculateGuideLinePos
|
|
1352 |
// (other items were commented in a header)
|
|
1353 |
// --------------------------------------------------------------------------
|
|
1354 |
//
|
|
1355 |
void CPeninputFingerHwrArWnd::CalculateGuideLinePos()
|
|
1356 |
{
|
|
1357 |
TRect rect = iWritingBox->Rect();
|
|
1358 |
TInt leftrightmargin = rect.Size().iWidth / 10;
|
|
1359 |
|
|
1360 |
CPeninputFingerHwrArLayout* hwrLayout = NULL;
|
|
1361 |
hwrLayout = static_cast<CPeninputFingerHwrArLayout*>( UiLayout() );
|
|
1362 |
|
|
1363 |
TInt bottommargin = 0;
|
|
1364 |
hwrLayout->DataStore().GetBottomGuideLinePos(bottommargin);
|
|
1365 |
|
|
1366 |
iGuideLineBottomTl.iX = rect.iTl.iX + leftrightmargin;
|
|
1367 |
iGuideLineBottomTl.iY = rect.iTl.iY + bottommargin;
|
|
1368 |
|
|
1369 |
iGuideLineBottomBr.iX = rect.iBr.iX - leftrightmargin;
|
|
1370 |
iGuideLineBottomBr.iY = rect.iTl.iY + bottommargin;
|
|
1371 |
|
|
1372 |
iWritingBox->SetBottomGuideLinePosition(iGuideLineBottomTl, iGuideLineBottomBr);
|
|
1373 |
}
|
|
1374 |
|
|
1375 |
// --------------------------------------------------------------------------
|
|
1376 |
// CPeninputFingerHwrArWnd::DrawGuideLine
|
|
1377 |
// (other items were commented in a header)
|
|
1378 |
// --------------------------------------------------------------------------
|
|
1379 |
//
|
|
1380 |
void CPeninputFingerHwrArWnd::DrawGuideLine()
|
|
1381 |
{
|
|
1382 |
if(iGuideLineOn)
|
|
1383 |
{
|
|
1384 |
TInt style = CTransparentHwrWndExt::EGuideLineBottom;
|
|
1385 |
iWritingBox->SetGuideLineStyle( style );
|
|
1386 |
|
|
1387 |
// if size changing, or guide line pos has not been set
|
|
1388 |
CalculateGuideLinePos();
|
|
1389 |
|
|
1390 |
iWritingBox->HideGuideLine(ETrue);
|
|
1391 |
}
|
|
1392 |
else
|
|
1393 |
{
|
|
1394 |
iWritingBox->HideGuideLine(EFalse);
|
|
1395 |
}
|
|
1396 |
|
|
1397 |
iWritingBox->RefreshUI();
|
|
1398 |
}
|
|
1399 |
|
|
1400 |
// --------------------------------------------------------------------------
|
|
1401 |
// CPeninputFingerHwrArWnd::OpenSymbolTable
|
|
1402 |
// Open the symbol table
|
|
1403 |
// --------------------------------------------------------------------------
|
|
1404 |
//
|
|
1405 |
void CPeninputFingerHwrArWnd::OpenSymbolTable()
|
|
1406 |
{
|
|
1407 |
if(!iSymbolTable->IsPopup() && !iNumSymbolTable->IsPopup())
|
|
1408 |
{
|
|
1409 |
SwitchToSymbolTableView();
|
|
1410 |
}
|
|
1411 |
}
|
|
1412 |
|
|
1413 |
// --------------------------------------------------------------------------
|
|
1414 |
// CPeninputFingerHwrArWnd::CloseSymbolTable
|
|
1415 |
// Close the symbol table
|
|
1416 |
// --------------------------------------------------------------------------
|
|
1417 |
//
|
|
1418 |
void CPeninputFingerHwrArWnd::CloseSymbolTable()
|
|
1419 |
{
|
|
1420 |
if(iSymbolTable->IsPopup())
|
|
1421 |
{
|
|
1422 |
iSymbolTable->CloseSymbolTable();
|
|
1423 |
iSymbolTable->BringToBack();
|
|
1424 |
SwitchToStandbyView();
|
|
1425 |
}
|
|
1426 |
else if(iNumSymbolTable->IsPopup())
|
|
1427 |
{
|
|
1428 |
iNumSymbolTable->CloseSymbolTable();
|
|
1429 |
iNumSymbolTable->BringToBack();
|
|
1430 |
SwitchToStandbyView();
|
|
1431 |
}
|
|
1432 |
}
|
|
1433 |
|
|
1434 |
// --------------------------------------------------------------------------
|
|
1435 |
// CPeninputFingerHwrArWnd::IsSymbolTableShowingUp
|
|
1436 |
// Check if the symbol table has been shown up
|
|
1437 |
// --------------------------------------------------------------------------
|
|
1438 |
//
|
|
1439 |
TBool CPeninputFingerHwrArWnd::IsSymbolTableShowingUp()
|
|
1440 |
{
|
|
1441 |
TBool ret = iSymbolTable->IsPopup() | iNumSymbolTable->IsPopup();
|
|
1442 |
return ret;
|
|
1443 |
}
|
|
1444 |
|
|
1445 |
// --------------------------------------------------------------------------
|
|
1446 |
// CPeninputFingerHwrArWnd::IsCandidateShowup
|
|
1447 |
// Check if the candadiate list has been shown up
|
|
1448 |
// --------------------------------------------------------------------------
|
|
1449 |
//
|
|
1450 |
TBool CPeninputFingerHwrArWnd::IsCandidateShowup()
|
|
1451 |
{
|
|
1452 |
if(!iCandidateList->Hiden())
|
|
1453 |
{
|
|
1454 |
return ETrue;
|
|
1455 |
}
|
|
1456 |
return EFalse;
|
|
1457 |
}
|
|
1458 |
|
|
1459 |
// --------------------------------------------------------------------------
|
|
1460 |
// CPeninputFingerHwrArWnd::IsCandidateShowup
|
|
1461 |
// Check if the candadiate list has been shown up
|
|
1462 |
// --------------------------------------------------------------------------
|
|
1463 |
//
|
|
1464 |
void CPeninputFingerHwrArWnd::HideIndicator()
|
|
1465 |
{
|
|
1466 |
iWritingBox->ShowIndicator(EFalse);
|
|
1467 |
}
|
|
1468 |
|
|
1469 |
// --------------------------------------------------------------------------
|
|
1470 |
// CPeninputFingerHwrArWnd::GetCharBeforeCursor
|
|
1471 |
// Get the char by its position in ICF editor
|
|
1472 |
// --------------------------------------------------------------------------
|
|
1473 |
//
|
|
1474 |
TBool CPeninputFingerHwrArWnd::GetCharBeforeCursor(TInt aCharPos, TUint16& aCharBeforeCursor)
|
|
1475 |
{
|
|
1476 |
TBuf<1> dataBeforeCursor;
|
|
1477 |
iContextField->ExtractText( dataBeforeCursor, aCharPos, 1 );
|
|
1478 |
|
|
1479 |
TBool isFound = EFalse;
|
|
1480 |
if(dataBeforeCursor!= KNullDesC)
|
|
1481 |
{
|
|
1482 |
aCharBeforeCursor = dataBeforeCursor[0];
|
|
1483 |
isFound = ETrue;
|
|
1484 |
}
|
|
1485 |
|
|
1486 |
return isFound;
|
|
1487 |
}
|
|
1488 |
|
|
1489 |
// ---------------------------------------------------------------------------
|
|
1490 |
// accept editor's number mapping restriction.
|
|
1491 |
// ---------------------------------------------------------------------------
|
|
1492 |
//
|
|
1493 |
void CPeninputFingerHwrArWnd::SetNumericMapping( const TDesC& aNumMapping )
|
|
1494 |
{
|
|
1495 |
iNumSymbolTable->UpdateTableSymbol(aNumMapping);
|
|
1496 |
}
|
|
1497 |
// ---------------------------------------------------------------------------
|
|
1498 |
// set native number mode on or off.
|
|
1499 |
// ---------------------------------------------------------------------------
|
|
1500 |
//
|
|
1501 |
void CPeninputFingerHwrArWnd::SetNativeNumMode(const TBool aIsNativeNumMode)
|
|
1502 |
{
|
|
1503 |
iNumSymbolTable->SetNativeNumMode(aIsNativeNumMode);
|
|
1504 |
}
|
|
1505 |
// ---------------------------------------------------------------------------
|
|
1506 |
// set icf language.
|
|
1507 |
// ---------------------------------------------------------------------------
|
|
1508 |
//
|
|
1509 |
void CPeninputFingerHwrArWnd::SetIcfLanguage( TInt aLang )
|
|
1510 |
{
|
|
1511 |
iContextField->SetLanguageId(aLang);
|
|
1512 |
}
|
|
1513 |
|
|
1514 |
// End Of File
|