|
1 /* |
|
2 * Copyright (c) 2007-2009 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: ESMR policy implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "cesmrfield.h" |
|
19 |
|
20 #include "esmrcommands.h" |
|
21 #include "cesmrborderlayer.h" |
|
22 #include "cesmrlayoutmgr.h" |
|
23 #include "nmrlayoutmanager.h" |
|
24 #include "mesmrfieldeventqueue.h" |
|
25 #include "cesmrfieldcommandevent.h" |
|
26 #include "cmrbackground.h" |
|
27 |
|
28 #include "emailtrace.h" |
|
29 |
|
30 #include <txtrich.h> |
|
31 #include <eikenv.h> |
|
32 #include <baclipb.h> |
|
33 #include <eikbtgpc.h> |
|
34 #include <StringLoader.h> |
|
35 #include <AknUtils.h> |
|
36 |
|
37 // ======== MEMBER FUNCTIONS ======== |
|
38 |
|
39 // --------------------------------------------------------------------------- |
|
40 // CESMRField::CESMRField() |
|
41 // --------------------------------------------------------------------------- |
|
42 // |
|
43 EXPORT_C CESMRField::CESMRField() |
|
44 : iCustomMsk( EFalse ), |
|
45 iDisableRedraw( EFalse ), |
|
46 iDefaultMskVisible( EFalse ), |
|
47 iMskVisible( EFalse ) |
|
48 { |
|
49 FUNC_LOG; |
|
50 // do nothing |
|
51 } |
|
52 |
|
53 |
|
54 // --------------------------------------------------------------------------- |
|
55 // CESMRField::~CESMRField() |
|
56 // --------------------------------------------------------------------------- |
|
57 // |
|
58 EXPORT_C CESMRField::~CESMRField() |
|
59 { |
|
60 FUNC_LOG; |
|
61 delete iBorder; |
|
62 if ( iEventQueue ) |
|
63 { |
|
64 iEventQueue->RemoveObserver( this ); |
|
65 } |
|
66 delete iBackground; |
|
67 } |
|
68 |
|
69 // --------------------------------------------------------------------------- |
|
70 // CESMRField::SetExpandable() |
|
71 // --------------------------------------------------------------------------- |
|
72 // |
|
73 EXPORT_C void CESMRField::SetExpandable() |
|
74 { |
|
75 FUNC_LOG; |
|
76 iExpandable = ETrue; |
|
77 } |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // CESMRField::IsExpandable() |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 EXPORT_C TBool CESMRField::IsExpandable() const |
|
84 { |
|
85 FUNC_LOG; |
|
86 return iExpandable; |
|
87 } |
|
88 |
|
89 // --------------------------------------------------------------------------- |
|
90 // CESMRField::ExpandedHeight() |
|
91 // --------------------------------------------------------------------------- |
|
92 // |
|
93 EXPORT_C TInt CESMRField::ExpandedHeight() const |
|
94 { |
|
95 FUNC_LOG; |
|
96 return 0; |
|
97 } |
|
98 |
|
99 // --------------------------------------------------------------------------- |
|
100 // CESMRField::InitializeL() |
|
101 // --------------------------------------------------------------------------- |
|
102 // |
|
103 EXPORT_C void CESMRField::InitializeL() |
|
104 { |
|
105 FUNC_LOG; |
|
106 /* Empty implementation, subclasses should overwrite */ |
|
107 } |
|
108 |
|
109 // --------------------------------------------------------------------------- |
|
110 // CESMRField::FontChangedL() |
|
111 // --------------------------------------------------------------------------- |
|
112 // |
|
113 EXPORT_C void CESMRField::FontChangedL() |
|
114 { |
|
115 FUNC_LOG; |
|
116 // This method re-initializes field |
|
117 InitializeL(); |
|
118 } |
|
119 |
|
120 // --------------------------------------------------------------------------- |
|
121 // CESMRField::SetFieldId() |
|
122 // --------------------------------------------------------------------------- |
|
123 // |
|
124 EXPORT_C void CESMRField::SetFieldId( TESMREntryFieldId aFieldId ) |
|
125 { |
|
126 FUNC_LOG; |
|
127 iFieldId = aFieldId; |
|
128 } |
|
129 |
|
130 // --------------------------------------------------------------------------- |
|
131 // CESMRField::FieldId() |
|
132 // --------------------------------------------------------------------------- |
|
133 // |
|
134 EXPORT_C TESMREntryFieldId CESMRField::FieldId() const |
|
135 { |
|
136 FUNC_LOG; |
|
137 return iFieldId; |
|
138 } |
|
139 |
|
140 // --------------------------------------------------------------------------- |
|
141 // CESMRField::ConstructL() |
|
142 // --------------------------------------------------------------------------- |
|
143 // |
|
144 EXPORT_C void CESMRField::ConstructL( |
|
145 CCoeControl* aControl, TESMRFieldFocusType aFocusType ) |
|
146 { |
|
147 FUNC_LOG; |
|
148 iBorder = CESMRBorderLayer::NewL( aControl, aFocusType ); |
|
149 iBorder->SetParent( this ); |
|
150 } |
|
151 |
|
152 // --------------------------------------------------------------------------- |
|
153 // CESMRField::SizeChanged |
|
154 // --------------------------------------------------------------------------- |
|
155 // |
|
156 EXPORT_C void CESMRField::SizeChanged() |
|
157 { |
|
158 FUNC_LOG; |
|
159 TRect rect( Rect() ); |
|
160 if ( iBorder ) |
|
161 { |
|
162 iBorder->SetRect( rect ); |
|
163 } |
|
164 } |
|
165 |
|
166 // --------------------------------------------------------------------------- |
|
167 // CESMRField::CountComponentControls |
|
168 // --------------------------------------------------------------------------- |
|
169 // |
|
170 EXPORT_C TInt CESMRField::CountComponentControls() const |
|
171 { |
|
172 FUNC_LOG; |
|
173 TInt count( 0 ); |
|
174 if ( iBorder ) |
|
175 { |
|
176 ++count; |
|
177 } |
|
178 |
|
179 return count; |
|
180 } |
|
181 |
|
182 // --------------------------------------------------------------------------- |
|
183 // CESMRField::ComponentControl() |
|
184 // --------------------------------------------------------------------------- |
|
185 // |
|
186 EXPORT_C CCoeControl* CESMRField::ComponentControl( TInt /*aInd*/ ) const |
|
187 { |
|
188 FUNC_LOG; |
|
189 return iBorder; |
|
190 } |
|
191 |
|
192 // --------------------------------------------------------------------------- |
|
193 // CESMRField::MinimumSize() |
|
194 // --------------------------------------------------------------------------- |
|
195 // |
|
196 EXPORT_C TSize CESMRField::MinimumSize() |
|
197 { |
|
198 TRect parentRect( Parent()->Rect() ); |
|
199 TAknLayoutRect listareaLayoutRect = |
|
200 NMRLayoutManager::GetLayoutRect( parentRect, NMRLayoutManager::EMRLayoutListArea ); |
|
201 TAknLayoutRect fieldLayoutRect = |
|
202 NMRLayoutManager::GetFieldLayoutRect( listareaLayoutRect.Rect(), 1 ); |
|
203 return TSize( Parent()->Size().iWidth, fieldLayoutRect.Rect().Height() ); |
|
204 } |
|
205 |
|
206 // --------------------------------------------------------------------------- |
|
207 // CESMRField::SetContainerWindowL() |
|
208 // --------------------------------------------------------------------------- |
|
209 // |
|
210 EXPORT_C void CESMRField::SetContainerWindowL(const CCoeControl& aContainer) |
|
211 { |
|
212 FUNC_LOG; |
|
213 CCoeControl::SetContainerWindowL( aContainer ); |
|
214 if ( iBorder ) |
|
215 { |
|
216 iBorder->SetContainerWindowL( aContainer ); |
|
217 } |
|
218 } |
|
219 |
|
220 // --------------------------------------------------------------------------- |
|
221 // CESMRField::SetListObserver() |
|
222 // --------------------------------------------------------------------------- |
|
223 // |
|
224 EXPORT_C void CESMRField::SetListObserver( MESMRListObserver* aObserver ) |
|
225 { |
|
226 FUNC_LOG; |
|
227 iObserver = aObserver; |
|
228 ListObserverSet(); |
|
229 } |
|
230 |
|
231 // --------------------------------------------------------------------------- |
|
232 // CESMRField::SetListObserver() |
|
233 // --------------------------------------------------------------------------- |
|
234 // |
|
235 EXPORT_C void CESMRField::ListObserverSet() |
|
236 { |
|
237 FUNC_LOG; |
|
238 // default implementation. |
|
239 } |
|
240 |
|
241 // --------------------------------------------------------------------------- |
|
242 // CESMRField::SetLayoutManager() |
|
243 // --------------------------------------------------------------------------- |
|
244 // |
|
245 EXPORT_C void CESMRField::SetLayoutManager( CESMRLayoutManager* aLayout ) |
|
246 { |
|
247 FUNC_LOG; |
|
248 iLayout = aLayout; |
|
249 if ( iBorder ) |
|
250 { |
|
251 iBorder->SetLayoutManager( iLayout ); |
|
252 } |
|
253 TRAP_IGNORE( |
|
254 iBackground = CMRBackground::NewL( *aLayout ); |
|
255 this->SetBackground( iBackground ); |
|
256 ); |
|
257 } |
|
258 |
|
259 // --------------------------------------------------------------------------- |
|
260 // CESMRField::OfferKeyEventL() |
|
261 // --------------------------------------------------------------------------- |
|
262 // |
|
263 EXPORT_C TKeyResponse CESMRField::OfferKeyEventL( |
|
264 const TKeyEvent& aEvent, TEventCode aType ) |
|
265 { |
|
266 FUNC_LOG; |
|
267 if ( iBorder ) |
|
268 { |
|
269 return iBorder->OfferKeyEventL( aEvent, aType ); |
|
270 } |
|
271 return EKeyWasNotConsumed; |
|
272 } |
|
273 |
|
274 // --------------------------------------------------------------------------- |
|
275 // CESMRField::SetOutlineFocusL() |
|
276 // --------------------------------------------------------------------------- |
|
277 // |
|
278 EXPORT_C void CESMRField::SetOutlineFocusL( TBool aFocus ) |
|
279 { |
|
280 FUNC_LOG; |
|
281 iOutlineFocus = aFocus; |
|
282 if ( iBorder ) |
|
283 { |
|
284 iBorder->SetOutlineFocusL( aFocus ); |
|
285 } |
|
286 if ( aFocus ) |
|
287 { |
|
288 CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
|
289 if ( cba ) |
|
290 { |
|
291 iDefaultMskVisible = cba->IsCommandVisibleByPosition( |
|
292 CEikButtonGroupContainer::EMiddleSoftkeyPosition ); |
|
293 iMskVisible = iDefaultMskVisible; |
|
294 } |
|
295 } |
|
296 else |
|
297 { |
|
298 RestoreMiddleSoftKeyL(); |
|
299 } |
|
300 } |
|
301 |
|
302 // --------------------------------------------------------------------------- |
|
303 // CESMRField::OkToLoseFocusL() |
|
304 // --------------------------------------------------------------------------- |
|
305 // |
|
306 EXPORT_C TBool CESMRField::OkToLoseFocusL( // codescanner::LFunctionCantLeave |
|
307 TESMREntryFieldId /*aNextItem*/ ) |
|
308 { |
|
309 FUNC_LOG; |
|
310 return ETrue; |
|
311 } |
|
312 |
|
313 // --------------------------------------------------------------------------- |
|
314 // CESMRField::GetMinimumVisibleVerticalArea |
|
315 // --------------------------------------------------------------------------- |
|
316 // |
|
317 EXPORT_C void CESMRField::GetMinimumVisibleVerticalArea( |
|
318 TInt& aUpper, TInt& aLower) |
|
319 { |
|
320 FUNC_LOG; |
|
321 aUpper = 0; |
|
322 aLower = Rect().iBr.iY - Rect().iTl.iY; |
|
323 } |
|
324 |
|
325 // --------------------------------------------------------------------------- |
|
326 // CESMRField::InternalizeL() |
|
327 // --------------------------------------------------------------------------- |
|
328 // |
|
329 EXPORT_C void CESMRField::InternalizeL( // codescanner::LFunctionCantLeave |
|
330 MESMRCalEntry& /*aEntry*/ ) |
|
331 { |
|
332 FUNC_LOG; |
|
333 /* Empty implementation, subclasses should overwrite */ |
|
334 } |
|
335 |
|
336 // --------------------------------------------------------------------------- |
|
337 // CESMRField::ExternalizeL() |
|
338 // --------------------------------------------------------------------------- |
|
339 // |
|
340 EXPORT_C void CESMRField::ExternalizeL( // codescanner::LFunctionCantLeave |
|
341 MESMRCalEntry& /*aEntry*/ ) |
|
342 { |
|
343 FUNC_LOG; |
|
344 /* Empty implementation, subclasses should overwrite */ |
|
345 } |
|
346 |
|
347 // --------------------------------------------------------------------------- |
|
348 // CESMRField::ExecuteGenericCommandL() |
|
349 // --------------------------------------------------------------------------- |
|
350 // |
|
351 EXPORT_C void CESMRField::ExecuteGenericCommandL( // codescanner::LFunctionCantLeave |
|
352 TInt /*aCommand*/ ) |
|
353 { |
|
354 FUNC_LOG; |
|
355 /* Empty implementation, subclasses should overwrite */ |
|
356 } |
|
357 |
|
358 // --------------------------------------------------------------------------- |
|
359 // CESMRField::SetTitlePaneObserver() |
|
360 // --------------------------------------------------------------------------- |
|
361 // |
|
362 EXPORT_C void CESMRField::SetTitlePaneObserver( |
|
363 MESMRTitlePaneObserver* /*aObserver*/ ) |
|
364 { |
|
365 FUNC_LOG; |
|
366 /* Empty implementation, subclasses should overwrite */ |
|
367 } |
|
368 |
|
369 // --------------------------------------------------------------------------- |
|
370 // CESMRField::ChangeMiddleSoftKeyL() |
|
371 // --------------------------------------------------------------------------- |
|
372 // |
|
373 EXPORT_C void CESMRField::ChangeMiddleSoftKeyL( TInt aCommandId, |
|
374 TInt aResourceId ) |
|
375 { |
|
376 FUNC_LOG; |
|
377 CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
|
378 if ( cba ) |
|
379 { |
|
380 HBufC* middleSKText = StringLoader::LoadLC( aResourceId, |
|
381 iCoeEnv ); |
|
382 cba->SetCommandL( |
|
383 CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
384 aCommandId, *middleSKText ); |
|
385 CleanupStack::PopAndDestroy( middleSKText ); |
|
386 if ( !iMskVisible ) |
|
387 { |
|
388 cba->MakeCommandVisibleByPosition( |
|
389 CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
390 ETrue ); |
|
391 iMskVisible = ETrue; |
|
392 } |
|
393 cba->DrawDeferred(); |
|
394 iCustomMsk = ETrue; |
|
395 } |
|
396 } |
|
397 |
|
398 // --------------------------------------------------------------------------- |
|
399 // CESMRField::ChangeMiddleSoftKeyL() |
|
400 // --------------------------------------------------------------------------- |
|
401 // |
|
402 EXPORT_C void CESMRField::ChangeMiddleSoftKeyL( TInt aResourceId ) |
|
403 { |
|
404 FUNC_LOG; |
|
405 CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
|
406 if ( cba ) |
|
407 { |
|
408 cba->SetCommandL( |
|
409 CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
410 aResourceId ); |
|
411 if ( !iMskVisible ) |
|
412 { |
|
413 cba->MakeCommandVisibleByPosition( |
|
414 CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
415 ETrue ); |
|
416 iMskVisible = ETrue; |
|
417 } |
|
418 cba->DrawDeferred(); |
|
419 iCustomMsk = ETrue; |
|
420 } |
|
421 } |
|
422 |
|
423 // --------------------------------------------------------------------------- |
|
424 // CESMRField::CalculateVisibleRect() |
|
425 // --------------------------------------------------------------------------- |
|
426 // |
|
427 EXPORT_C TRect CESMRField::CalculateVisibleRect( TRect aRect ) |
|
428 { |
|
429 FUNC_LOG; |
|
430 TRect targetRect(aRect); |
|
431 // highlight bitmap target size: |
|
432 TSize targetSize( Rect().Size() ); |
|
433 |
|
434 // fetch the size of main pane |
|
435 TRect mainPaneRect; |
|
436 AknLayoutUtils::LayoutMetricsRect( |
|
437 AknLayoutUtils::EMainPane, mainPaneRect ); |
|
438 |
|
439 // the list drawable height: |
|
440 TInt listAreaHeight = mainPaneRect.Height() - iLayout->TitlePaneHeight(); |
|
441 |
|
442 // if the size of field is larger than drawable height |
|
443 // let's downsize it: |
|
444 if ( Rect().Size().iHeight > listAreaHeight ) |
|
445 { |
|
446 TInt shownHeight = Rect().Size().iHeight + Rect().iTl.iY; |
|
447 // check should the highlight be smaller than |
|
448 // whole screen: |
|
449 if ( shownHeight < listAreaHeight ) |
|
450 { |
|
451 targetSize.iHeight = shownHeight; |
|
452 } |
|
453 else |
|
454 { |
|
455 targetSize.iHeight = listAreaHeight; |
|
456 } |
|
457 } |
|
458 |
|
459 // If part of the rect is not visible: |
|
460 if ( targetRect.iTl.iY < 0 ) |
|
461 { |
|
462 targetRect.iTl.iY = 0; |
|
463 } |
|
464 |
|
465 // visible height: |
|
466 targetRect.SetHeight(listAreaHeight); |
|
467 |
|
468 return targetRect; |
|
469 } |
|
470 |
|
471 // --------------------------------------------------------------------------- |
|
472 // CESMRField::SetEventQueueL() |
|
473 // --------------------------------------------------------------------------- |
|
474 // |
|
475 EXPORT_C void CESMRField::SetEventQueueL( MESMRFieldEventQueue* aEventQueue ) |
|
476 { |
|
477 FUNC_LOG; |
|
478 if ( aEventQueue != iEventQueue ) |
|
479 { |
|
480 if ( aEventQueue ) |
|
481 { |
|
482 // Add self to new queue |
|
483 aEventQueue->AddObserverL( this ); |
|
484 } |
|
485 |
|
486 if ( iEventQueue ) |
|
487 { |
|
488 // Remove self from old queue |
|
489 iEventQueue->RemoveObserver( this ); |
|
490 } |
|
491 |
|
492 iEventQueue = aEventQueue; |
|
493 } |
|
494 } |
|
495 |
|
496 // --------------------------------------------------------------------------- |
|
497 // CESMRField::HasOutlineFocus() |
|
498 // --------------------------------------------------------------------------- |
|
499 // |
|
500 EXPORT_C TBool CESMRField::HasOutlineFocus() const |
|
501 { |
|
502 return iOutlineFocus; |
|
503 } |
|
504 |
|
505 // --------------------------------------------------------------------------- |
|
506 // CESMRField::GetFocusRect() |
|
507 // --------------------------------------------------------------------------- |
|
508 // |
|
509 EXPORT_C TRect CESMRField::GetFocusRect() const |
|
510 { |
|
511 return iFocusRect; |
|
512 } |
|
513 |
|
514 // --------------------------------------------------------------------------- |
|
515 // CESMRField::SetFocusRect() |
|
516 // --------------------------------------------------------------------------- |
|
517 // |
|
518 EXPORT_C void CESMRField::SetFocusRect( const TRect& aFocusRect ) |
|
519 { |
|
520 iFocusRect = aFocusRect; |
|
521 } |
|
522 |
|
523 // --------------------------------------------------------------------------- |
|
524 // CESMRField::GetFocusType() |
|
525 // --------------------------------------------------------------------------- |
|
526 // |
|
527 EXPORT_C TESMRFieldFocusType CESMRField::GetFocusType() const |
|
528 { |
|
529 return iFocusType; |
|
530 } |
|
531 |
|
532 // --------------------------------------------------------------------------- |
|
533 // CESMRField::SetFocusType() |
|
534 // --------------------------------------------------------------------------- |
|
535 // |
|
536 EXPORT_C void CESMRField::SetFocusType( TESMRFieldFocusType aFocusType ) |
|
537 { |
|
538 iFocusType = aFocusType; |
|
539 } |
|
540 |
|
541 // --------------------------------------------------------------------------- |
|
542 // CESMRField::NotifyEventL() |
|
543 // --------------------------------------------------------------------------- |
|
544 // |
|
545 EXPORT_C void CESMRField::NotifyEventL( const MESMRFieldEvent& aEvent ) |
|
546 { |
|
547 FUNC_LOG; |
|
548 if ( iEventQueue ) |
|
549 { |
|
550 iEventQueue->NotifyEventL( aEvent ); |
|
551 } |
|
552 } |
|
553 |
|
554 // --------------------------------------------------------------------------- |
|
555 // CESMRField::NotifyEventL() |
|
556 // --------------------------------------------------------------------------- |
|
557 // |
|
558 EXPORT_C void CESMRField::NotifyEventL( TInt aCommand ) |
|
559 { |
|
560 FUNC_LOG; |
|
561 CESMRFieldCommandEvent* event = CESMRFieldCommandEvent::NewLC( this, |
|
562 aCommand ); |
|
563 NotifyEventL( *event ); |
|
564 CleanupStack::PopAndDestroy( event ); |
|
565 } |
|
566 |
|
567 // --------------------------------------------------------------------------- |
|
568 // CESMRField::NotifyEventAsyncL() |
|
569 // --------------------------------------------------------------------------- |
|
570 // |
|
571 EXPORT_C void CESMRField::NotifyEventAsyncL( MESMRFieldEvent* aEvent ) |
|
572 { |
|
573 FUNC_LOG; |
|
574 if ( iEventQueue ) |
|
575 { |
|
576 iEventQueue->NotifyEventAsyncL( aEvent ); |
|
577 } |
|
578 } |
|
579 |
|
580 // --------------------------------------------------------------------------- |
|
581 // CESMRField::NotifyEventAsyncL() |
|
582 // --------------------------------------------------------------------------- |
|
583 // |
|
584 EXPORT_C void CESMRField::NotifyEventAsyncL( TInt aCommand ) |
|
585 { |
|
586 FUNC_LOG; |
|
587 CESMRFieldCommandEvent* event = CESMRFieldCommandEvent::NewLC( this, |
|
588 aCommand ); |
|
589 NotifyEventAsyncL( event ); |
|
590 CleanupStack::Pop( event ); |
|
591 } |
|
592 |
|
593 // --------------------------------------------------------------------------- |
|
594 // CESMRField::RestoreMiddleSoftKeyL() |
|
595 // --------------------------------------------------------------------------- |
|
596 // |
|
597 EXPORT_C void CESMRField::RestoreMiddleSoftKeyL() |
|
598 { |
|
599 FUNC_LOG; |
|
600 if ( iMskVisible != iDefaultMskVisible ) |
|
601 { |
|
602 SetMiddleSoftKeyVisible( iDefaultMskVisible ); |
|
603 } |
|
604 |
|
605 if ( iCustomMsk ) |
|
606 { |
|
607 NotifyEventL( EESMRCmdRestoreMiddleSoftKey ); |
|
608 iCustomMsk = EFalse; |
|
609 } |
|
610 } |
|
611 |
|
612 EXPORT_C void CESMRField::SetMiddleSoftKeyVisible( TBool aVisible ) |
|
613 { |
|
614 FUNC_LOG; |
|
615 if ( iMskVisible != aVisible ) |
|
616 { |
|
617 CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
|
618 if ( cba ) |
|
619 { |
|
620 cba->MakeCommandVisibleByPosition( |
|
621 CEikButtonGroupContainer::EMiddleSoftkeyPosition, |
|
622 aVisible ); |
|
623 iMskVisible = aVisible; // Visibility has been changed |
|
624 } |
|
625 } |
|
626 |
|
627 iCustomMsk = ETrue; // Field has modified editor default MSK |
|
628 } |
|
629 |
|
630 // --------------------------------------------------------------------------- |
|
631 // CESMRField::HandleFieldEventL() |
|
632 // --------------------------------------------------------------------------- |
|
633 // |
|
634 EXPORT_C void CESMRField::HandleFieldEventL( const MESMRFieldEvent& aEvent ) |
|
635 { |
|
636 FUNC_LOG; |
|
637 if ( aEvent.Type() == MESMRFieldEvent::EESMRFieldCommandEvent ) |
|
638 { |
|
639 TInt* command = static_cast<TInt*>( aEvent.Param( 0 ) ); |
|
640 if ( EESMRCmdSizeExceeded != *command ) |
|
641 { |
|
642 ExecuteGenericCommandL( *command ); |
|
643 } |
|
644 } |
|
645 } |
|
646 |
|
647 // --------------------------------------------------------------------------- |
|
648 // CESMRField::EventObserver() |
|
649 // --------------------------------------------------------------------------- |
|
650 // |
|
651 EXPORT_C MESMRFieldEventObserver* CESMRField::EventObserver() const |
|
652 { |
|
653 FUNC_LOG; |
|
654 return const_cast< CESMRField* >( this ); |
|
655 } |
|
656 |
|
657 // --------------------------------------------------------------------------- |
|
658 // CESMRField::SetFieldMode() |
|
659 // --------------------------------------------------------------------------- |
|
660 // |
|
661 EXPORT_C void CESMRField::SetFieldMode( TESMRFieldMode aMode ) |
|
662 { |
|
663 iFieldMode = aMode; |
|
664 } |
|
665 |
|
666 // --------------------------------------------------------------------------- |
|
667 // CESMRField::FieldMode() |
|
668 // --------------------------------------------------------------------------- |
|
669 // |
|
670 EXPORT_C TESMRFieldMode CESMRField::FieldMode() const |
|
671 { |
|
672 return iFieldMode; |
|
673 } |
|
674 // EOF |
|
675 |