75 #include <StringLoader.h> |
75 #include <StringLoader.h> |
76 |
76 |
77 #include <AknTasHook.h> // for testability hooks |
77 #include <AknTasHook.h> // for testability hooks |
78 #include <tacticon.h> |
78 #include <tacticon.h> |
79 |
79 |
|
80 #include "akntrace.h" |
80 const TInt KPinCodeTacticonInterval = 30000000; // 30s |
81 const TInt KPinCodeTacticonInterval = 30000000; // 30s |
81 const TInt KPinCodeMaxTacticons = 10; |
82 const TInt KPinCodeMaxTacticons = 10; |
82 /******* |
83 /******* |
83 * CAknQueryControlExtension |
84 * CAknQueryControlExtension |
84 */ |
85 */ |
108 TInt iPinTacticonsPlayed; |
109 TInt iPinTacticonsPlayed; |
109 }; |
110 }; |
110 |
111 |
111 CAknQueryControlExtension::~CAknQueryControlExtension() |
112 CAknQueryControlExtension::~CAknQueryControlExtension() |
112 { |
113 { |
|
114 _AKNTRACE_FUNC_ENTER; |
113 delete iOriginalPrompt; |
115 delete iOriginalPrompt; |
114 delete iBackspaceButton; |
116 delete iBackspaceButton; |
115 delete iKeypad; |
117 delete iKeypad; |
116 |
118 |
117 delete iPinTacticonTimer; |
119 delete iPinTacticonTimer; |
118 iPinTacticonTimer = NULL; |
120 iPinTacticonTimer = NULL; |
|
121 _AKNTRACE_FUNC_EXIT; |
119 } |
122 } |
120 |
123 |
121 CAknLocationEditor *CAknQueryControl::LocationEd() const |
124 CAknLocationEditor *CAknQueryControl::LocationEd() const |
122 { |
125 { |
123 if (iExtension) |
126 if (iExtension) |
135 * CAknQueryExtension |
138 * CAknQueryExtension |
136 *****************************/ |
139 *****************************/ |
137 |
140 |
138 void CAknQueryExtension::CreateEditorContextL() |
141 void CAknQueryExtension::CreateEditorContextL() |
139 { |
142 { |
|
143 _AKNTRACE_FUNC_ENTER; |
140 delete iEditorContext; |
144 delete iEditorContext; |
141 iEditorContext = NULL; |
145 iEditorContext = NULL; |
142 iEditorContext = CAknsFrameBackgroundControlContext::NewL( |
146 iEditorContext = CAknsFrameBackgroundControlContext::NewL( |
143 KAknsIIDQsnFrInput, TRect(0,0,1,1), TRect(0,0,1,1), EFalse ); |
147 KAknsIIDQsnFrInput, TRect(0,0,1,1), TRect(0,0,1,1), EFalse ); |
|
148 _AKNTRACE_FUNC_EXIT; |
144 } |
149 } |
145 |
150 |
146 CAknsFrameBackgroundControlContext* CAknQueryExtension::EditorContext() |
151 CAknsFrameBackgroundControlContext* CAknQueryExtension::EditorContext() |
147 { |
152 { |
148 return iEditorContext; |
153 return iEditorContext; |
157 } |
162 } |
158 |
163 |
159 void CAknQueryExtension::CreateExtensionL( |
164 void CAknQueryExtension::CreateExtensionL( |
160 const CAknQueryControl* aQueryControl ) |
165 const CAknQueryControl* aQueryControl ) |
161 { |
166 { |
|
167 _AKNTRACE_FUNC_ENTER; |
162 CAknQueryExtension* extension = CAknQueryExtension::NewL(); |
168 CAknQueryExtension* extension = CAknQueryExtension::NewL(); |
163 CleanupStack::PushL( extension ); |
169 CleanupStack::PushL( extension ); |
164 AknsPointerStore::StorePointerL( |
170 AknsPointerStore::StorePointerL( |
165 static_cast<const CBase*>(aQueryControl), extension ); |
171 static_cast<const CBase*>(aQueryControl), extension ); |
166 CleanupStack::Pop(); // extension |
172 CleanupStack::Pop(); // extension |
|
173 _AKNTRACE_FUNC_EXIT; |
167 } |
174 } |
168 |
175 |
169 void CAknQueryExtension::DestroyExtension( |
176 void CAknQueryExtension::DestroyExtension( |
170 const CAknQueryControl* aQueryControl ) |
177 const CAknQueryControl* aQueryControl ) |
171 { |
178 { |
|
179 _AKNTRACE_FUNC_ENTER; |
172 delete Instance( aQueryControl ); |
180 delete Instance( aQueryControl ); |
173 AknsPointerStore::RemovePointer( |
181 AknsPointerStore::RemovePointer( |
174 static_cast<const CBase*>(aQueryControl) ); |
182 static_cast<const CBase*>(aQueryControl) ); |
|
183 _AKNTRACE_FUNC_EXIT; |
175 } |
184 } |
176 |
185 |
177 CAknQueryExtension* CAknQueryExtension::NewL() |
186 CAknQueryExtension* CAknQueryExtension::NewL() |
178 { |
187 { |
179 return new (ELeave) CAknQueryExtension(); |
188 return new (ELeave) CAknQueryExtension(); |
180 } |
189 } |
181 |
190 |
182 CAknQueryExtension::~CAknQueryExtension() |
191 CAknQueryExtension::~CAknQueryExtension() |
183 { |
192 { |
184 delete iEditorContext; |
193 delete iEditorContext; |
|
194 _AKNTRACE( "[%s][%s]exit", "CAknQueryExtension", "~CAknQueryExtension" ); |
185 } |
195 } |
186 |
196 |
187 /***************************** |
197 /***************************** |
188 * TAknQueryEcsObserver |
198 * TAknQueryEcsObserver |
189 *****************************/ |
199 *****************************/ |
212 |
222 |
213 |
223 |
214 EXPORT_C void TAknQueryEcsObserver::HandleEcsEvent( CAknEcsDetector* /*aDetector*/, |
224 EXPORT_C void TAknQueryEcsObserver::HandleEcsEvent( CAknEcsDetector* /*aDetector*/, |
215 CAknEcsDetector::TState aUpdatedState ) |
225 CAknEcsDetector::TState aUpdatedState ) |
216 { |
226 { |
|
227 _AKNTRACE( "[%s][%s] aUpdatedState: %d", "TAknQueryEcsObserver", __FUNCTION__,aUpdatedState); |
217 TRAP_IGNORE( iParent->SetEcsCbaVisibleL( aUpdatedState == CAknEcsDetector::ECompleteMatch ) ); |
228 TRAP_IGNORE( iParent->SetEcsCbaVisibleL( aUpdatedState == CAknEcsDetector::ECompleteMatch ) ); |
218 |
229 |
219 // Hide the emergency call number again. |
230 // Hide the emergency call number again. |
220 // Number should be visible only in Partial or Complete match state |
231 // Number should be visible only in Partial or Complete match state |
221 if ( aUpdatedState != CAknEcsDetector::EPartialMatch && |
232 if ( aUpdatedState != CAknEcsDetector::EPartialMatch && |
222 aUpdatedState != CAknEcsDetector::ECompleteMatch ) |
233 aUpdatedState != CAknEcsDetector::ECompleteMatch ) |
223 { |
234 { |
224 if ( iParent->QueryType() == EPinLayout ) |
235 if ( iParent->QueryType() == EPinLayout ) |
225 { |
236 { |
|
237 _AKNTRACE( "[%s][%s] ", "RevealSecretText( EFalse )", __FUNCTION__); |
226 static_cast<CAknNumericSecretEditor*> |
238 static_cast<CAknNumericSecretEditor*> |
227 ( iParent->ControlByLayoutOrNull( EPinLayout ) )->RevealSecretText( EFalse ); |
239 ( iParent->ControlByLayoutOrNull( EPinLayout ) )->RevealSecretText( EFalse ); |
228 } |
240 } |
229 } |
241 } |
230 |
242 |
231 // This check must be last action in the routine. |
243 // This check must be last action in the routine. |
232 // If the query is cancelled, the iParent is deleted! |
244 // If the query is cancelled, the iParent is deleted! |
233 if ( aUpdatedState == CAknEcsDetector::ECallAttempted ) |
245 if ( aUpdatedState == CAknEcsDetector::ECallAttempted ) |
234 { |
246 { |
|
247 _AKNTRACE( "[%s][%s] ", "cancel query", __FUNCTION__); |
235 TRAP_IGNORE( iParent->CancelQueryL() ); |
248 TRAP_IGNORE( iParent->CancelQueryL() ); |
236 } |
249 } |
|
250 _AKNTRACE_FUNC_EXIT; |
237 } |
251 } |
238 |
252 |
239 |
253 |
240 const TInt KMaxLinesInQuery=5; |
254 const TInt KMaxLinesInQuery=5; |
241 |
255 |
292 /** |
306 /** |
293 * |
307 * |
294 */ |
308 */ |
295 EXPORT_C CAknQueryControl::~CAknQueryControl() |
309 EXPORT_C CAknQueryControl::~CAknQueryControl() |
296 { |
310 { |
|
311 _AKNTRACE( "[%s][%s] enter", "CAknQueryControl", "~CAknQueryControl"); |
297 AKNTASHOOK_REMOVE(); |
312 AKNTASHOOK_REMOVE(); |
298 if (iEdwin) |
313 if (iEdwin) |
299 AknsUtils::DeregisterControlPosition(iEdwin); |
314 AknsUtils::DeregisterControlPosition(iEdwin); |
300 else if (iNumberEdwin) |
315 else if (iNumberEdwin) |
301 AknsUtils::DeregisterControlPosition(iNumberEdwin); |
316 AknsUtils::DeregisterControlPosition(iNumberEdwin); |
348 |
363 |
349 #if defined( RD_SCALABLE_UI_V2) |
364 #if defined( RD_SCALABLE_UI_V2) |
350 delete iIncreaseValueButton; |
365 delete iIncreaseValueButton; |
351 delete iDecreaseValueButton; |
366 delete iDecreaseValueButton; |
352 #endif //defined( RD_SCALABLE_UI_V2) |
367 #endif //defined( RD_SCALABLE_UI_V2) |
|
368 _AKNTRACE( "[%s][%s] exit", "CAknQueryControl", "~CAknQueryControl"); |
353 } |
369 } |
354 |
370 |
355 /** |
371 /** |
356 * Construct from resource |
372 * Construct from resource |
357 */ |
373 */ |
358 EXPORT_C void CAknQueryControl::ConstructFromResourceL(TResourceReader &aRes) |
374 EXPORT_C void CAknQueryControl::ConstructFromResourceL(TResourceReader &aRes) |
359 { |
375 { |
|
376 _AKNTRACE_FUNC_ENTER; |
360 // Construct extension |
377 // Construct extension |
361 CAknQueryExtension::CreateExtensionL( this ); |
378 CAknQueryExtension::CreateExtensionL( this ); |
362 iExtension = new (ELeave)CAknQueryControlExtension; |
379 iExtension = new (ELeave)CAknQueryControlExtension; |
363 |
380 |
364 iEcsObserver = new (ELeave) TAknQueryEcsObserver(this); |
381 iEcsObserver = new (ELeave) TAknQueryEcsObserver(this); |
401 cba->SetPosition( TPoint( 0, 0 ) ); |
418 cba->SetPosition( TPoint( 0, 0 ) ); |
402 |
419 |
403 iExtension->iKeypad = CAknKeypad::NewL( *this, iQueryType ); |
420 iExtension->iKeypad = CAknKeypad::NewL( *this, iQueryType ); |
404 } |
421 } |
405 } |
422 } |
|
423 _AKNTRACE_FUNC_EXIT; |
406 } |
424 } |
407 |
425 |
408 void CAknQueryControl::ConstructQueryL(TResourceReader& aRes) |
426 void CAknQueryControl::ConstructQueryL(TResourceReader& aRes) |
409 { |
427 { |
|
428 _AKNTRACE( "[%s][%s] iQueryType : %d", "CAknQueryControl", "ConstructQueryL", iQueryType ); |
410 switch(iQueryType) |
429 switch(iQueryType) |
411 { |
430 { |
412 case EConfirmationQueryLayout: |
431 case EConfirmationQueryLayout: |
413 { |
432 { |
414 TPtrC bmpFile=aRes.ReadTPtrC(); |
433 TPtrC bmpFile=aRes.ReadTPtrC(); |
718 CAknQueryExtension* extension = QueryExtension(); |
737 CAknQueryExtension* extension = QueryExtension(); |
719 if( extension ) |
738 if( extension ) |
720 { |
739 { |
721 extension->CreateEditorContextL(); |
740 extension->CreateEditorContextL(); |
722 } |
741 } |
|
742 _AKNTRACE_FUNC_EXIT; |
723 } |
743 } |
724 |
744 |
725 TInt CAknQueryControl::PinCodeTimeoutCallback( TAny* aThis ) |
745 TInt CAknQueryControl::PinCodeTimeoutCallback( TAny* aThis ) |
726 { |
746 { |
|
747 _AKNTRACE_FUNC_ENTER; |
727 // play tacticon |
748 // play tacticon |
728 static_cast<CAknQueryControl*>( aThis )->PlayPinCodeTacticon(); |
749 static_cast<CAknQueryControl*>( aThis )->PlayPinCodeTacticon(); |
729 |
750 _AKNTRACE_FUNC_EXIT; |
730 return KErrNone; |
751 return KErrNone; |
731 } |
752 } |
732 |
753 |
733 void CAknQueryControl::PlayPinCodeTacticon() |
754 void CAknQueryControl::PlayPinCodeTacticon() |
734 { |
755 { |
|
756 _AKNTRACE_FUNC_ENTER; |
735 // play tacticon |
757 // play tacticon |
736 RTacticon client; |
758 RTacticon client; |
737 if ( KErrNone == client.Connect() ) |
759 if ( KErrNone == client.Connect() ) |
738 { |
760 { |
739 client.PlayTacticon( ENeutralTacticon ); |
761 client.PlayTacticon( ENeutralTacticon ); |
775 iExtension->iPinTacticonTimer->Start( |
799 iExtension->iPinTacticonTimer->Start( |
776 KPinCodeTacticonInterval, KPinCodeTacticonInterval, |
800 KPinCodeTacticonInterval, KPinCodeTacticonInterval, |
777 TCallBack( PinCodeTimeoutCallback, this ) ); |
801 TCallBack( PinCodeTimeoutCallback, this ) ); |
778 } |
802 } |
779 } |
803 } |
|
804 _AKNTRACE_FUNC_EXIT; |
780 } |
805 } |
781 |
806 |
782 void CAknQueryControl::StopPinCodeTacticonTimer() |
807 void CAknQueryControl::StopPinCodeTacticonTimer() |
783 { |
808 { |
|
809 _AKNTRACE_FUNC_ENTER; |
784 if ( iExtension ) |
810 if ( iExtension ) |
785 { |
811 { |
786 // delete timer |
812 // delete timer |
787 delete iExtension->iPinTacticonTimer; |
813 delete iExtension->iPinTacticonTimer; |
788 |
814 |
789 // set the timer null, so that it will not be used again |
815 // set the timer null, so that it will not be used again |
790 iExtension->iPinTacticonTimer = NULL; |
816 iExtension->iPinTacticonTimer = NULL; |
791 } |
817 } |
|
818 _AKNTRACE_FUNC_EXIT; |
792 } |
819 } |
793 |
820 |
794 /// |
821 /// |
795 /// CCoeControl methods |
822 /// CCoeControl methods |
796 /// |
823 /// |
923 /** |
950 /** |
924 * Forward key event to the editor |
951 * Forward key event to the editor |
925 */ |
952 */ |
926 EXPORT_C TKeyResponse CAknQueryControl::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType) |
953 EXPORT_C TKeyResponse CAknQueryControl::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType) |
927 { |
954 { |
|
955 _AKNTRACE( "[%s][%s] aKeyEvent.iCode :%d, aType:%d ", "CAknQueryControl", __FUNCTION__, aKeyEvent.iCode, aType); |
928 TKeyResponse response( EKeyWasNotConsumed ); |
956 TKeyResponse response( EKeyWasNotConsumed ); |
929 |
957 |
930 // Send key handling for emergency call support |
958 // Send key handling for emergency call support |
931 if ( aKeyEvent.iCode == EKeyYes ) |
959 if ( aKeyEvent.iCode == EKeyYes ) |
932 { |
960 { |
2529 * from within some other non-key event that subsequently does not require references to the object |
2559 * from within some other non-key event that subsequently does not require references to the object |
2530 * |
2560 * |
2531 */ |
2561 */ |
2532 void CAknQueryControl::CancelQueryL() |
2562 void CAknQueryControl::CancelQueryL() |
2533 { |
2563 { |
|
2564 _AKNTRACE_FUNC_ENTER; |
2534 if (iQueryControlObserver) |
2565 if (iQueryControlObserver) |
2535 { |
2566 { |
2536 iQueryControlObserver->HandleQueryEditorStateEventL(this, MAknQueryControlObserver::EEmergencyCallAttempted, MAknQueryControlObserver::EEditorValueValid); |
2567 iQueryControlObserver->HandleQueryEditorStateEventL(this, MAknQueryControlObserver::EEmergencyCallAttempted, MAknQueryControlObserver::EEditorValueValid); |
2537 } |
2568 } |
2538 else |
2569 else |
2541 key.iCode=EKeyEscape; |
2572 key.iCode=EKeyEscape; |
2542 key.iModifiers=0; |
2573 key.iModifiers=0; |
2543 key.iScanCode = EStdKeyNull; |
2574 key.iScanCode = EStdKeyNull; |
2544 iEikonEnv->SimulateKeyEventL(key, EEventKey); |
2575 iEikonEnv->SimulateKeyEventL(key, EEventKey); |
2545 } |
2576 } |
|
2577 _AKNTRACE_FUNC_EXIT; |
2546 } |
2578 } |
2547 |
2579 |
2548 /** |
2580 /** |
2549 * This method looks at the flags that have been set in the query control and |
2581 * This method looks at the flags that have been set in the query control and |
2550 * acts upon them if possible |
2582 * acts upon them if possible |
2598 iEditIndicator->SetFlags( aFlags ); |
2630 iEditIndicator->SetFlags( aFlags ); |
2599 } |
2631 } |
2600 |
2632 |
2601 EXPORT_C void CAknQueryControl::SetImageL(CEikImage* aImage) |
2633 EXPORT_C void CAknQueryControl::SetImageL(CEikImage* aImage) |
2602 { // Gets ownership of the aImage |
2634 { // Gets ownership of the aImage |
2603 |
2635 _AKNTRACE_FUNC_ENTER; |
2604 if ( iImage && iImage->IsPictureOwnedExternally() ) |
2636 if ( iImage && iImage->IsPictureOwnedExternally() ) |
2605 { |
2637 { |
2606 delete ((CApaMaskedBitmap*) iImage->Bitmap()); |
2638 delete ((CApaMaskedBitmap*) iImage->Bitmap()); |
2607 } |
2639 } |
2608 |
2640 |
2616 |
2648 |
2617 delete iAnimation; |
2649 delete iAnimation; |
2618 iAnimation = NULL; |
2650 iAnimation = NULL; |
2619 |
2651 |
2620 Layout(); |
2652 Layout(); |
|
2653 _AKNTRACE_FUNC_EXIT; |
2621 } |
2654 } |
2622 |
2655 |
2623 EXPORT_C void CAknQueryControl::SetImageL(const TDesC& aImageFile, |
2656 EXPORT_C void CAknQueryControl::SetImageL(const TDesC& aImageFile, |
2624 TInt aBmpId, TInt aBmpMaskId) |
2657 TInt aBmpId, TInt aBmpMaskId) |
2625 { |
2658 { |
|
2659 _AKNTRACE_FUNC_ENTER; |
2626 CEikImage* image = new(ELeave) CEikImage; |
2660 CEikImage* image = new(ELeave) CEikImage; |
2627 CleanupStack::PushL( image ); |
2661 CleanupStack::PushL( image ); |
2628 |
2662 |
2629 TBool skinnedFound( EFalse ); |
2663 TBool skinnedFound( EFalse ); |
2630 if ( aImageFile.CompareF(KAvkonBitmapFile) == 0 ) // Skinning is supported only avkon bitmaps |
2664 if ( aImageFile.CompareF(KAvkonBitmapFile) == 0 ) // Skinning is supported only avkon bitmaps |
2651 image->CreatePictureFromFileL(aImageFile,aBmpId,aBmpMaskId); |
2685 image->CreatePictureFromFileL(aImageFile,aBmpId,aBmpMaskId); |
2652 } |
2686 } |
2653 |
2687 |
2654 CleanupStack::Pop(); //image |
2688 CleanupStack::Pop(); //image |
2655 SetImageL(image); // gets ownership |
2689 SetImageL(image); // gets ownership |
|
2690 _AKNTRACE_FUNC_EXIT; |
2656 } |
2691 } |
2657 |
2692 |
2658 EXPORT_C void CAknQueryControl::SetAnimationL(TInt aResource) |
2693 EXPORT_C void CAknQueryControl::SetAnimationL(TInt aResource) |
2659 { |
2694 { |
|
2695 _AKNTRACE_FUNC_ENTER; |
2660 delete iAnimation; |
2696 delete iAnimation; |
2661 iAnimation = NULL; |
2697 iAnimation = NULL; |
2662 iAnimation = CAknBitmapAnimation::NewL(); |
2698 iAnimation = CAknBitmapAnimation::NewL(); |
2663 iAnimation->SetContainerWindowL(*this); |
2699 iAnimation->SetContainerWindowL(*this); |
2664 |
2700 |
2675 // Save the animation resource id, because this function will be re-called |
2711 // Save the animation resource id, because this function will be re-called |
2676 // when handling resource change. |
2712 // when handling resource change. |
2677 iExtension->iAnimationId = aResource; |
2713 iExtension->iAnimationId = aResource; |
2678 |
2714 |
2679 Layout(); |
2715 Layout(); |
|
2716 _AKNTRACE_FUNC_EXIT; |
2680 } |
2717 } |
2681 |
2718 |
2682 EXPORT_C void CAknQueryControl::StartAnimationL() |
2719 EXPORT_C void CAknQueryControl::StartAnimationL() |
2683 { |
2720 { |
|
2721 _AKNTRACE_FUNC_ENTER; |
2684 if (iAnimation) |
2722 if (iAnimation) |
2685 { |
2723 { |
2686 CBitmapAnimClientData *animClientData = iAnimation->BitmapAnimData(); |
2724 CBitmapAnimClientData *animClientData = iAnimation->BitmapAnimData(); |
2687 if (animClientData != NULL && animClientData->FrameArray().Count() <= 1) |
2725 if (animClientData != NULL && animClientData->FrameArray().Count() <= 1) |
2688 { |
2726 { |
2723 CleanupStack::Pop(bitmap); |
2761 CleanupStack::Pop(bitmap); |
2724 } |
2762 } |
2725 |
2763 |
2726 iAnimation->StartAnimationL(); |
2764 iAnimation->StartAnimationL(); |
2727 } |
2765 } |
|
2766 _AKNTRACE_FUNC_EXIT; |
2728 } |
2767 } |
2729 |
2768 |
2730 EXPORT_C TInt CAknQueryControl::CancelAnimation() |
2769 EXPORT_C TInt CAknQueryControl::CancelAnimation() |
2731 { |
2770 { |
2732 if ( iAnimation ) |
2771 _AKNTRACE_FUNC_ENTER; |
2733 { |
2772 TInt result(KErrGeneral); |
2734 return iAnimation->CancelAnimation(); |
2773 if ( iAnimation ) |
2735 } |
2774 { |
2736 return KErrGeneral; |
2775 result = iAnimation->CancelAnimation(); |
|
2776 } |
|
2777 _AKNTRACE( "[%s][%s] return %d", "CAknQueryControl", "CancelAnimation", result); |
|
2778 return result; |
2737 } |
2779 } |
2738 |
2780 |
2739 |
2781 |
2740 |
2782 |
2741 /** |
2783 /** |
2978 } |
3020 } |
2979 |
3021 |
2980 // Callback for doing a redraw when animating pictographs |
3022 // Callback for doing a redraw when animating pictographs |
2981 TInt CAknQueryControl::StaticPictographCallBack( TAny* aPtr ) |
3023 TInt CAknQueryControl::StaticPictographCallBack( TAny* aPtr ) |
2982 { |
3024 { |
|
3025 _AKNTRACE_FUNC_ENTER; |
2983 CAknQueryControl* me = static_cast<CAknQueryControl*>( aPtr ); |
3026 CAknQueryControl* me = static_cast<CAknQueryControl*>( aPtr ); |
2984 me->PictographCallBack(); |
3027 me->PictographCallBack(); |
|
3028 _AKNTRACE_FUNC_EXIT; |
2985 return KErrNone; |
3029 return KErrNone; |
2986 } |
3030 } |
2987 |
3031 |
2988 void CAknQueryControl::PictographCallBack() |
3032 void CAknQueryControl::PictographCallBack() |
2989 { |
3033 { |
|
3034 _AKNTRACE_FUNC_ENTER; |
2990 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
3035 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
2991 MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); |
3036 MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); |
2992 |
3037 |
2993 for ( TInt i = 0 ; i < iPrompt->NumberOfLines() ; i++ ) |
3038 for ( TInt i = 0 ; i < iPrompt->NumberOfLines() ; i++ ) |
2994 { |
3039 { |
3023 iPrompt->Line( i )->ActivateL(); // Never leaves |
3068 iPrompt->Line( i )->ActivateL(); // Never leaves |
3024 iPrompt->Line( i )->DrawNow(); |
3069 iPrompt->Line( i )->DrawNow(); |
3025 iPrompt->SetLineModified( i, EFalse ); |
3070 iPrompt->SetLineModified( i, EFalse ); |
3026 } |
3071 } |
3027 } |
3072 } |
|
3073 _AKNTRACE_FUNC_EXIT; |
3028 } |
3074 } |
3029 |
3075 |
3030 TBool CAknQueryControl::EmbeddedVirtualInput() const |
3076 TBool CAknQueryControl::EmbeddedVirtualInput() const |
3031 { |
3077 { |
3032 if ( !QueryExtension()->iVirtualInputStatusFlags.IsSet( CAknQueryExtension::EVirtualInputCheckedAlready ) ) |
3078 if ( !QueryExtension()->iVirtualInputStatusFlags.IsSet( CAknQueryExtension::EVirtualInputCheckedAlready ) ) |
3058 } |
3104 } |
3059 |
3105 |
3060 |
3106 |
3061 CEikDialog* CAknQueryControl::Dialog() const |
3107 CEikDialog* CAknQueryControl::Dialog() const |
3062 { |
3108 { |
|
3109 _AKNTRACE_FUNC_ENTER; |
3063 CAknQueryControl* control = const_cast<CAknQueryControl*>( this ); |
3110 CAknQueryControl* control = const_cast<CAknQueryControl*>( this ); |
3064 |
3111 |
3065 CEikDialog* dialog = NULL; |
3112 CEikDialog* dialog = NULL; |
3066 control->MopGetObject( dialog ); |
3113 control->MopGetObject( dialog ); |
|
3114 _AKNTRACE_FUNC_EXIT; |
3067 return dialog; |
3115 return dialog; |
3068 } |
3116 } |
3069 |
3117 |
3070 |
3118 |
3071 void CAknQueryControl::CreateIncAndDecButtonsL() |
3119 void CAknQueryControl::CreateIncAndDecButtonsL() |
3363 return NULL; |
3411 return NULL; |
3364 } |
3412 } |
3365 |
3413 |
3366 EXPORT_C void CAknQueryControl::HandleResourceChange(TInt aType) |
3414 EXPORT_C void CAknQueryControl::HandleResourceChange(TInt aType) |
3367 { |
3415 { |
|
3416 _AKNTRACE_FUNC_ENTER; |
3368 CCoeControl::HandleResourceChange(aType); |
3417 CCoeControl::HandleResourceChange(aType); |
3369 |
3418 |
3370 if( aType == KAknsMessageSkinChange && iExtension->iAnimationId ) |
3419 if( aType == KAknsMessageSkinChange && iExtension->iAnimationId ) |
3371 { |
3420 { |
3372 TRAP_IGNORE(SetAnimationL( iExtension->iAnimationId )); |
3421 TRAP_IGNORE(SetAnimationL( iExtension->iAnimationId )); |
3375 else if( aType == KEikDynamicLayoutVariantSwitch ) |
3424 else if( aType == KEikDynamicLayoutVariantSwitch ) |
3376 { |
3425 { |
3377 SizeChanged(); |
3426 SizeChanged(); |
3378 TRAP_IGNORE(DoSetPromptL()); |
3427 TRAP_IGNORE(DoSetPromptL()); |
3379 } |
3428 } |
|
3429 _AKNTRACE_FUNC_EXIT; |
3380 } |
3430 } |
3381 |
3431 |
3382 // --------------------------------------------------------------------------- |
3432 // --------------------------------------------------------------------------- |
3383 // Return prompt text needed by FEP to query dialog |
3433 // Return prompt text needed by FEP to query dialog |
3384 // --------------------------------------------------------------------------- |
3434 // --------------------------------------------------------------------------- |
3408 // Sets the state of ECS number visibility in the query. |
3458 // Sets the state of ECS number visibility in the query. |
3409 // --------------------------------------------------------------------------- |
3459 // --------------------------------------------------------------------------- |
3410 // |
3460 // |
3411 void CAknQueryControl::SetEcsCbaVisibleL( TBool aVisible ) |
3461 void CAknQueryControl::SetEcsCbaVisibleL( TBool aVisible ) |
3412 { |
3462 { |
|
3463 _AKNTRACE( "[%s][%s] aVisible:%d ", "CAknQueryControl", __FUNCTION__,aVisible); |
3413 if ( iExtension && |
3464 if ( iExtension && |
3414 !COMPARE_BOOLS( aVisible, iExtension->iEcsCbaShown ) && |
3465 !COMPARE_BOOLS( aVisible, iExtension->iEcsCbaShown ) && |
3415 iFlags.IsSet( EEmergencyCallsCBASupport ) ) |
3466 iFlags.IsSet( EEmergencyCallsCBASupport ) ) |
3416 { |
3467 { |
3417 CEikDialog* dlg; |
3468 CEikDialog* dlg; |
3442 iExtension->iEcsCbaShown = EFalse; |
3493 iExtension->iEcsCbaShown = EFalse; |
3443 } |
3494 } |
3444 } |
3495 } |
3445 } |
3496 } |
3446 } |
3497 } |
|
3498 _AKNTRACE_FUNC_EXIT; |
3447 } |
3499 } |
3448 |
3500 |
3449 |
3501 |
3450 // --------------------------------------------------------------------------- |
3502 // --------------------------------------------------------------------------- |
3451 // Attempts an emergency call. |
3503 // Attempts an emergency call. |
3452 // --------------------------------------------------------------------------- |
3504 // --------------------------------------------------------------------------- |
3453 // |
3505 // |
3454 void CAknQueryControl::AttemptEmergencyCallL() |
3506 void CAknQueryControl::AttemptEmergencyCallL() |
3455 { |
3507 { |
|
3508 _AKNTRACE_FUNC_ENTER; |
3456 if ( iEcsDetector ) |
3509 if ( iEcsDetector ) |
3457 { |
3510 { |
3458 if ( iEcsDetector->State() == CAknEcsDetector::ECompleteMatch ) |
3511 if ( iEcsDetector->State() == CAknEcsDetector::ECompleteMatch ) |
3459 { |
3512 { |
3460 // Further check to ensure that the matched number is the |
3513 // Further check to ensure that the matched number is the |
3505 } |
3559 } |
3506 |
3560 |
3507 |
3561 |
3508 void CAknExtQueryControl::ConstructQueryL(TResourceReader& aRes) |
3562 void CAknExtQueryControl::ConstructQueryL(TResourceReader& aRes) |
3509 { |
3563 { |
|
3564 _AKNTRACE_FUNC_ENTER; |
3510 if ( iQueryType == EIpLayout) |
3565 if ( iQueryType == EIpLayout) |
3511 { |
3566 { |
3512 iIpEditor = new(ELeave)CAknIpFieldEditor; |
3567 iIpEditor = new(ELeave)CAknIpFieldEditor; |
3513 iIpEditor->SetContainerWindowL(*this); |
3568 iIpEditor->SetContainerWindowL(*this); |
3514 iIpEditor->ConstructFromResourceL(aRes); |
3569 iIpEditor->ConstructFromResourceL(aRes); |
3611 } |
3667 } |
3612 |
3668 |
3613 EXPORT_C void CAknExtQueryControl::HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent aEventType) |
3669 EXPORT_C void CAknExtQueryControl::HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent aEventType) |
3614 { |
3670 { |
3615 //CAknQueryControl::HandleControlEventL(NULL, aEventType); |
3671 //CAknQueryControl::HandleControlEventL(NULL, aEventType); |
3616 |
3672 _AKNTRACE( "[%s][%s] aEventType:%d ", "CAknExtQueryControl", "HandleControlEventL",aEventType); |
3617 if(iQueryControlObserver && aEventType == EEventStateChanged) |
3673 if(iQueryControlObserver && aEventType == EEventStateChanged) |
3618 { |
3674 { |
3619 if(GetTextLength()) |
3675 if(GetTextLength()) |
3620 { |
3676 { |
3621 iQueryControlObserver->HandleQueryEditorStateEventL(this,MAknQueryControlObserver::EQueryControlEditorStateChanging, MAknQueryControlObserver::EEditorValueValid); |
3677 iQueryControlObserver->HandleQueryEditorStateEventL(this,MAknQueryControlObserver::EQueryControlEditorStateChanging, MAknQueryControlObserver::EEditorValueValid); |
3944 |
4001 |
3945 |
4002 |
3946 // Callback for doing a redraw when animating pictographs |
4003 // Callback for doing a redraw when animating pictographs |
3947 TInt CAknExtQueryControl::StaticPictographCallBack( TAny* aPtr ) |
4004 TInt CAknExtQueryControl::StaticPictographCallBack( TAny* aPtr ) |
3948 { |
4005 { |
|
4006 _AKNTRACE_FUNC_ENTER; |
3949 CAknExtQueryControl* me = static_cast<CAknExtQueryControl*>( aPtr ); |
4007 CAknExtQueryControl* me = static_cast<CAknExtQueryControl*>( aPtr ); |
3950 me->PictographCallBack(); |
4008 me->PictographCallBack(); |
|
4009 _AKNTRACE_FUNC_EXIT; |
3951 return KErrNone; |
4010 return KErrNone; |
3952 } |
4011 } |
3953 |
4012 |
3954 void CAknExtQueryControl::PictographCallBack() |
4013 void CAknExtQueryControl::PictographCallBack() |
3955 { |
4014 { |
|
4015 _AKNTRACE_FUNC_ENTER; |
3956 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
4016 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
3957 MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); |
4017 MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); |
3958 |
4018 |
3959 for ( TInt i = 0 ; i < iPrompt->NumberOfLines() ; i++ ) |
4019 for ( TInt i = 0 ; i < iPrompt->NumberOfLines() ; i++ ) |
3960 { |
4020 { |