uifw/AvKon/src/AknQueryDialog.cpp
branchRCL_3
changeset 20 d48ab3b357f1
parent 19 aecbbf00d063
equal deleted inserted replaced
19:aecbbf00d063 20:d48ab3b357f1
    50 #include <akntransitionutils.h>
    50 #include <akntransitionutils.h>
    51 #include <akntranseffect.h>
    51 #include <akntranseffect.h>
    52 #endif
    52 #endif
    53 
    53 
    54 #include <AknTasHook.h> // for testability hooks
    54 #include <AknTasHook.h> // for testability hooks
       
    55 #include "akntrace.h"
    55 /**
    56 /**
    56  *  CAknQueryDialogExtension  
    57  *  CAknQueryDialogExtension  
    57  */
    58  */
    58 NONSHARABLE_CLASS(CAknQueryDialogExtension) : public CBase, public MCoeCaptionRetrieverForFep
    59 NONSHARABLE_CLASS(CAknQueryDialogExtension) : public CBase, public MCoeCaptionRetrieverForFep
    59 {
    60 {
    85 // Destructor
    86 // Destructor
    86 // ---------------------------------------------------------------------------
    87 // ---------------------------------------------------------------------------
    87 //
    88 //
    88 CAknQueryDialogExtension::~CAknQueryDialogExtension()
    89 CAknQueryDialogExtension::~CAknQueryDialogExtension()
    89     {
    90     {
       
    91     _AKNTRACE( "[%s][%s] do nothing", "CAknQueryDialogExtension", "~CAknQueryDialogExtension" );
    90     }
    92     }
    91 
    93 
    92 
    94 
    93 // ---------------------------------------------------------------------------
    95 // ---------------------------------------------------------------------------
    94 // Constructor
    96 // Constructor
    95 // ---------------------------------------------------------------------------
    97 // ---------------------------------------------------------------------------
    96 //
    98 //
    97 CAknQueryDialogExtension::CAknQueryDialogExtension
    99 CAknQueryDialogExtension::CAknQueryDialogExtension
    98     (CAknQueryDialog* aQueryDialog) : iParent(aQueryDialog)
   100     (CAknQueryDialog* aQueryDialog) : iParent(aQueryDialog)
    99     {
   101     {
       
   102     _AKNTRACE( "[%s][%s] do nothing", "CAknQueryDialogExtension", "CAknQueryDialogExtension" );
   100     }
   103     }
   101     
   104     
   102 // ---------------------------------------------------------------------------
   105 // ---------------------------------------------------------------------------
   103 // GetCaptionForFep
   106 // GetCaptionForFep
   104 // Overrides MCoeCaptionRetrieverForFep::GetCaptionForFep
   107 // Overrides MCoeCaptionRetrieverForFep::GetCaptionForFep
   105 // Responsible for retrieving the caption from query dialog to FEP
   108 // Responsible for retrieving the caption from query dialog to FEP
   106 // ---------------------------------------------------------------------------
   109 // ---------------------------------------------------------------------------
   107 //
   110 //
   108 EXPORT_C void CAknQueryDialogExtension::GetCaptionForFep(TDes& aCaption) const
   111 EXPORT_C void CAknQueryDialogExtension::GetCaptionForFep(TDes& aCaption) const
   109     {
   112     {
       
   113     _AKNTRACE( "[%s][%s] enter aCaption:%s", "CAknQueryDialogExtension", "GetCaptionForFep" , &aCaption);
   110     aCaption = KNullDesC;
   114     aCaption = KNullDesC;
   111     
   115     
   112     CAknQueryControl* control = iParent->QueryControl();
   116     CAknQueryControl* control = iParent->QueryControl();
   113     if ( control )
   117     if ( control )
   114         {
   118         {
   134                     aCaption= headTitle;
   138                     aCaption= headTitle;
   135                     }
   139                     }
   136                 }
   140                 }
   137             }
   141             }
   138         }
   142         }
       
   143     _AKNTRACE( "[%s][%s] exit aCaption:%s", "CAknQueryDialogExtension", "GetCaptionForFep" , &aCaption);
   139     }
   144     }
   140 
   145 
   141 
   146 
   142 /**
   147 /**
   143  *  CAknMultilineQueryDialogExtension  
   148  *  CAknMultilineQueryDialogExtension  
   177 // Destructor
   182 // Destructor
   178 // ---------------------------------------------------------------------------
   183 // ---------------------------------------------------------------------------
   179 //
   184 //
   180 CAknMultilineQueryDialogExtension::~CAknMultilineQueryDialogExtension()
   185 CAknMultilineQueryDialogExtension::~CAknMultilineQueryDialogExtension()
   181     {
   186     {
       
   187     _AKNTRACE( "[%s][%s] do nothing", "CAknMultilineQueryDialogExtension", "~CAknMultilineQueryDialogExtension" );
   182     }
   188     }
   183 
   189 
   184 // ---------------------------------------------------------------------------
   190 // ---------------------------------------------------------------------------
   185 // Constructor
   191 // Constructor
   186 // ---------------------------------------------------------------------------
   192 // ---------------------------------------------------------------------------
   187 //
   193 //
   188 CAknMultilineQueryDialogExtension::CAknMultilineQueryDialogExtension
   194 CAknMultilineQueryDialogExtension::CAknMultilineQueryDialogExtension
   189     (CAknQueryDialog* aQueryDialog, TInt aQueryType):CAknQueryDialogExtension(aQueryDialog),iQueryType(aQueryType)
   195     (CAknQueryDialog* aQueryDialog, TInt aQueryType):CAknQueryDialogExtension(aQueryDialog),iQueryType(aQueryType)
   190     {
   196     {
       
   197     _AKNTRACE( "[%s][%s] do nothing", "CAknMultilineQueryDialogExtension", "CAknMultilineQueryDialogExtension" );
   191     }
   198     }
   192 
   199 
   193 // ---------------------------------------------------------------------------
   200 // ---------------------------------------------------------------------------
   194 // GetCaptionForFep
   201 // GetCaptionForFep
   195 // Overrides MCoeCaptionRetrieverForFep::GetCaptionForFep
   202 // Overrides MCoeCaptionRetrieverForFep::GetCaptionForFep
   286  * In future might use MAknQueryData mixin in the base class, hence requiring
   293  * In future might use MAknQueryData mixin in the base class, hence requiring
   287  * second phase construction.
   294  * second phase construction.
   288  */
   295  */
   289 EXPORT_C CAknQueryDialog* CAknQueryDialog::NewL(const TTone& aTone)
   296 EXPORT_C CAknQueryDialog* CAknQueryDialog::NewL(const TTone& aTone)
   290     {
   297     {
       
   298     _AKNTRACE_FUNC_ENTER;
   291     CAknQueryDialog* self = new (ELeave) CAknQueryDialog(aTone);
   299     CAknQueryDialog* self = new (ELeave) CAknQueryDialog(aTone);
   292     AKNTASHOOK_ADDL( self, "CAknQueryDialog" );
   300     AKNTASHOOK_ADDL( self, "CAknQueryDialog" );
       
   301     _AKNTRACE_FUNC_EXIT;
   293     return self;
   302     return self;
   294     }
   303     }
   295 
   304 
   296 /**
   305 /**
   297  * Return pointer to CAknTextQueryDialog
   306  * Return pointer to CAknTextQueryDialog
   347 	return NULL;
   356 	return NULL;
   348 	}
   357 	}
   349 
   358 
   350 EXPORT_C CAknQueryDialog::CAknQueryDialog(const TTone& aTone)
   359 EXPORT_C CAknQueryDialog::CAknQueryDialog(const TTone& aTone)
   351     {
   360     {
       
   361     _AKNTRACE_FUNC_ENTER;
   352 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
   362 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
   353     GfxTransEffect::Register( this, KGfxQueryControlUid );
   363     GfxTransEffect::Register( this, KGfxQueryControlUid );
   354 #endif
   364 #endif
   355     iTone = aTone;
   365     iTone = aTone;
   356     if (iEikonEnv->AppUi())
   366     if (iEikonEnv->AppUi())
   357         {
   367         {
   358          iSoundSystem = iAvkonAppUiBase->KeySounds();          
   368          iSoundSystem = iAvkonAppUiBase->KeySounds();          
   359         }
   369         }
       
   370     _AKNTRACE( "[%s][%s] iTone: %d", "CAknQueryDialog", __FUNCTION__, iTone );
       
   371     _AKNTRACE_FUNC_EXIT;
   360     } 
   372     } 
   361 
   373 
   362 /**
   374 /**
   363  * deprecated
   375  * deprecated
   364  */
   376  */
   385     TRAP_IGNORE(SetPromptL(aPrompt));
   397     TRAP_IGNORE(SetPromptL(aPrompt));
   386     }
   398     }
   387 
   399 
   388 EXPORT_C CAknQueryDialog::~CAknQueryDialog()
   400 EXPORT_C CAknQueryDialog::~CAknQueryDialog()
   389     {
   401     {
       
   402     _AKNTRACE( "[%s][%s] Enter", "CAknQueryDialog", "~CAknQueryDialog" );
   390     AKNTASHOOK_REMOVE();
   403     AKNTASHOOK_REMOVE();
   391     delete iPrompt;
   404     delete iPrompt;
   392     delete iExtension;
   405     delete iExtension;
   393     
   406     
   394 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
   407 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
   395     CAknTransitionUtils::RemoveData( ( TInt )this );
   408     CAknTransitionUtils::RemoveData( ( TInt )this );
   396 #endif
   409 #endif
       
   410     _AKNTRACE( "[%s][%s] Exit", "CAknQueryDialog", "~CAknQueryDialog" );
   397     }
   411     }
   398 
   412 
   399 
   413 
   400 EXPORT_C TInt CAknQueryDialog::RunLD()
   414 EXPORT_C TInt CAknQueryDialog::RunLD()
   401     {
   415     {
       
   416     _AKNTRACE_FUNC_ENTER;
   402     CAknDialog::ConstructL( R_AVKON_MENUPANE_EMPTY) ;
   417     CAknDialog::ConstructL( R_AVKON_MENUPANE_EMPTY) ;
   403     ReportUserActivity();
   418     ReportUserActivity();
   404     PlayTone();
   419     PlayTone();
   405     CAknKeySoundSystem* soundSystem = NULL;
   420     CAknKeySoundSystem* soundSystem = NULL;
   406     if (iSoundSystem)
   421     if (iSoundSystem)
   411         soundSystem = iSoundSystem;
   426         soundSystem = iSoundSystem;
   412         }
   427         }
   413 
   428 
   414     CAknsFrameBackgroundControlContext* cc = (CAknsFrameBackgroundControlContext*)AknsDrawUtils::ControlContext( this );
   429     CAknsFrameBackgroundControlContext* cc = (CAknsFrameBackgroundControlContext*)AknsDrawUtils::ControlContext( this );
   415     cc->SetCenter(KAknsIIDQsnFrPopupCenterQuery);
   430     cc->SetCenter(KAknsIIDQsnFrPopupCenterQuery);
       
   431     
       
   432     // Check Query is wait of not.
       
   433     TBool isWaitDialog( ( DialogFlags() & EEikDialogFlagWait ) != 0 );
   416 
   434 
   417     SetGloballyCapturing(ETrue); 
   435     SetGloballyCapturing(ETrue); 
   418     TInt ret = CAknDialog::RunLD();
   436     TInt ret = CAknDialog::RunLD();
       
   437     _AKNTRACE( "[%s][%s] ret: %d", "CAknQueryDialog", __FUNCTION__, ret );
   419     if (soundSystem)
   438     if (soundSystem)
   420         {
   439         {
   421         soundSystem->PopContext();
   440         soundSystem->PopContext();
   422         }
   441         }
   423     SetGloballyCapturing(EFalse); 
   442     // If wait QueryDialog, instance will be deleted right after RunLD via CBA
       
   443     if ( !isWaitDialog )
       
   444         {
       
   445         SetGloballyCapturing(EFalse); 
       
   446         }
       
   447 
       
   448     _AKNTRACE_FUNC_EXIT;
   424     return ret;
   449     return ret;
   425     }
   450     }
   426 
   451 
   427 /**
   452 /**
   428  * deprecated
   453  * deprecated
   441  * compiler will complain if this is not implemented in
   466  * compiler will complain if this is not implemented in
   442  * derived class as well
   467  * derived class as well
   443  */
   468  */
   444 EXPORT_C TInt CAknQueryDialog::ExecuteLD(TInt aResourceId)
   469 EXPORT_C TInt CAknQueryDialog::ExecuteLD(TInt aResourceId)
   445     {
   470     {
       
   471     _AKNTRACE_FUNC_ENTER;
       
   472     _AKNTRACE( "[%s][%s] aResourceId: %d", "CAknQueryDialog", __FUNCTION__, aResourceId );
   446     PrepareLC(aResourceId);
   473     PrepareLC(aResourceId);
   447     return(RunLD());
   474     TInt ret = RunLD();
       
   475     _AKNTRACE( "[%s][%s] ret:%d", "CAknQueryDialog", __FUNCTION__,ret );
       
   476     _AKNTRACE_FUNC_EXIT;
       
   477     return ret;
   448     }
   478     }
   449 
   479 
   450 /**
   480 /**
   451  * Call PrepareLC, set the prompt and display dialog.
   481  * Call PrepareLC, set the prompt and display dialog.
   452  */
   482  */
   453 EXPORT_C TInt CAknQueryDialog::ExecuteLD(TInt aResourceId,const TDesC& aPrompt)
   483 EXPORT_C TInt CAknQueryDialog::ExecuteLD(TInt aResourceId,const TDesC& aPrompt)
   454     {
   484     {
       
   485     _AKNTRACE_FUNC_ENTER;
   455     PrepareLC(aResourceId);
   486     PrepareLC(aResourceId);
   456     SetPromptL(aPrompt);
   487     SetPromptL(aPrompt);
   457     return(RunLD());
   488     _AKNTRACE( "[%s][%s] aResourceId: %d", "CAknQueryDialog", __FUNCTION__, aResourceId );
       
   489     TInt ret= RunLD();
       
   490     _AKNTRACE( "[%s][%s] ret:%d", "CAknQueryDialog", __FUNCTION__,ret );
       
   491     _AKNTRACE_FUNC_EXIT;
       
   492     return ret;
   458     }
   493     }
   459 /**
   494 /**
   460  * Get layout information from the control and use this layout
   495  * Get layout information from the control and use this layout
   461  * information to do layout. If there is a heading, add the 
   496  * information to do layout. If there is a heading, add the 
   462  * heading height to the height returned by the control layout
   497  * heading height to the height returned by the control layout
   472  * Therefore use iAvkonAppUi->ApplicationRect() minus the height 
   507  * Therefore use iAvkonAppUi->ApplicationRect() minus the height 
   473  * of the control pane (KAknSoftkeyPaneHeight) instead of ClientRect().
   508  * of the control pane (KAknSoftkeyPaneHeight) instead of ClientRect().
   474  */
   509  */
   475 EXPORT_C void CAknQueryDialog::SetSizeAndPosition( const TSize& /*aSize*/ )
   510 EXPORT_C void CAknQueryDialog::SetSizeAndPosition( const TSize& /*aSize*/ )
   476     {
   511     {
       
   512     _AKNTRACE_FUNC_ENTER;
   477     CAknQueryControl* control = QueryControl();
   513     CAknQueryControl* control = QueryControl();
   478     CAknPopupHeadingPane* controlHeading = QueryHeading();
   514     CAknPopupHeadingPane* controlHeading = QueryHeading();
   479     
   515     
   480     if(control)
   516     if(control)
   481         {
   517         {
   491     		control->MopGetObject( dialog );
   527     		control->MopGetObject( dialog );
   492        		if ( dialog && ( dialog->DialogFlags() & EEikDialogFlagVirtualInput ) )
   528        		if ( dialog && ( dialog->DialogFlags() & EEikDialogFlagVirtualInput ) )
   493        			{
   529        			{
   494        			TAknWindowLineLayout lay = AknLayoutScalable_Avkon::application_window(0);
   530        			TAknWindowLineLayout lay = AknLayoutScalable_Avkon::application_window(0);
   495        			TRect re(0, 0, lay.iW, lay.iH);
   531        			TRect re(0, 0, lay.iW, lay.iH);
       
   532        			_AKNTRACE( "[%s][%s] Rect: x[%d],y[%d],w[%d],h[%d]", "CAknQueryDialog", __FUNCTION__, 
       
   533 							re.iTl.iX, re.iTl.iY, re.Width(),re.Height());
   496            		SetRect(re);
   534            		SetRect(re);
       
   535            		_AKNTRACE_FUNC_EXIT;
   497            		return;
   536            		return;
   498        			}
   537        			}
   499             }
   538             }
   500 #endif
   539 #endif
   501         TAknWindowLineLayout windowLineLayoutScreen = AknLayoutScalable_Avkon::Screen().LayoutLine();
   540         TAknWindowLineLayout windowLineLayoutScreen = AknLayoutScalable_Avkon::Screen().LayoutLine();
   502         TRect rectZero = TRect(0,0,0,0);
   541         TRect rectZero = TRect(0,0,0,0);
   503         TAknLayoutRect layoutRect;
   542         TAknLayoutRect layoutRect;
   504         layoutRect.LayoutRect( rectZero, windowLineLayoutScreen );
   543         layoutRect.LayoutRect( rectZero, windowLineLayoutScreen );
   505         TRect rectScreen( layoutRect.Rect() );
   544         TRect rectScreen( layoutRect.Rect() );
   506     	TSize maxSize = rectScreen.Size();
   545     	TSize maxSize = rectScreen.Size();
   507     	
   546     	_AKNTRACE( "[%s][%s] maxSize: w[%d],h[%d]", "CAknQueryDialog", __FUNCTION__, 
       
   547     			maxSize.iWidth,maxSize.iHeight);
   508         if ( AknLayoutUtils::PenEnabled() )
   548         if ( AknLayoutUtils::PenEnabled() )
   509             {
   549             {
   510             CAknDialog::SetSizeAndPosition( PreferredSize( maxSize ) );
   550             TSize preferredSize = PreferredSize( maxSize );
       
   551             
       
   552             _AKNTRACE( "[%s][%s] call CAknDialog::SetSizeAndPosition( PreferredSize( w[%d],h[%d] ) )", "CAknQueryDialog", 
       
   553             		__FUNCTION__, preferredSize.iWidth, preferredSize.iHeight);
       
   554             
       
   555             CAknDialog::SetSizeAndPosition( preferredSize );
   511             }
   556             }
   512         else
   557         else
   513             {
   558             {
   514             TAknWindowLineLayout layout;
   559             TAknWindowLineLayout layout;
   515             control->WindowLayout( layout );
   560             control->WindowLayout( layout );
   528                 TAknLayoutRect headingLayoutRect;
   573                 TAknLayoutRect headingLayoutRect;
   529                 headingLayoutRect.LayoutRect(mainPane,
   574                 headingLayoutRect.LayoutRect(mainPane,
   530                         AknLayoutScalable_Avkon::heading_pane(0)); 
   575                         AknLayoutScalable_Avkon::heading_pane(0)); 
   531                 winRect.iTl.iY -= headingLayoutRect.Rect().Height();
   576                 winRect.iTl.iY -= headingLayoutRect.Rect().Height();
   532                 }
   577                 }
       
   578             _AKNTRACE( "[%s][%s] Rect: x[%d],y[%d],w[%d],h[%d]", "CAknQueryDialog", __FUNCTION__, 
       
   579             		winRect.iTl.iX, winRect.iTl.iY, winRect.Width(),winRect.Height());
   533             SetRect(winRect);
   580             SetRect(winRect);
   534             }            
   581             }            
   535         }
   582         }
       
   583     _AKNTRACE_FUNC_EXIT;
   536     }
   584     }
   537 
   585 
   538 /**
   586 /**
   539  *
   587  *
   540  */
   588  */
   541 EXPORT_C void CAknQueryDialog::PreLayoutDynInitL()
   589 EXPORT_C void CAknQueryDialog::PreLayoutDynInitL()
   542     {
   590     {
       
   591     _AKNTRACE_FUNC_ENTER;
   543     SetBorder( TGulBorder::ENone );
   592     SetBorder( TGulBorder::ENone );
   544     SetEditableL( ETrue ) ;
   593     SetEditableL( ETrue ) ;
   545     DoSetPromptL();
   594     DoSetPromptL();
   546 
   595 
   547     CAknQueryControl* control = QueryControl();
   596     CAknQueryControl* control = QueryControl();
   562     
   611     
   563     // Create CaptionRetriever for FEP
   612     // Create CaptionRetriever for FEP
   564     delete iExtension;
   613     delete iExtension;
   565     iExtension = NULL;
   614     iExtension = NULL;
   566     iExtension = new(ELeave) CAknQueryDialogExtension(this);
   615     iExtension = new(ELeave) CAknQueryDialogExtension(this);
       
   616     _AKNTRACE_FUNC_EXIT;
   567     }
   617     }
   568 
   618 
   569 /**
   619 /**
   570  *
   620  *
   571  */
   621  */
   572 EXPORT_C void CAknQueryDialog::PostLayoutDynInitL()
   622 EXPORT_C void CAknQueryDialog::PostLayoutDynInitL()
   573     {
   623     {
       
   624     _AKNTRACE_FUNC_ENTER;
   574     CAknQueryControl* control = QueryControl();
   625     CAknQueryControl* control = QueryControl();
   575     if (control)
   626     if (control)
   576         control->StartAnimationL();
   627         control->StartAnimationL();
   577 
   628     _AKNTRACE_FUNC_EXIT;
   578     }
   629     }
   579 
   630 
   580 /**
   631 /**
   581  *
   632  *
   582  */
   633  */
   583 EXPORT_C TKeyResponse CAknQueryDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
   634 EXPORT_C TKeyResponse CAknQueryDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
   584                                                             TEventCode aType)
   635                                                             TEventCode aType)
   585     {
   636     {
       
   637     _AKNTRACE( "[%s][%s] aKeyEvent.iCode[%d],aType[%d]", "CAknQueryDialog", __FUNCTION__,aKeyEvent.iCode, aType);
   586     if( NeedToDismissQueryL(aKeyEvent) )
   638     if( NeedToDismissQueryL(aKeyEvent) )
   587             return EKeyWasConsumed;
   639     	{
   588  	
   640     	_AKNTRACE( "[%s][%s] Need Dismiss Query, return EKeyWasConsumed", "CAknQueryDialog", __FUNCTION__);
       
   641     	return EKeyWasConsumed;
       
   642     	}
       
   643     
   589 	if (aType == EEventKey && aKeyEvent.iCode == EKeyOK) 	
   644 	if (aType == EEventKey && aKeyEvent.iCode == EKeyOK) 	
   590 		{
   645 		{
   591 		CAknQueryControl* control = QueryControl();
   646 		CAknQueryControl* control = QueryControl();
   592 		if (control)
   647 		if (control)
   593 			{
   648 			{
   594 			if (IsLeftSoftkeyVisible())
   649 			if (IsLeftSoftkeyVisible())
   595 				{
   650 				{
   596 				TryExitL(EEikBidOk);
   651 				TryExitL(EEikBidOk);
       
   652 				_AKNTRACE( "[%s][%s] TryExitL(EEikBidOk) and reutrn EKeyWasConsumed", "CAknQueryDialog", __FUNCTION__);
   597 				return EKeyWasConsumed;
   653 				return EKeyWasConsumed;
   598 				}
   654 				}
   599             }
   655             }
   600 		}
   656 		}
   601 	else if ( aType == EEventKey && aKeyEvent.iCode == EKeyEnter )	
   657 	else if ( aType == EEventKey && aKeyEvent.iCode == EKeyEnter )	
   605 		if (control)
   661 		if (control)
   606 			{
   662 			{
   607 			if (IsLeftSoftkeyVisible())
   663 			if (IsLeftSoftkeyVisible())
   608 				{
   664 				{
   609 				TryExitL(EEikBidOk);
   665 				TryExitL(EEikBidOk);
       
   666 				_AKNTRACE( "[%s][%s] TryExitL(EEikBidOk) and reutrn EKeyWasConsumed", "CAknQueryDialog", __FUNCTION__);
   610 				return EKeyWasConsumed;
   667 				return EKeyWasConsumed;
   611 				}
   668 				}
   612             }
   669             }
   613 		}
   670 		}
   614 	
   671 	TKeyResponse response = CAknDialog::OfferKeyEventL(aKeyEvent,aType);
   615 
   672 	_AKNTRACE( "[%s][%s] return [%d]", "CAknQueryDialog", __FUNCTION__, response);
   616     return CAknDialog::OfferKeyEventL(aKeyEvent,aType);
   673 	return response;
   617     }
   674     }
   618 
   675 
   619 /**
   676 /**
   620  * Allows dismissing of queries. Only mandatory requirement is that PIN
   677  * Allows dismissing of queries. Only mandatory requirement is that PIN
   621  * queries are dismissed by the # key. Clients can
   678  * queries are dismissed by the # key. Clients can
   622  * override this and implement something different. 
   679  * override this and implement something different. 
   623  *
   680  *
   624  */
   681  */
   625 EXPORT_C TBool CAknQueryDialog::NeedToDismissQueryL(const TKeyEvent& aKeyEvent)
   682 EXPORT_C TBool CAknQueryDialog::NeedToDismissQueryL(const TKeyEvent& aKeyEvent)
   626     {
   683     {
       
   684     _AKNTRACE( "[%s][%s] aKeyEvent.iScanCode [%d]", "CAknQueryDialog", __FUNCTION__, aKeyEvent.iScanCode);
   627     if (aKeyEvent.iScanCode == EStdKeyHash)
   685     if (aKeyEvent.iScanCode == EStdKeyHash)
   628         {
   686         {
   629         CAknQueryControl* control = QueryControl();
   687         CAknQueryControl* control = QueryControl();
   630         if (control && control->QueryType() == EPinLayout)
   688         if (control && control->QueryType() == EPinLayout)
   631             {
   689             {
       
   690             _AKNTRACE( "[%s][%s] EPinLayout, Dismiss Query and return ETrue", "CAknQueryDialog", __FUNCTION__);
   632             DismissQueryL();
   691             DismissQueryL();
   633             return ETrue;
   692             return ETrue;
   634             }
   693             }
   635         }
   694         }
       
   695     _AKNTRACE( "[%s][%s] return EFalse", "CAknQueryDialog", __FUNCTION__);
   636     return EFalse;
   696     return EFalse;
   637     }
   697     }
   638 
   698 
   639 /**
   699 /**
   640  * Dismiss query. Query is accepted if the left softkey is displayed 
   700  * Dismiss query. Query is accepted if the left softkey is displayed 
   642  * Query is discarded if the left softkey is not displayed.
   702  * Query is discarded if the left softkey is not displayed.
   643  * Clients can override this and implement something different.
   703  * Clients can override this and implement something different.
   644  */
   704  */
   645 EXPORT_C void CAknQueryDialog::DismissQueryL()
   705 EXPORT_C void CAknQueryDialog::DismissQueryL()
   646     {
   706     {
       
   707     _AKNTRACE_FUNC_ENTER;
   647     if (IsLeftSoftkeyVisible())
   708     if (IsLeftSoftkeyVisible())
   648         {
   709         {
       
   710         _AKNTRACE( "[%s][%s] TryExitL(EEikBidOk) ", "CAknQueryDialog", __FUNCTION__);
   649         TryExitL(EEikBidOk);
   711         TryExitL(EEikBidOk);
   650         }
   712         }
   651     else
   713     else
   652         {
   714         {
       
   715         _AKNTRACE( "[%s][%s] TryExitL(EEikBidCancel) ", "CAknQueryDialog", __FUNCTION__);
   653         TryExitL(EEikBidCancel);
   716         TryExitL(EEikBidCancel);
   654         }
   717         }
       
   718     _AKNTRACE_FUNC_EXIT;
   655     }
   719     }
   656 
   720 
   657 /**
   721 /**
   658  *
   722  *
   659  */
   723  */
   660 EXPORT_C TBool CAknQueryDialog::OkToExitL(TInt aButtonId)
   724 EXPORT_C TBool CAknQueryDialog::OkToExitL(TInt aButtonId)
   661     {
   725     {
       
   726     _AKNTRACE( "[%s][%s] aButtonId : %d ", "CAknQueryDialog", __FUNCTION__,aButtonId);
   662     if ( aButtonId == EAknSoftkeyEmergencyCall )
   727     if ( aButtonId == EAknSoftkeyEmergencyCall )
   663         {
   728         {
   664         // ECS number entered and "call" softkey pressed,
   729         // ECS number entered and "call" softkey pressed,
   665         // send a key event to the query control to
   730         // send a key event to the query control to
   666         // initiate the call.
   731         // initiate the call.
   667         CAknQueryControl* control = QueryControl();
   732         CAknQueryControl* control = QueryControl();
   668         if ( control )
   733         if ( control )
   669             {
   734             {
       
   735             _AKNTRACE( "[%s][%s] AttemptEmergencyCall ", "CAknQueryDialog", __FUNCTION__);
   670             control->AttemptEmergencyCallL();
   736             control->AttemptEmergencyCallL();
   671             }
   737             }
   672         
   738         _AKNTRACE( "[%s][%s] return ETrue without doing anything", "CAknQueryDialog", __FUNCTION__);
   673         return ETrue;
   739         return ETrue;
   674         }
   740         }
   675     else if((IsLeftSoftkeyVisible() && 
   741     else if((IsLeftSoftkeyVisible() && 
   676         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk))
   742         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk))
   677         || aButtonId == GetRightCBAShortKeyPress() )
   743         || aButtonId == GetRightCBAShortKeyPress() )
   678         {   
   744         { 
       
   745         _AKNTRACE( "[%s][%s] return ETrue without doing anything ", "CAknQueryDialog", __FUNCTION__);
   679         return ETrue;
   746         return ETrue;
   680         }
   747         }
       
   748     
       
   749     _AKNTRACE( "[%s][%s] return EFalse without doing anyting ", "CAknQueryDialog", __FUNCTION__);
   681     return EFalse;
   750     return EFalse;
   682     }
   751     }
   683 
   752 
   684 /**
   753 /**
   685  * Return pointer to query heading or NULL (use QueryHeading())
   754  * Return pointer to query heading or NULL (use QueryHeading())
   694 /**
   763 /**
   695  * Set prompt text for query. 
   764  * Set prompt text for query. 
   696  */
   765  */
   697 EXPORT_C void CAknQueryDialog::SetPromptL(const TDesC& aPrompt)
   766 EXPORT_C void CAknQueryDialog::SetPromptL(const TDesC& aPrompt)
   698     {
   767     {
       
   768     _AKNTRACE_FUNC_ENTER;
   699     delete iPrompt;
   769     delete iPrompt;
   700     iPrompt = NULL;
   770     iPrompt = NULL;
   701     iPrompt = aPrompt.AllocL();
   771     iPrompt = aPrompt.AllocL();
   702     DoSetPromptL();
   772     DoSetPromptL();
       
   773     _AKNTRACE_FUNC_EXIT;
   703     }
   774     }
   704 
   775 
   705 EXPORT_C void CAknQueryDialog::DoSetPromptL()
   776 EXPORT_C void CAknQueryDialog::DoSetPromptL()
   706     {
   777     {
   707     CAknQueryControl* control = QueryControl();
   778     CAknQueryControl* control = QueryControl();
   776     return 0;
   847     return 0;
   777     }
   848     }
   778 
   849 
   779 EXPORT_C void CAknQueryDialog::MakeLeftSoftkeyVisible(TBool aVisible)
   850 EXPORT_C void CAknQueryDialog::MakeLeftSoftkeyVisible(TBool aVisible)
   780     {  
   851     {  
       
   852     _AKNTRACE_FUNC_ENTER;
       
   853     _AKNTRACE( "[%s][%s] aVisible: %d ", "CAknQueryDialog", __FUNCTION__, aVisible);
   781     CEikButtonGroupContainer& btnGroupContainer = ButtonGroupContainer();
   854     CEikButtonGroupContainer& btnGroupContainer = ButtonGroupContainer();
   782 
   855 
   783     // left softkey
   856     // left softkey
   784     TBool isVisible = btnGroupContainer.IsCommandVisibleByPosition(CEikButtonGroupContainer::ELeftSoftkeyPosition);
   857     TBool isVisible = btnGroupContainer.IsCommandVisibleByPosition(CEikButtonGroupContainer::ELeftSoftkeyPosition);
       
   858     _AKNTRACE( "[%s][%s] isVisible: %d ", "CAknQueryDialog", __FUNCTION__, isVisible);
   785     if ( isVisible != aVisible )
   859     if ( isVisible != aVisible )
   786         {
   860         {
   787         btnGroupContainer.MakeCommandVisibleByPosition(CEikButtonGroupContainer::ELeftSoftkeyPosition,aVisible);
   861         btnGroupContainer.MakeCommandVisibleByPosition(CEikButtonGroupContainer::ELeftSoftkeyPosition,aVisible);
   788         }
   862         }
   789 
   863 
   794         if ( isVisible != aVisible )
   868         if ( isVisible != aVisible )
   795             {
   869             {
   796             btnGroupContainer.MakeCommandVisibleByPosition(CEikButtonGroupContainer::EMiddleSoftkeyPosition,aVisible);
   870             btnGroupContainer.MakeCommandVisibleByPosition(CEikButtonGroupContainer::EMiddleSoftkeyPosition,aVisible);
   797             }
   871             }
   798         }
   872         }
       
   873     _AKNTRACE_FUNC_EXIT;
   799     }
   874     }
   800 
   875 
   801 
   876 
   802 
   877 
   803 void CAknQueryDialog::PlayTone()
   878 void CAknQueryDialog::PlayTone()
   804     {
   879     {
       
   880     _AKNTRACE_FUNC_ENTER;
   805     if (iTone != 0 && iSoundSystem)
   881     if (iTone != 0 && iSoundSystem)
   806         {
   882         {
       
   883         _AKNTRACE( "[%s][%s] iSoundSystem->PlaySound(iTone)", "CAknQueryDialog", __FUNCTION__);
   807         iSoundSystem->PlaySound(iTone);
   884         iSoundSystem->PlaySound(iTone);
   808         }
   885         }
       
   886     _AKNTRACE_FUNC_EXIT;
   809     }
   887     }
   810 
   888 
   811 /** 
   889 /** 
   812  * Reset timers monitoring user inactivity. Will make applications
   890  * Reset timers monitoring user inactivity. Will make applications
   813  * using these timers react, e.g. if the screen saver is running,
   891  * using these timers react, e.g. if the screen saver is running,
   814  * this will disactivate it (as from screen saver specs)
   892  * this will disactivate it (as from screen saver specs)
   815  */ 
   893  */ 
   816 void CAknQueryDialog::ReportUserActivity() const 
   894 void CAknQueryDialog::ReportUserActivity() const 
   817     {
   895     {
       
   896     _AKNTRACE_FUNC_ENTER;
   818 #ifdef AVKON_RDEBUG_INFO
   897 #ifdef AVKON_RDEBUG_INFO
   819     RDebug::Print(_L("Reset user inactivity"));
   898     RDebug::Print(_L("Reset user inactivity"));
   820 #endif
   899 #endif
   821     User::ResetInactivityTime();
   900     User::ResetInactivityTime();
       
   901     _AKNTRACE_FUNC_EXIT;
   822     }
   902     }
   823 
   903 
   824 TInt CAknQueryDialog::GetLeftCBAShortKeyPress()
   904 TInt CAknQueryDialog::GetLeftCBAShortKeyPress()
   825     {
   905     {
   826     return TInt16(0xffff & TInt16(ButtonGroupContainer().ButtonGroup()->CommandId(0)));
   906     return TInt16(0xffff & TInt16(ButtonGroupContainer().ButtonGroup()->CommandId(0)));
   831     return TInt16(0xffff & TInt16(ButtonGroupContainer().ButtonGroup()->CommandId(2)));
   911     return TInt16(0xffff & TInt16(ButtonGroupContainer().ButtonGroup()->CommandId(2)));
   832     }
   912     }
   833 
   913 
   834 TBool CAknQueryDialog::IsLeftSoftkeyVisible()
   914 TBool CAknQueryDialog::IsLeftSoftkeyVisible()
   835     {
   915     {
   836     return ButtonGroupContainer().ButtonGroup()->IsCommandVisible(
   916     _AKNTRACE_FUNC_ENTER;
   837                       ButtonGroupContainer().ButtonGroup()->CommandId(0));
   917     TBool visible = ButtonGroupContainer().ButtonGroup()->IsCommandVisible(
       
   918             ButtonGroupContainer().ButtonGroup()->CommandId(0));
       
   919     _AKNTRACE( "[%s][%s] visible: %d", "CAknQueryDialog", __FUNCTION__, visible);
       
   920     _AKNTRACE_FUNC_EXIT;
       
   921     return visible;
   838     }
   922     }
   839 
   923 
   840 /**
   924 /**
   841  * Sets emergency call support enabled. Must be called prior to PreLayoutDynamicInitL
   925  * Sets emergency call support enabled. Must be called prior to PreLayoutDynamicInitL
   842  */
   926  */
   843 EXPORT_C void CAknQueryDialog::SetEmergencyCallSupport( TBool aOnOff )
   927 EXPORT_C void CAknQueryDialog::SetEmergencyCallSupport( TBool aOnOff )
   844     {
   928     {
       
   929     _AKNTRACE_FUNC_ENTER;
       
   930     _AKNTRACE( "[%s][%s] aOnOff: %d", "CAknQueryDialog", __FUNCTION__, aOnOff);
   845     iFlags.Assign(CAknQueryControl::EEmergencyCallsEnabledByAPI, aOnOff );
   931     iFlags.Assign(CAknQueryControl::EEmergencyCallsEnabledByAPI, aOnOff );
       
   932     _AKNTRACE_FUNC_EXIT;
   846     }
   933     }
   847 
   934 
   848 EXPORT_C void CAknQueryDialog::SetPredictiveTextInputPermitted( TBool aPermitted )
   935 EXPORT_C void CAknQueryDialog::SetPredictiveTextInputPermitted( TBool aPermitted )
   849     {
   936     {
       
   937     _AKNTRACE_FUNC_ENTER;
       
   938     _AKNTRACE( "[%s][%s] aPermitted: %d", "CAknQueryDialog", __FUNCTION__, aPermitted);
   850     iFlags.Assign( CAknQueryControl::EPredictiveTextEntryPermitted, aPermitted );
   939     iFlags.Assign( CAknQueryControl::EPredictiveTextEntryPermitted, aPermitted );
       
   940     _AKNTRACE_FUNC_EXIT;
   851     }
   941     }
   852 
   942 
   853 EXPORT_C void CAknQueryDialog::RemoveEditorIndicator()
   943 EXPORT_C void CAknQueryDialog::RemoveEditorIndicator()
   854     {
   944     {
       
   945     _AKNTRACE_FUNC_ENTER;
   855     iFlags.Assign(CAknQueryControl::EEditorIndicatorOff,ETrue);
   946     iFlags.Assign(CAknQueryControl::EEditorIndicatorOff,ETrue);
       
   947     _AKNTRACE_FUNC_EXIT;
   856     }
   948     }
   857 
   949 
   858 EXPORT_C void CAknQueryDialog::SetHeaderTextL(const TDesC& aHeader)
   950 EXPORT_C void CAknQueryDialog::SetHeaderTextL(const TDesC& aHeader)
   859     {
   951     {
       
   952     _AKNTRACE_FUNC_ENTER;
       
   953     _AKNTRACE( "[%s][%s] aHeader: %s", "CAknQueryDialog", __FUNCTION__, &aHeader);
   860     CAknPopupHeadingPane* controlHeading = QueryHeading();
   954     CAknPopupHeadingPane* controlHeading = QueryHeading();
   861     if (controlHeading)
   955     if (controlHeading)
   862         controlHeading->SetTextL(aHeader);
   956         controlHeading->SetTextL(aHeader);
   863         
       
   864     LayoutAndDraw();
   957     LayoutAndDraw();
       
   958     _AKNTRACE_FUNC_EXIT;
   865     }
   959     }
   866 
   960 
   867 /** 
   961 /** 
   868  * Show left CBA only if editor text is valid
   962  * Show left CBA only if editor text is valid
   869  */ 
   963  */ 
   872     CAknQueryControl*       /*aQueryControl*/, 
   966     CAknQueryControl*       /*aQueryControl*/, 
   873     TQueryControlEvent      aEventType, 
   967     TQueryControlEvent      aEventType, 
   874     TQueryValidationStatus  /*aStatus*/
   968     TQueryValidationStatus  /*aStatus*/
   875     )
   969     )
   876     {
   970     {
       
   971     _AKNTRACE_FUNC_ENTER;
       
   972     _AKNTRACE( "[%s][%s] aEventType: %d", "CAknQueryDialog", __FUNCTION__, aEventType);
   877     if (aEventType == EEmergencyCallAttempted)
   973     if (aEventType == EEmergencyCallAttempted)
   878         {
   974         {
       
   975         _AKNTRACE( "[%s][%s] TryExitL(EEikBidCancel)", "CAknQueryDialog", __FUNCTION__);
   879         TryExitL(EEikBidCancel);
   976         TryExitL(EEikBidCancel);
   880         }
   977         }
   881     else
   978     else
   882         {
   979         {
   883         UpdateLeftSoftKeyL();
   980         UpdateLeftSoftKeyL();
   884         }
   981         }
       
   982     _AKNTRACE_FUNC_EXIT;
   885     return EFalse;
   983     return EFalse;
   886     }
   984     }
   887 
   985 
   888 
   986 
   889 EXPORT_C void CAknQueryDialog::SetHeaderImageL(CEikImage* aImage)
   987 EXPORT_C void CAknQueryDialog::SetHeaderImageL(CEikImage* aImage)
   933     {
  1031     {
   934     return GetMaxTextLength(aControl,aDataText,aApiValue);
  1032     return GetMaxTextLength(aControl,aDataText,aApiValue);
   935     }
  1033     }
   936 
  1034 
   937 EXPORT_C void CAknQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1035 EXPORT_C void CAknQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
   938     { 
  1036     {
   939     if ( AknLayoutUtils::PenEnabled() )
  1037     CAknAppUi *appUi = iAvkonAppUi;
   940         {
  1038     CCoeControl *redirectControl = NULL;
   941 
  1039     TRect rectToScreenOfControl;
   942         CAknTouchPane* touchPane = iAvkonAppUi->TouchPane();
  1040  
   943         
  1041     if (!Rect().Contains(aPointerEvent.iPosition))
   944         if ( !Rect().Contains( aPointerEvent.iPosition ) && touchPane
  1042         {
   945             && touchPane->IsVisible() )
  1043         CAknTouchPane* touchPane = appUi->TouchPane();
       
  1044         CEikStatusPane *statusPane = appUi->StatusPane();
       
  1045  
       
  1046         if ( touchPane && touchPane->IsVisible() )
   946             {
  1047             {
   947             // touchpane is a window-owning control -> Rect() cannot be used
  1048             // touchpane is a window-owning control -> Rect() cannot be used
   948             TRect touchPaneRect( touchPane->Position(), touchPane->Size() );
  1049             rectToScreenOfControl.SetRect( touchPane->Position(), touchPane->Size() );
   949                 
  1050             redirectControl = touchPane;
   950             if ( touchPaneRect.Contains( aPointerEvent.iParentPosition ) )
  1051             }
       
  1052         else if ( statusPane && statusPane->IsVisible() && 
       
  1053                 Layout_Meta_Data::IsLandscapeOrientation() && 
       
  1054                 !IsFocused())
       
  1055             {
       
  1056             CCoeControl* cbControl = statusPane->ControlL(TUid::Uid(EEikStatusPaneUidCombined));
       
  1057             if ( cbControl && !statusPane->IsFaded() )
   951                 {
  1058                 {
   952                 TPointerEvent pointerEvent( aPointerEvent );
  1059                 rectToScreenOfControl.SetRect( cbControl->PositionRelativeToScreen(), cbControl->Size() );
   953                    
  1060                 redirectControl = cbControl;
   954                 // make event's coordinates touch pane relative
       
   955                 pointerEvent.iPosition = aPointerEvent.iParentPosition - 
       
   956                     touchPaneRect.iTl;
       
   957                     
       
   958                 static_cast<CCoeControl*>( touchPane )->HandlePointerEventL( 
       
   959                     pointerEvent );
       
   960                 }
  1061                 }
   961             }
  1062             }
   962         else
  1063         }
   963             {
  1064  
   964             // Forward also those pointerevents that the dialog rect does not contain
  1065     if ( redirectControl && rectToScreenOfControl.Contains(aPointerEvent.iParentPosition) )
   965             CAknDialog::HandlePointerEventL( aPointerEvent );
  1066         {
   966             }
  1067         // make event's coordinates relative to new control.
       
  1068         TPointerEvent pointerEvent( aPointerEvent );
       
  1069         pointerEvent.iPosition = aPointerEvent.iParentPosition - rectToScreenOfControl.iTl;
       
  1070  
       
  1071         redirectControl->HandlePointerEventL( pointerEvent );
       
  1072         }
       
  1073     else
       
  1074         {
       
  1075         // Forward also those pointerevents that the dialog rect does not contain
       
  1076         CAknDialog::HandlePointerEventL( aPointerEvent );
   967         }
  1077         }
   968     }
  1078     }
   969 
  1079 
   970 EXPORT_C void* CAknQueryDialog::ExtensionInterface( TUid /*aInterface*/ ) 
  1080 EXPORT_C void* CAknQueryDialog::ExtensionInterface( TUid /*aInterface*/ ) 
   971     { 
  1081     { 
  1039 // number is entered to the query.
  1149 // number is entered to the query.
  1040 // ---------------------------------------------------------------------------
  1150 // ---------------------------------------------------------------------------
  1041 //
  1151 //
  1042 EXPORT_C void CAknQueryDialog::SetEmergencyCallSupportForCBA( TBool aOnOff )
  1152 EXPORT_C void CAknQueryDialog::SetEmergencyCallSupportForCBA( TBool aOnOff )
  1043     {
  1153     {
       
  1154     _AKNTRACE_FUNC_ENTER;
       
  1155     _AKNTRACE( "[%s][%s] aOnOff:%d ", "CAknQueryDialog", __FUNCTION__, aOnOff);
  1044     if ( aOnOff )
  1156     if ( aOnOff )
  1045         {
  1157         {
  1046         // Ensure also that the EEmergencyCallsEnabledByAPI is set.
  1158         // Ensure also that the EEmergencyCallsEnabledByAPI is set.
  1047         iFlags.Assign( CAknQueryControl::EEmergencyCallsEnabledByAPI, aOnOff );
  1159         iFlags.Assign( CAknQueryControl::EEmergencyCallsEnabledByAPI, aOnOff );
  1048         }
  1160         }
  1049     iFlags.Assign( CAknQueryControl::EEmergencyCallsCBASupport, aOnOff );
  1161     iFlags.Assign( CAknQueryControl::EEmergencyCallsCBASupport, aOnOff );
       
  1162     _AKNTRACE_FUNC_EXIT;
  1050     }
  1163     }
  1051 
  1164 
  1052 
  1165 
  1053 
  1166 
  1054 /************************
  1167 /************************
  1059  * Second phase construction required to align API with multiline queries 
  1172  * Second phase construction required to align API with multiline queries 
  1060  * and because in future MAknQueryData will be used.
  1173  * and because in future MAknQueryData will be used.
  1061  */
  1174  */
  1062 EXPORT_C CAknTextQueryDialog* CAknTextQueryDialog::NewL(TDes& aDataText, const TTone& aTone)
  1175 EXPORT_C CAknTextQueryDialog* CAknTextQueryDialog::NewL(TDes& aDataText, const TTone& aTone)
  1063     {
  1176     {
       
  1177     _AKNTRACE_FUNC_ENTER;
  1064     CAknTextQueryDialog* self = new (ELeave) CAknTextQueryDialog(aDataText, aTone);
  1178     CAknTextQueryDialog* self = new (ELeave) CAknTextQueryDialog(aDataText, aTone);
  1065     AKNTASHOOK_ADDL( self, "CAknTextQueryDialog" );
  1179     AKNTASHOOK_ADDL( self, "CAknTextQueryDialog" );
       
  1180     _AKNTRACE_FUNC_EXIT;
  1066     return self;
  1181     return self;
  1067     }
  1182     }
  1068 
  1183 
  1069 
  1184 
  1070 EXPORT_C CAknTextQueryDialog::CAknTextQueryDialog
  1185 EXPORT_C CAknTextQueryDialog::CAknTextQueryDialog
  1080     {
  1195     {
  1081     }
  1196     }
  1082 
  1197 
  1083 EXPORT_C CAknTextQueryDialog::~CAknTextQueryDialog()
  1198 EXPORT_C CAknTextQueryDialog::~CAknTextQueryDialog()
  1084     {
  1199     {
       
  1200 	_AKNTRACE( "[%s][%s] ", "CAknTextQueryDialog", "~CAknTextQueryDialog");
  1085     AKNTASHOOK_REMOVE();
  1201     AKNTASHOOK_REMOVE();
  1086     }
  1202     }
  1087 
  1203 
  1088 EXPORT_C TBool CAknTextQueryDialog::CheckIfEntryTextOk() const
  1204 EXPORT_C TBool CAknTextQueryDialog::CheckIfEntryTextOk() const
  1089     {
  1205     {
  1098     return EFalse;
  1214     return EFalse;
  1099     }
  1215     }
  1100 
  1216 
  1101 EXPORT_C void CAknTextQueryDialog::SetDefaultInputMode(TInt aInputMode)
  1217 EXPORT_C void CAknTextQueryDialog::SetDefaultInputMode(TInt aInputMode)
  1102     {
  1218     {
       
  1219     _AKNTRACE_FUNC_ENTER;
       
  1220     _AKNTRACE( "[%s][%s] aInputMode:%d ", "CAknTextQueryDialog", __FUNCTION__,aInputMode);
  1103     CAknQueryControl* control = QueryControl();
  1221     CAknQueryControl* control = QueryControl();
  1104     if ( control )
  1222     if ( control )
  1105         {
  1223         {
  1106         CEikSecretEditor* secretEditor = STATIC_CAST(CEikSecretEditor*, control->ControlByLayoutOrNull( ECodeLayout ));
  1224         CEikSecretEditor* secretEditor = STATIC_CAST(CEikSecretEditor*, control->ControlByLayoutOrNull( ECodeLayout ));
  1107         if (secretEditor)
  1225         if (secretEditor)
  1108             {
  1226             {
  1109             secretEditor->SetDefaultInputMode(aInputMode);
  1227             secretEditor->SetDefaultInputMode(aInputMode);
  1110             }
  1228             }
  1111         }
  1229         }
       
  1230     _AKNTRACE_FUNC_EXIT;
  1112     }
  1231     }
  1113 
  1232 
  1114 EXPORT_C void CAknTextQueryDialog::PreLayoutDynInitL()
  1233 EXPORT_C void CAknTextQueryDialog::PreLayoutDynInitL()
  1115     {
  1234     {
       
  1235     _AKNTRACE_FUNC_ENTER;
  1116     CAknQueryDialog::PreLayoutDynInitL();
  1236     CAknQueryDialog::PreLayoutDynInitL();
  1117 
  1237 
  1118     SetControlTextL();
  1238     SetControlTextL();
  1119     UpdateLeftSoftKeyL();
  1239     UpdateLeftSoftKeyL();
       
  1240     _AKNTRACE_FUNC_EXIT;
  1120     }
  1241     }
  1121 
  1242 
  1122 
  1243 
  1123 EXPORT_C void CAknTextQueryDialog::SetMaxLength(TInt aLength)
  1244 EXPORT_C void CAknTextQueryDialog::SetMaxLength(TInt aLength)
  1124     {
  1245     {
  1152  *
  1273  *
  1153  * @see IsLeftSoftkeyVisible
  1274  * @see IsLeftSoftkeyVisible
  1154  */
  1275  */
  1155 EXPORT_C TBool CAknTextQueryDialog::OkToExitL( TInt aButtonId )
  1276 EXPORT_C TBool CAknTextQueryDialog::OkToExitL( TInt aButtonId )
  1156     {
  1277     {
       
  1278     _AKNTRACE( "[%s][%s] aButtonId:%d ", "CAknTextQueryDialog", __FUNCTION__,aButtonId);
  1157     if ( aButtonId == EAknSoftkeyEmergencyCall )
  1279     if ( aButtonId == EAknSoftkeyEmergencyCall )
  1158         {
  1280         {
  1159         // ECS number entered and "call" softkey pressed,
  1281         // ECS number entered and "call" softkey pressed,
  1160         // send a key event to the query control to
  1282         // send a key event to the query control to
  1161         // initiate the call.
  1283         // initiate the call.
  1162         CAknQueryControl* control = QueryControl();
  1284         CAknQueryControl* control = QueryControl();
  1163         if ( control )
  1285         if ( control )
  1164             {
  1286             {
  1165             control->AttemptEmergencyCallL();
  1287             control->AttemptEmergencyCallL();
  1166             }
  1288             }
  1167         
  1289         _AKNTRACE( "[%s][%s] return ETrue ", "CAknTextQueryDialog", __FUNCTION__);
  1168         return ETrue;
  1290         return ETrue;
  1169         }
  1291         }
  1170     else if ( ( IsLeftSoftkeyVisible() && 
  1292     else if ( ( IsLeftSoftkeyVisible() && 
  1171               ( aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk ) ) )
  1293               ( aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk ) ) )
  1172         {
  1294         {
  1174         if ( control )
  1296         if ( control )
  1175             {
  1297             {
  1176             control->GetText( iDataText );
  1298             control->GetText( iDataText );
  1177             }
  1299             }
  1178             
  1300             
       
  1301         _AKNTRACE( "[%s][%s] GetText and return ETrue ", "CAknTextQueryDialog", __FUNCTION__);
  1179         return ETrue;
  1302         return ETrue;
  1180         }
  1303         }
  1181     else if( aButtonId == GetRightCBAShortKeyPress() )
  1304     else if( aButtonId == GetRightCBAShortKeyPress() )
  1182         {
  1305         {
       
  1306         _AKNTRACE( "[%s][%s] do nothing and return ETrue", "CAknTextQueryDialog", __FUNCTION__);
  1183         return ETrue;
  1307         return ETrue;
  1184         }
  1308         }
  1185  
  1309  
       
  1310     _AKNTRACE( "[%s][%s] return EFalse ", "CAknTextQueryDialog", __FUNCTION__);
  1186     return EFalse;
  1311     return EFalse;
  1187     }
  1312     }
  1188 
  1313 
  1189 void CAknTextQueryDialog::SetControlTextL()
  1314 void CAknTextQueryDialog::SetControlTextL()
  1190     {
  1315     {
  1230  * Second phase construction required to align API with multiline queries 
  1355  * Second phase construction required to align API with multiline queries 
  1231  * and because in future MAknQueryData will be used.
  1356  * and because in future MAknQueryData will be used.
  1232  */
  1357  */
  1233 EXPORT_C CAknNumberQueryDialog* CAknNumberQueryDialog::NewL(TInt& aNumber, const TTone& aTone)
  1358 EXPORT_C CAknNumberQueryDialog* CAknNumberQueryDialog::NewL(TInt& aNumber, const TTone& aTone)
  1234     {
  1359     {
       
  1360     _AKNTRACE_FUNC_ENTER;
  1235     CAknNumberQueryDialog* self = new (ELeave) CAknNumberQueryDialog(aNumber, aTone);
  1361     CAknNumberQueryDialog* self = new (ELeave) CAknNumberQueryDialog(aNumber, aTone);
  1236     AKNTASHOOK_ADDL( self, "CAknNumberQueryDialog" );
  1362     AKNTASHOOK_ADDL( self, "CAknNumberQueryDialog" );
       
  1363     _AKNTRACE_FUNC_EXIT;
  1237     return self;
  1364     return self;
  1238     }
  1365     }
  1239 
  1366 
  1240 
  1367 
  1241 EXPORT_C CAknNumberQueryDialog::CAknNumberQueryDialog
  1368 EXPORT_C CAknNumberQueryDialog::CAknNumberQueryDialog
  1248     AKNTASHOOK_REMOVE();
  1375     AKNTASHOOK_REMOVE();
  1249     }
  1376     }
  1250 
  1377 
  1251 EXPORT_C void CAknNumberQueryDialog::PreLayoutDynInitL()
  1378 EXPORT_C void CAknNumberQueryDialog::PreLayoutDynInitL()
  1252     {
  1379     {
       
  1380     _AKNTRACE_FUNC_ENTER;
  1253     CAknQueryDialog::PreLayoutDynInitL();
  1381     CAknQueryDialog::PreLayoutDynInitL();
  1254 
  1382 
  1255     CAknQueryControl* control = QueryControl();
  1383     CAknQueryControl* control = QueryControl();
  1256     if (control)
  1384     if (control)
  1257         control->SetNumberL(iNumber);
  1385         control->SetNumberL(iNumber);
       
  1386     _AKNTRACE_FUNC_EXIT;
  1258     }
  1387     }
  1259 
  1388 
  1260 EXPORT_C void CAknNumberQueryDialog::SetMinimumAndMaximum( TInt aMinimumValue,
  1389 EXPORT_C void CAknNumberQueryDialog::SetMinimumAndMaximum( TInt aMinimumValue,
  1261                                                            TInt aMaximumValue)
  1390                                                            TInt aMaximumValue)
  1262 {
  1391 {
  1267         }
  1396         }
  1268 }
  1397 }
  1269 
  1398 
  1270 EXPORT_C TBool CAknNumberQueryDialog::OkToExitL( TInt aButtonId )
  1399 EXPORT_C TBool CAknNumberQueryDialog::OkToExitL( TInt aButtonId )
  1271     {
  1400     {
       
  1401     _AKNTRACE( "[%s][%s] aButtonId:%d ", "CAknNumberQueryDialog", __FUNCTION__,aButtonId);
  1272     if ( aButtonId == EAknSoftkeyEmergencyCall )
  1402     if ( aButtonId == EAknSoftkeyEmergencyCall )
  1273         {
  1403         {
  1274         // ECS number entered and "call" softkey pressed,
  1404         // ECS number entered and "call" softkey pressed,
  1275         // send a key event to the query control to
  1405         // send a key event to the query control to
  1276         // initiate the call.
  1406         // initiate the call.
  1277         CAknQueryControl* control = QueryControl();
  1407         CAknQueryControl* control = QueryControl();
  1278         if ( control )
  1408         if ( control )
  1279             {
  1409             {
  1280             control->AttemptEmergencyCallL();
  1410             control->AttemptEmergencyCallL();
  1281             }
  1411             }
  1282         
  1412         _AKNTRACE( "[%s][%s] attempt emergency and return ETrue ", "CAknNumberQueryDialog", __FUNCTION__);
  1283         return ETrue;
  1413         return ETrue;
  1284         }
  1414         }
  1285     else if ( aButtonId == GetRightCBAShortKeyPress() )
  1415     else if ( aButtonId == GetRightCBAShortKeyPress() )
  1286         {
  1416         {
       
  1417         _AKNTRACE( "[%s][%s] do nothing and reutrn ETrue ", "CAknNumberQueryDialog", __FUNCTION__);
  1287         return ETrue;
  1418         return ETrue;
  1288         }
  1419         }
  1289     else if ( ( IsLeftSoftkeyVisible() && 
  1420     else if ( ( IsLeftSoftkeyVisible() && 
  1290               ( aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk ) ) )
  1421               ( aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk ) ) )
  1291         {
  1422         {
  1294         if ( control && control->CheckNumber() )
  1425         if ( control && control->CheckNumber() )
  1295             {
  1426             {
  1296             TRAP( e, control->PrepareForFocusLossL() );
  1427             TRAP( e, control->PrepareForFocusLossL() );
  1297             if ( e != KErrNone )
  1428             if ( e != KErrNone )
  1298                 {
  1429                 {
       
  1430                 _AKNTRACE( "[%s][%s] reutrn EFalse ", "CAknNumberQueryDialog", __FUNCTION__);
  1299                 return EFalse;
  1431                 return EFalse;
  1300                 }
  1432                 }
  1301             iNumber = control->GetNumber();
  1433             iNumber = control->GetNumber();
       
  1434             _AKNTRACE( "[%s][%s] get number and return ETrue ", "CAknNumberQueryDialog", __FUNCTION__);
  1302             return ETrue;
  1435             return ETrue;
  1303             }
  1436             }
  1304        }
  1437        }
  1305 
  1438     _AKNTRACE( "[%s][%s] return EFalse", "CAknNumberQueryDialog", __FUNCTION__);
  1306     return EFalse;
  1439     return EFalse;
  1307     }
  1440     }
  1308 
  1441 
  1309 EXPORT_C void CAknNumberQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1442 EXPORT_C void CAknNumberQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1310     { 
  1443     { 
  1341  * Second phase construction required to align API with multiline queries 
  1474  * Second phase construction required to align API with multiline queries 
  1342  * and because in future MAknQueryData will be used.
  1475  * and because in future MAknQueryData will be used.
  1343  */
  1476  */
  1344 EXPORT_C CAknTimeQueryDialog* CAknTimeQueryDialog::NewL(TTime& aTime, const TTone& aTone)
  1477 EXPORT_C CAknTimeQueryDialog* CAknTimeQueryDialog::NewL(TTime& aTime, const TTone& aTone)
  1345     {
  1478     {
       
  1479     _AKNTRACE_FUNC_ENTER;
  1346     CAknTimeQueryDialog* self = new (ELeave) CAknTimeQueryDialog(aTime, aTone);
  1480     CAknTimeQueryDialog* self = new (ELeave) CAknTimeQueryDialog(aTime, aTone);
  1347     AKNTASHOOK_ADDL( self, "CAknTimeQueryDialog" );
  1481     AKNTASHOOK_ADDL( self, "CAknTimeQueryDialog" );
       
  1482     _AKNTRACE_FUNC_EXIT;
  1348     return self;
  1483     return self;
  1349     }
  1484     }
  1350 
  1485 
  1351 EXPORT_C CAknTimeQueryDialog::CAknTimeQueryDialog
  1486 EXPORT_C CAknTimeQueryDialog::CAknTimeQueryDialog
  1352     (TTime& aTime, const TTone& aTone) : CAknQueryDialog(aTone), iTime(aTime)
  1487     (TTime& aTime, const TTone& aTone) : CAknQueryDialog(aTone), iTime(aTime)
  1366     AKNTASHOOK_REMOVE();
  1501     AKNTASHOOK_REMOVE();
  1367     }
  1502     }
  1368 
  1503 
  1369 EXPORT_C void CAknTimeQueryDialog::PreLayoutDynInitL()
  1504 EXPORT_C void CAknTimeQueryDialog::PreLayoutDynInitL()
  1370     {
  1505     {
       
  1506     _AKNTRACE_FUNC_ENTER;
  1371     CAknQueryDialog::PreLayoutDynInitL();
  1507     CAknQueryDialog::PreLayoutDynInitL();
  1372     CAknQueryControl* control = QueryControl();
  1508     CAknQueryControl* control = QueryControl();
  1373     if (control)
  1509     if (control)
  1374         control->SetTime(iTime);
  1510         control->SetTime(iTime);
       
  1511     _AKNTRACE_FUNC_EXIT;
  1375     }
  1512     }
  1376 
  1513 
  1377 EXPORT_C void CAknTimeQueryDialog::SetMinimumAndMaximum( const TTime& aMinimum, 
  1514 EXPORT_C void CAknTimeQueryDialog::SetMinimumAndMaximum( const TTime& aMinimum, 
  1378                                                          const TTime& aMaximum)
  1515                                                          const TTime& aMaximum)
  1379 {
  1516 {
  1384         }
  1521         }
  1385 }
  1522 }
  1386 
  1523 
  1387 EXPORT_C TBool CAknTimeQueryDialog::OkToExitL(TInt aButtonId)
  1524 EXPORT_C TBool CAknTimeQueryDialog::OkToExitL(TInt aButtonId)
  1388     {
  1525     {
       
  1526     _AKNTRACE( "[%s][%s] aButtonId:%d ", "CAknTimeQueryDialog", __FUNCTION__,aButtonId);
  1389     if((IsLeftSoftkeyVisible() && 
  1527     if((IsLeftSoftkeyVisible() && 
  1390         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1528         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1391         {   
  1529         {   
  1392         CAknQueryControl* control = QueryControl();
  1530         CAknQueryControl* control = QueryControl();
  1393         if ( control )
  1531         if ( control )
  1394             {
  1532             {
  1395             iTime = control->GetTime();
  1533             iTime = control->GetTime();
  1396             }
  1534             }
       
  1535         _AKNTRACE( "[%s][%s] get time and return ETrue ", "CAknTimeQueryDialog", __FUNCTION__);
  1397         return ETrue;
  1536         return ETrue;
  1398         }
  1537         }
  1399     else if(aButtonId == GetRightCBAShortKeyPress())
  1538     else if(aButtonId == GetRightCBAShortKeyPress())
  1400         return ETrue;
  1539     	{
  1401 
  1540     	_AKNTRACE( "[%s][%s] do nothing, return ETrue ", "CAknTimeQueryDialog", __FUNCTION__);
       
  1541     	return ETrue;
       
  1542     	}
       
  1543     _AKNTRACE( "[%s][%s] do nothing and return EFalse ", "CAknTimeQueryDialog", __FUNCTION__);
  1402     return EFalse;
  1544     return EFalse;
  1403     }
  1545     }
  1404 
  1546 
  1405 EXPORT_C void CAknTimeQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1547 EXPORT_C void CAknTimeQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1406     { 
  1548     { 
  1436  * Second phase construction required to align API with multiline queries 
  1578  * Second phase construction required to align API with multiline queries 
  1437  * and because in future MAknQueryData will be used.
  1579  * and because in future MAknQueryData will be used.
  1438  */
  1580  */
  1439 EXPORT_C CAknDurationQueryDialog* CAknDurationQueryDialog::NewL(TTimeIntervalSeconds& aDuration, const TTone& aTone)
  1581 EXPORT_C CAknDurationQueryDialog* CAknDurationQueryDialog::NewL(TTimeIntervalSeconds& aDuration, const TTone& aTone)
  1440     {
  1582     {
       
  1583     _AKNTRACE_FUNC_ENTER;
  1441     CAknDurationQueryDialog* self = new (ELeave) CAknDurationQueryDialog(aDuration, aTone);
  1584     CAknDurationQueryDialog* self = new (ELeave) CAknDurationQueryDialog(aDuration, aTone);
  1442     AKNTASHOOK_ADDL( self, "CAknDurationQueryDialog" );
  1585     AKNTASHOOK_ADDL( self, "CAknDurationQueryDialog" );
       
  1586     _AKNTRACE_FUNC_EXIT;
  1443     return self;
  1587     return self;
  1444     }
  1588     }
  1445 
  1589 
  1446 EXPORT_C CAknDurationQueryDialog::CAknDurationQueryDialog
  1590 EXPORT_C CAknDurationQueryDialog::CAknDurationQueryDialog
  1447     (TTimeIntervalSeconds& aDuration, const TTone& aTone) : CAknQueryDialog(aTone), iDuration(aDuration)
  1591     (TTimeIntervalSeconds& aDuration, const TTone& aTone) : CAknQueryDialog(aTone), iDuration(aDuration)
  1453     AKNTASHOOK_REMOVE();
  1597     AKNTASHOOK_REMOVE();
  1454     }
  1598     }
  1455 
  1599 
  1456 EXPORT_C void CAknDurationQueryDialog::PreLayoutDynInitL()
  1600 EXPORT_C void CAknDurationQueryDialog::PreLayoutDynInitL()
  1457     {
  1601     {
       
  1602     _AKNTRACE_FUNC_ENTER;
  1458     CAknQueryDialog::PreLayoutDynInitL();
  1603     CAknQueryDialog::PreLayoutDynInitL();
  1459     CAknQueryControl* control = QueryControl();
  1604     CAknQueryControl* control = QueryControl();
  1460     
  1605     
  1461     if (control)
  1606     if (control)
  1462         control->SetDuration(iDuration);
  1607         control->SetDuration(iDuration);
       
  1608     _AKNTRACE_FUNC_EXIT;
  1463     }
  1609     }
  1464 
  1610 
  1465 EXPORT_C void CAknDurationQueryDialog::SetMinimumAndMaximum( const TTimeIntervalSeconds& aMinimumDuration, 
  1611 EXPORT_C void CAknDurationQueryDialog::SetMinimumAndMaximum( const TTimeIntervalSeconds& aMinimumDuration, 
  1466                                                              const TTimeIntervalSeconds& aMaximumDuration)
  1612                                                              const TTimeIntervalSeconds& aMaximumDuration)
  1467 {
  1613 {
  1472         }
  1618         }
  1473 }
  1619 }
  1474 
  1620 
  1475 EXPORT_C TBool CAknDurationQueryDialog::OkToExitL(TInt aButtonId)
  1621 EXPORT_C TBool CAknDurationQueryDialog::OkToExitL(TInt aButtonId)
  1476     {
  1622     {
       
  1623 	_AKNTRACE( "[%s][%s] aButtonId:%d ", "CAknDurationQueryDialog", __FUNCTION__,aButtonId);
  1477     if((IsLeftSoftkeyVisible() && 
  1624     if((IsLeftSoftkeyVisible() && 
  1478         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1625         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1479         {   
  1626         {   
  1480         CAknQueryControl* control = QueryControl();
  1627         CAknQueryControl* control = QueryControl();
  1481         if ( control )
  1628         if ( control )
  1482             {
  1629             {
  1483             iDuration = control->GetDuration();
  1630             iDuration = control->GetDuration();
  1484             }
  1631             }
       
  1632         _AKNTRACE( "[%s][%s] get duration and return ETrue ", "CAknDurationQueryDialog", __FUNCTION__);
  1485         return ETrue;
  1633         return ETrue;
  1486         }
  1634         }
  1487     else if(aButtonId == GetRightCBAShortKeyPress())
  1635     else if(aButtonId == GetRightCBAShortKeyPress())
  1488         {
  1636         {
       
  1637         _AKNTRACE( "[%s][%s] do nothing, return ETrue ", "CAknDurationQueryDialog", __FUNCTION__);
  1489         return ETrue;
  1638         return ETrue;
  1490         }
  1639         }
       
  1640     _AKNTRACE( "[%s][%s] return ETrue ", "CAknDurationQueryDialog", __FUNCTION__);
  1491     return EFalse;
  1641     return EFalse;
  1492     }
  1642     }
  1493     
  1643     
  1494 EXPORT_C void CAknDurationQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1644 EXPORT_C void CAknDurationQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1495     { 
  1645     { 
  1542     AKNTASHOOK_REMOVE();
  1692     AKNTASHOOK_REMOVE();
  1543     }
  1693     }
  1544 
  1694 
  1545 EXPORT_C void CAknFloatingPointQueryDialog::PreLayoutDynInitL()
  1695 EXPORT_C void CAknFloatingPointQueryDialog::PreLayoutDynInitL()
  1546     {
  1696     {
       
  1697     _AKNTRACE_FUNC_ENTER;
  1547     CAknQueryDialog::PreLayoutDynInitL();
  1698     CAknQueryDialog::PreLayoutDynInitL();
  1548     CAknQueryControl* control = QueryControl();
  1699     CAknQueryControl* control = QueryControl();
  1549   
  1700   
  1550     if ( control )
  1701     if ( control )
  1551         {
  1702         {
  1552         control->SetQueryControlObserver(this);
  1703         control->SetQueryControlObserver(this);
  1553         control->SetFloatingPointNumberL(&iNumber);
  1704         control->SetFloatingPointNumberL(&iNumber);
  1554         DoSetPromptL();
  1705         DoSetPromptL();
  1555         }
  1706         }
       
  1707     _AKNTRACE_FUNC_EXIT;
  1556     }
  1708     }
  1557 
  1709 
  1558 EXPORT_C void CAknFloatingPointQueryDialog::SetMinimumAndMaximum( const TReal& aMinimumNumber, 
  1710 EXPORT_C void CAknFloatingPointQueryDialog::SetMinimumAndMaximum( const TReal& aMinimumNumber, 
  1559                                                              const TReal& aMaximumNumber)
  1711                                                              const TReal& aMaximumNumber)
  1560 {
  1712 {
  1565         }
  1717         }
  1566 }
  1718 }
  1567 
  1719 
  1568 EXPORT_C TBool CAknFloatingPointQueryDialog::OkToExitL(TInt aButtonId)
  1720 EXPORT_C TBool CAknFloatingPointQueryDialog::OkToExitL(TInt aButtonId)
  1569     {
  1721     {
       
  1722     _AKNTRACE( "[%s][%s] aButtonId :%d ", "CAknFloatingPointQueryDialog", __FUNCTION__,aButtonId);
  1570     if((IsLeftSoftkeyVisible() && 
  1723     if((IsLeftSoftkeyVisible() && 
  1571         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1724         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1572         {   
  1725         {   
  1573         CAknQueryControl* control = QueryControl();
  1726         CAknQueryControl* control = QueryControl();
  1574         if ( control )
  1727         if ( control )
  1575             {
  1728             {
  1576             iNumber = control->GetFloatingPointNumberL();
  1729             iNumber = control->GetFloatingPointNumberL();
  1577             }
  1730             }
       
  1731         _AKNTRACE( "[%s][%s] Get Floatingpoint number and return ETrue ", "CAknFloatingPointQueryDialog", __FUNCTION__);
  1578         return ETrue;
  1732         return ETrue;
  1579         }
  1733         }
  1580     else if(aButtonId == GetRightCBAShortKeyPress())
  1734     else if(aButtonId == GetRightCBAShortKeyPress())
  1581         {
  1735         {
       
  1736         _AKNTRACE( "[%s][%s] do nothing, return ETrue ", "CAknFloatingPointQueryDialog", __FUNCTION__);
  1582         return ETrue;
  1737         return ETrue;
  1583         }
  1738         }
       
  1739     _AKNTRACE( "[%s][%s] return ETrue ", "CAknFloatingPointQueryDialog", __FUNCTION__);
  1584     return EFalse;
  1740     return EFalse;
  1585     }
  1741     }
  1586     
  1742     
  1587 EXPORT_C void CAknFloatingPointQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1743 EXPORT_C void CAknFloatingPointQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1588     { 
  1744     { 
  1776 EXPORT_C void CAknMultiLineDataQueryDialog::SetPromptL(const TDesC& aFP, const TDesC& aSP)
  1932 EXPORT_C void CAknMultiLineDataQueryDialog::SetPromptL(const TDesC& aFP, const TDesC& aSP)
  1777 //
  1933 //
  1778 //Store new prompt values
  1934 //Store new prompt values
  1779 //
  1935 //
  1780     {
  1936     {
       
  1937     _AKNTRACE_FUNC_ENTER;
  1781     delete iSecondPrompt;
  1938     delete iSecondPrompt;
  1782     iSecondPrompt = NULL;
  1939     iSecondPrompt = NULL;
  1783     iSecondPrompt = aSP.AllocL();
  1940     iSecondPrompt = aSP.AllocL();
  1784 
  1941 
  1785     CAknQueryDialog::SetPromptL(aFP);
  1942     CAknQueryDialog::SetPromptL(aFP);
       
  1943     _AKNTRACE_FUNC_EXIT;
  1786     }
  1944     }
  1787 
  1945 
  1788 EXPORT_C void CAknMultiLineDataQueryDialog::DoSetPromptL()
  1946 EXPORT_C void CAknMultiLineDataQueryDialog::DoSetPromptL()
  1789     {
  1947     {
       
  1948     _AKNTRACE_FUNC_ENTER;
  1790 //
  1949 //
  1791 //Set prompt in query controls, called during layout
  1950 //Set prompt in query controls, called during layout
  1792 //
  1951 //
  1793     CAknMultilineQueryControl* secondControl = SecondControl();
  1952     CAknMultilineQueryControl* secondControl = SecondControl();
  1794     if(secondControl && iSecondPrompt && iSecondPrompt->Length())
  1953     if(secondControl && iSecondPrompt && iSecondPrompt->Length())
  1795         secondControl->SetPromptL(*iSecondPrompt);
  1954         secondControl->SetPromptL(*iSecondPrompt);
  1796     
  1955     
  1797     CAknQueryDialog::DoSetPromptL();        
  1956     CAknQueryDialog::DoSetPromptL();        
       
  1957     _AKNTRACE_FUNC_EXIT;
  1798     }
  1958     }
  1799 
  1959 
  1800 /**
  1960 /**
  1801 * Allows dismissing of queries. Same as base class implementation only take into
  1961 * Allows dismissing of queries. Same as base class implementation only take into
  1802 * consideration both controls
  1962 * consideration both controls
  1853         HandleOrientationSwitch();
  2013         HandleOrientationSwitch();
  1854 
  2014 
  1855         UpdateLeftSoftKeyL();
  2015         UpdateLeftSoftKeyL();
  1856 		return ETrue;
  2016 		return ETrue;
  1857 		}
  2017 		}
  1858 
       
  1859 
       
  1860     return EFalse;
  2018     return EFalse;
  1861     }
  2019     }
  1862 
  2020 
  1863 
  2021 
  1864 TBool CAknMultiLineDataQueryDialog::FirstLineEnabled() const
  2022 TBool CAknMultiLineDataQueryDialog::FirstLineEnabled() const
  1882    return -1;
  2040    return -1;
  1883 }
  2041 }
  1884 
  2042 
  1885 void CAknMultiLineDataQueryDialog::HandleOrientationSwitch()
  2043 void CAknMultiLineDataQueryDialog::HandleOrientationSwitch()
  1886 {
  2044 {
       
  2045 	_AKNTRACE_FUNC_ENTER;
  1887 	TBool firstLineEnabled = FirstLineEnabled();
  2046 	TBool firstLineEnabled = FirstLineEnabled();
  1888 	TBool secondLineEnabled = SecondLineEnabled();
  2047 	TBool secondLineEnabled = SecondLineEnabled();
  1889 
  2048 
  1890     if (!firstLineEnabled && !secondLineEnabled)
  2049     if (!firstLineEnabled && !secondLineEnabled)
  1891     {
  2050     {
  1911 	ctrl1->SetLatentGroupLineFollows(!firstLineEnabled);
  2070 	ctrl1->SetLatentGroupLineFollows(!firstLineEnabled);
  1912 	ctrl2->SetLatentGroupLineFollows(!secondLineEnabled);
  2071 	ctrl2->SetLatentGroupLineFollows(!secondLineEnabled);
  1913 	ctrl1->SetFocusing(firstLineEnabled);
  2072 	ctrl1->SetFocusing(firstLineEnabled);
  1914 	ctrl2->SetFocusing(secondLineEnabled);
  2073 	ctrl2->SetFocusing(secondLineEnabled);
  1915 	Layout();
  2074 	Layout();
       
  2075 	_AKNTRACE_FUNC_EXIT;
  1916 }
  2076 }
  1917 
  2077 
  1918 EXPORT_C void CAknMultiLineDataQueryDialog::HandleResourceChange(TInt aType)
  2078 EXPORT_C void CAknMultiLineDataQueryDialog::HandleResourceChange(TInt aType)
  1919 {
  2079 {
       
  2080 	_AKNTRACE_FUNC_ENTER;
  1920 	CAknQueryDialog::HandleResourceChange(aType);
  2081 	CAknQueryDialog::HandleResourceChange(aType);
  1921 	if (aType == KEikDynamicLayoutVariantSwitch)
  2082 	if (aType == KEikDynamicLayoutVariantSwitch)
  1922 		{
  2083 		{
  1923         if (Layout_Meta_Data::IsLandscapeOrientation())
  2084         if (Layout_Meta_Data::IsLandscapeOrientation())
  1924             {
  2085             {
  1929             SetBorder(AknBorderId::EAknBorderNotePopup);
  2090             SetBorder(AknBorderId::EAknBorderNotePopup);
  1930             }
  2091             }
  1931 		HandleOrientationSwitch();
  2092 		HandleOrientationSwitch();
  1932 		TRAP_IGNORE( UpdateLeftSoftKeyL() );
  2093 		TRAP_IGNORE( UpdateLeftSoftKeyL() );
  1933 		}
  2094 		}
       
  2095 	_AKNTRACE_FUNC_EXIT;
  1934 }
  2096 }
  1935 
  2097 
  1936 EXPORT_C TBool CAknMultiLineDataQueryDialog::OkToExitL(TInt aButtonId)
  2098 EXPORT_C TBool CAknMultiLineDataQueryDialog::OkToExitL(TInt aButtonId)
  1937     {
  2099     {
       
  2100     _AKNTRACE( "[%s][%s] aButtonId :%d ", "CAknMultiLineDataQueryDialog", __FUNCTION__, aButtonId);
  1938     if (Layout_Meta_Data::IsLandscapeOrientation())
  2101     if (Layout_Meta_Data::IsLandscapeOrientation())
  1939     	{
  2102     	{
  1940     if((IsLeftSoftkeyVisible() && 
  2103     if((IsLeftSoftkeyVisible() && 
  1941         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  2104         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1942         {
  2105         {
  1958 				CEikCaptionedControl *ctrl2 = GetLineByLineAndPageIndex(line2, 0);
  2121 				CEikCaptionedControl *ctrl2 = GetLineByLineAndPageIndex(line2, 0);
  1959 				TryChangeFocusToL(ctrl2->iId);
  2122 				TryChangeFocusToL(ctrl2->iId);
  1960                 HandleOrientationSwitch();
  2123                 HandleOrientationSwitch();
  1961 
  2124 
  1962                 UpdateLeftSoftKeyL();
  2125                 UpdateLeftSoftKeyL();
  1963 
  2126                 _AKNTRACE( "[%s][%s] return EFalse", "CAknMultiLineDataQueryDialog", __FUNCTION__);
  1964         		return EFalse;      		        		        		
  2127                 return EFalse;      		        		        		
  1965         		}
  2128         		}
  1966         	}
  2129         	}
  1967     	}
  2130     	}
  1968     if((IsLeftSoftkeyVisible() && 
  2131     if((IsLeftSoftkeyVisible() && 
  1969         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  2132         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1999                 secondControl->GetText( ptext );
  2162                 secondControl->GetText( ptext );
  2000                 iSecondText->Copy( *text );                        
  2163                 iSecondText->Copy( *text );                        
  2001                 CleanupStack::PopAndDestroy( text );   	
  2164                 CleanupStack::PopAndDestroy( text );   	
  2002                 }
  2165                 }
  2003             }
  2166             }
  2004 
  2167         _AKNTRACE( "[%s][%s] return ETrue ", "CAknMultiLineDataQueryDialog", __FUNCTION__);
  2005         return ETrue;
  2168         return ETrue;
  2006         }
  2169         }
  2007     else if(aButtonId == GetRightCBAShortKeyPress())
  2170     else if(aButtonId == GetRightCBAShortKeyPress())
  2008         {
  2171         {
       
  2172         _AKNTRACE( "[%s][%s] do nothing,return ETrue  ", "CAknMultiLineDataQueryDialog", __FUNCTION__);
  2009         return ETrue;
  2173         return ETrue;
  2010         }
  2174         }
  2011     
  2175     _AKNTRACE( "[%s][%s] do nothing,return EFalse ", "CAknMultiLineDataQueryDialog", __FUNCTION__);
  2012     return EFalse;
  2176     return EFalse;
  2013     }
  2177     }
  2014 
  2178 
  2015 EXPORT_C void CAknMultiLineDataQueryDialog::UpdateLeftSoftKeyL()
  2179 EXPORT_C void CAknMultiLineDataQueryDialog::UpdateLeftSoftKeyL()
  2016     {
  2180     {
  2017     
       
  2018     if (Layout_Meta_Data::IsLandscapeOrientation())
  2181     if (Layout_Meta_Data::IsLandscapeOrientation())
  2019     	{
  2182     	{
  2020 	    if ( (FirstControl()->EditorContentIsValidL() && FirstControl()->IsFocused()) || (SecondControl()->EditorContentIsValidL() && FirstControl()->EditorContentIsValidL()) )
  2183 	    if ( (FirstControl()->EditorContentIsValidL() && FirstControl()->IsFocused()) || (SecondControl()->EditorContentIsValidL() && FirstControl()->EditorContentIsValidL()) )
  2021 	        {
  2184 	        {
  2022 	        MakeLeftSoftkeyVisible(ETrue);
  2185 	        MakeLeftSoftkeyVisible(ETrue);
  2068                                                                     TDesC* aPrompt,
  2231                                                                     TDesC* aPrompt,
  2069                                                                     TDesC* aPrompt2,
  2232                                                                     TDesC* aPrompt2,
  2070                                                                     const TTone& aTone)
  2233                                                                     const TTone& aTone)
  2071                                                                     : CAknQueryDialog(aTone)
  2234                                                                     : CAknQueryDialog(aTone)
  2072     {
  2235     {
       
  2236     _AKNTRACE_FUNC_ENTER;
  2073     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2237     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2074     TRAP(ignore,SetDataL(*aTime,*aTime2));
  2238     TRAP(ignore,SetDataL(*aTime,*aTime2));
  2075     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2239     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
       
  2240     _AKNTRACE_FUNC_EXIT;
  2076     }
  2241     }
  2077 
  2242 
  2078 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText,
  2243 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText,
  2079                                                                     TDes* aDataText2,
  2244                                                                     TDes* aDataText2,
  2080                                                                     TDesC* aPrompt,
  2245                                                                     TDesC* aPrompt,
  2081                                                                     TDesC* aPrompt2,
  2246                                                                     TDesC* aPrompt2,
  2082                                                                     const TTone& aTone)
  2247                                                                     const TTone& aTone)
  2083                                                                     : CAknQueryDialog(aTone)
  2248                                                                     : CAknQueryDialog(aTone)
  2084     {
  2249     {
       
  2250     _AKNTRACE_FUNC_ENTER;
  2085     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2251     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2086     TRAP(ignore,SetDataL(*aDataText,*aDataText2));
  2252     TRAP(ignore,SetDataL(*aDataText,*aDataText2));
  2087 
  2253 
  2088     iText = aDataText;
  2254     iText = aDataText;
  2089     iSecondText = aDataText2;
  2255     iSecondText = aDataText2;
  2090     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2256     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
       
  2257     _AKNTRACE_FUNC_EXIT;
  2091     }
  2258     }
  2092 
  2259 
  2093 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText, 
  2260 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText, 
  2094                                                                     TTime* aTime,
  2261                                                                     TTime* aTime,
  2095                                                                     TDesC* aPrompt,
  2262                                                                     TDesC* aPrompt,
  2096                                                                     TDesC* aPrompt2,
  2263                                                                     TDesC* aPrompt2,
  2097                                                                     const TTone& aTone)
  2264                                                                     const TTone& aTone)
  2098                                                                     : CAknQueryDialog(aTone)
  2265                                                                     : CAknQueryDialog(aTone)
  2099     {
  2266     {
       
  2267     _AKNTRACE_FUNC_ENTER;
  2100     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2268     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2101     TRAP(ignore,SetDataL(*aDataText,*aTime));
  2269     TRAP(ignore,SetDataL(*aDataText,*aTime));
  2102 
  2270 
  2103     iText = aDataText;
  2271     iText = aDataText;
  2104     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2272     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
       
  2273     _AKNTRACE_FUNC_EXIT;
  2105     }
  2274     }
  2106 
  2275 
  2107 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText, 
  2276 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText, 
  2108                                                                     TInt* aNumber,
  2277                                                                     TInt* aNumber,
  2109                                                                     TDesC* aPrompt,
  2278                                                                     TDesC* aPrompt,
  2110                                                                     TDesC* aPrompt2,
  2279                                                                     TDesC* aPrompt2,
  2111                                                                     const TTone& aTone)
  2280                                                                     const TTone& aTone)
  2112                                                                     : CAknQueryDialog(aTone)
  2281                                                                     : CAknQueryDialog(aTone)
  2113     {
  2282     {
       
  2283     _AKNTRACE_FUNC_ENTER;
  2114     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2284     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2115     TRAP(ignore,SetDataL(*aDataText,*aNumber));
  2285     TRAP(ignore,SetDataL(*aDataText,*aNumber));
  2116 
  2286 
  2117     iText = aDataText;
  2287     iText = aDataText;
  2118     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2288     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
       
  2289     _AKNTRACE_FUNC_EXIT;
  2119     }
  2290     }
  2120 
  2291 
  2121 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TInt* aNumber, 
  2292 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TInt* aNumber, 
  2122                                                                     TInt* aNumber2,
  2293                                                                     TInt* aNumber2,
  2123                                                                     TDesC* aPrompt,
  2294                                                                     TDesC* aPrompt,
  2124                                                                     TDesC* aPrompt2,
  2295                                                                     TDesC* aPrompt2,
  2125                                                                     const TTone& aTone)
  2296                                                                     const TTone& aTone)
  2126                                                                     : CAknQueryDialog(aTone)
  2297                                                                     : CAknQueryDialog(aTone)
  2127     {
  2298     {
       
  2299     _AKNTRACE_FUNC_ENTER;
  2128     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2300     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2129     TRAP(ignore,SetDataL(*aNumber,*aNumber2));
  2301     TRAP(ignore,SetDataL(*aNumber,*aNumber2));
  2130     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2302     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
       
  2303     _AKNTRACE_FUNC_EXIT;
  2131     }
  2304     }
  2132 
  2305 
  2133 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText, 
  2306 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText, 
  2134                                                                     TTimeIntervalSeconds* aDuration,
  2307                                                                     TTimeIntervalSeconds* aDuration,
  2135                                                                     TDesC* aPrompt,
  2308                                                                     TDesC* aPrompt,
  2136                                                                     TDesC* aPrompt2,
  2309                                                                     TDesC* aPrompt2,
  2137                                                                     const TTone& aTone)
  2310                                                                     const TTone& aTone)
  2138                                                                     : CAknQueryDialog(aTone)
  2311                                                                     : CAknQueryDialog(aTone)
  2139     {
  2312     {
       
  2313     _AKNTRACE_FUNC_ENTER;
  2140     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2314     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2141     TRAP(ignore,SetDataL(*aDataText,*aDuration));
  2315     TRAP(ignore,SetDataL(*aDataText,*aDuration));
  2142     
  2316     
  2143     iText = aDataText;
  2317     iText = aDataText;
  2144     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2318     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2149                                                                     TDesC* aPrompt,
  2323                                                                     TDesC* aPrompt,
  2150                                                                     TDesC* aPrompt2,
  2324                                                                     TDesC* aPrompt2,
  2151                                                                     const TTone& aTone)
  2325                                                                     const TTone& aTone)
  2152                                                                     : CAknQueryDialog(aTone)
  2326                                                                     : CAknQueryDialog(aTone)
  2153     {
  2327     {
       
  2328     _AKNTRACE_FUNC_ENTER;
  2154     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2329     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2155     TRAP(ignore,SetDataL(*aTime,*aDuration));
  2330     TRAP(ignore,SetDataL(*aTime,*aDuration));
  2156     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2331     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
       
  2332     _AKNTRACE_FUNC_EXIT;
  2157     }
  2333     }
  2158     
  2334     
  2159 EXPORT_C void CAknMultiLineDataQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  2335 EXPORT_C void CAknMultiLineDataQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  2160     { 
  2336     { 
  2161     CAknQueryDialog::HandlePointerEventL(aPointerEvent); 
  2337     CAknQueryDialog::HandlePointerEventL(aPointerEvent); 
  2192  * Second phase construction required to align API with multiline queries 
  2368  * Second phase construction required to align API with multiline queries 
  2193  * and because in future MAknQueryData will be used.
  2369  * and because in future MAknQueryData will be used.
  2194  */
  2370  */
  2195 EXPORT_C CAknIpAddressQueryDialog* CAknIpAddressQueryDialog::NewL(TInetAddr& aInetAddr, const TTone& aTone)
  2371 EXPORT_C CAknIpAddressQueryDialog* CAknIpAddressQueryDialog::NewL(TInetAddr& aInetAddr, const TTone& aTone)
  2196     {
  2372     {
       
  2373     _AKNTRACE_FUNC_ENTER;
  2197     CAknIpAddressQueryDialog* self = new (ELeave) CAknIpAddressQueryDialog(aInetAddr, aTone);
  2374     CAknIpAddressQueryDialog* self = new (ELeave) CAknIpAddressQueryDialog(aInetAddr, aTone);
  2198     AKNTASHOOK_ADDL( self, "CAknIpAddressQueryDialog" );
  2375     AKNTASHOOK_ADDL( self, "CAknIpAddressQueryDialog" );
       
  2376     _AKNTRACE_FUNC_EXIT;
  2199     return self;
  2377     return self;
  2200     }
  2378     }
  2201 
  2379 
  2202 CAknIpAddressQueryDialog::CAknIpAddressQueryDialog
  2380 CAknIpAddressQueryDialog::CAknIpAddressQueryDialog
  2203     (TInetAddr& aInetAddr, const TTone& aTone) : CAknQueryDialog(aTone), iInetAddr(aInetAddr)
  2381     (TInetAddr& aInetAddr, const TTone& aTone) : CAknQueryDialog(aTone), iInetAddr(aInetAddr)
  2204     {
  2382     {
  2205     }
  2383     }
  2206 
  2384 
  2207 EXPORT_C CAknIpAddressQueryDialog::~CAknIpAddressQueryDialog()
  2385 EXPORT_C CAknIpAddressQueryDialog::~CAknIpAddressQueryDialog()
  2208     {
  2386     {
       
  2387     _AKNTRACE_FUNC_ENTER;
  2209     AKNTASHOOK_REMOVE();
  2388     AKNTASHOOK_REMOVE();
       
  2389     _AKNTRACE_FUNC_EXIT;
  2210     }
  2390     }
  2211 EXPORT_C void CAknIpAddressQueryDialog::SetSizeAndPosition(
  2391 EXPORT_C void CAknIpAddressQueryDialog::SetSizeAndPosition(
  2212         const TSize& aSize )
  2392         const TSize& aSize )
  2213     {
  2393     {
       
  2394     _AKNTRACE_FUNC_ENTER;
       
  2395     _AKNTRACE( "[%s][%s] aSize (W[%d],H[%d]) ", "CAknIpAddressQueryDialog", __FUNCTION__, aSize.iWidth, aSize.iHeight);
  2214     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());    
  2396     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());    
  2215     if(control)
  2397     if(control)
  2216         {
  2398         {
  2217         if ( AknLayoutUtils::PenEnabled() )
  2399         if ( AknLayoutUtils::PenEnabled() )
  2218             {
  2400             {
  2242                 layoutHeading.LayoutRect(mainPane, headingL); 
  2424                 layoutHeading.LayoutRect(mainPane, headingL); 
  2243                 TRect headRect(layoutHeading.Rect());
  2425                 TRect headRect(layoutHeading.Rect());
  2244 
  2426 
  2245                 winRect.iTl.iY -= headRect.Height();
  2427                 winRect.iTl.iY -= headRect.Height();
  2246                 }
  2428                 }
  2247             
  2429             _AKNTRACE( "[%s][%s] winRect(x[%d], y[%d], W[%d], H[%d] ) ", 
       
  2430             		"CAknIpAddressQueryDialog", __FUNCTION__, winRect.iTl.iX, winRect.iTl.iY,
       
  2431             		winRect.Width(), winRect.Height());
  2248             SetRect(winRect);
  2432             SetRect(winRect);
  2249             }
  2433             }
  2250         }
  2434         }
       
  2435     _AKNTRACE_FUNC_EXIT;
  2251     }
  2436     }
  2252 
  2437 
  2253 EXPORT_C CAknQueryControl* CAknIpAddressQueryDialog::QueryControl() const
  2438 EXPORT_C CAknQueryControl* CAknIpAddressQueryDialog::QueryControl() const
  2254     {
  2439     {
  2255     CCoeControl* controlPtr = FindControlOnAnyPageWithControlType(EAknExtCtQuery);
  2440     CCoeControl* controlPtr = FindControlOnAnyPageWithControlType(EAknExtCtQuery);
  2262     return 0;
  2447     return 0;
  2263     }
  2448     }
  2264 
  2449 
  2265 EXPORT_C void CAknIpAddressQueryDialog::PreLayoutDynInitL()
  2450 EXPORT_C void CAknIpAddressQueryDialog::PreLayoutDynInitL()
  2266     {
  2451     {
       
  2452     _AKNTRACE_FUNC_ENTER;
  2267 #ifndef RD_NO_DIALOG_BORDERS
  2453 #ifndef RD_NO_DIALOG_BORDERS
  2268     SetBorder(AknBorderId::EAknBorderNotePopup);
  2454     SetBorder(AknBorderId::EAknBorderNotePopup);
  2269 #else
  2455 #else
  2270     SetBorder(TGulBorder::ENone);
  2456     SetBorder(TGulBorder::ENone);
  2271 #endif
  2457 #endif
  2290         }
  2476         }
  2291     // Create CaptionRetriever for FEP
  2477     // Create CaptionRetriever for FEP
  2292     delete iExtension;
  2478     delete iExtension;
  2293     iExtension = NULL;
  2479     iExtension = NULL;
  2294     iExtension = new(ELeave) CAknQueryDialogExtension(this);
  2480     iExtension = new(ELeave) CAknQueryDialogExtension(this);
       
  2481     _AKNTRACE_FUNC_EXIT;
  2295     }
  2482     }
  2296 
  2483 
  2297 EXPORT_C void CAknIpAddressQueryDialog::PostLayoutDynInitL()
  2484 EXPORT_C void CAknIpAddressQueryDialog::PostLayoutDynInitL()
  2298     {
  2485     {
       
  2486     _AKNTRACE_FUNC_ENTER;
  2299     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2487     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2300     if (control)
  2488     if (control)
  2301         control->StartAnimationL();
  2489         control->StartAnimationL();
       
  2490     _AKNTRACE_FUNC_EXIT;
  2302     }
  2491     }
  2303 
  2492 
  2304 EXPORT_C TBool CAknIpAddressQueryDialog::NeedToDismissQueryL(const TKeyEvent& /*aKeyEvent*/)
  2493 EXPORT_C TBool CAknIpAddressQueryDialog::NeedToDismissQueryL(const TKeyEvent& /*aKeyEvent*/)
  2305     {   
  2494     {   
  2306     return EFalse;
  2495     return EFalse;
  2315         }
  2504         }
  2316 }
  2505 }
  2317 
  2506 
  2318 EXPORT_C TBool CAknIpAddressQueryDialog::OkToExitL(TInt aButtonId)
  2507 EXPORT_C TBool CAknIpAddressQueryDialog::OkToExitL(TInt aButtonId)
  2319     {
  2508     {
       
  2509     _AKNTRACE( "[%s][%s] aButtonId : %d ", 
       
  2510                 		"CAknIpAddressQueryDialog", __FUNCTION__, aButtonId);
  2320     if((IsLeftSoftkeyVisible() && 
  2511     if((IsLeftSoftkeyVisible() && 
  2321         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  2512         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  2322         {   
  2513         {   
  2323         CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2514         CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2324         if ( control )
  2515         if ( control )
  2325             {
  2516             {
  2326             iInetAddr = control->GetInetAddress();
  2517             iInetAddr = control->GetInetAddress();
  2327             }
  2518             }
       
  2519         _AKNTRACE( "[%s][%s] get address and return ETrue", "CAknIpAddressQueryDialog", __FUNCTION__);
  2328         return ETrue;
  2520         return ETrue;
  2329         }
  2521         }
  2330     else if(aButtonId == GetRightCBAShortKeyPress())
  2522     else if(aButtonId == GetRightCBAShortKeyPress())
  2331         {
  2523         {
       
  2524         _AKNTRACE( "[%s][%s] do nothing, return ETrue", "CAknIpAddressQueryDialog", __FUNCTION__);
  2332         return ETrue;
  2525         return ETrue;
  2333         }
  2526         }
       
  2527     _AKNTRACE( "[%s][%s] do nothing, return EFalse", "CAknIpAddressQueryDialog", __FUNCTION__);
  2334     return EFalse;
  2528     return EFalse;
  2335     }
  2529     }
  2336 
  2530 
  2337 
  2531 
  2338 EXPORT_C void CAknIpAddressQueryDialog::UpdateLeftSoftKeyL()
  2532 EXPORT_C void CAknIpAddressQueryDialog::UpdateLeftSoftKeyL()
  2382  * Second phase construction required to align API with multiline queries 
  2576  * Second phase construction required to align API with multiline queries 
  2383  * and because in future MAknQueryData will be used.
  2577  * and because in future MAknQueryData will be used.
  2384  */
  2578  */
  2385 EXPORT_C CAknFixedPointQueryDialog* CAknFixedPointQueryDialog::NewL(TInt& aNumber, const TTone& aTone)
  2579 EXPORT_C CAknFixedPointQueryDialog* CAknFixedPointQueryDialog::NewL(TInt& aNumber, const TTone& aTone)
  2386     {
  2580     {
       
  2581     _AKNTRACE_FUNC_ENTER;
  2387     CAknFixedPointQueryDialog* self = new (ELeave) CAknFixedPointQueryDialog(aNumber, aTone);
  2582     CAknFixedPointQueryDialog* self = new (ELeave) CAknFixedPointQueryDialog(aNumber, aTone);
  2388     AKNTASHOOK_ADDL( self, "CAknFixedPointQueryDialog" );
  2583     AKNTASHOOK_ADDL( self, "CAknFixedPointQueryDialog" );
       
  2584     _AKNTRACE_FUNC_EXIT;
  2389     return self;
  2585     return self;
  2390     }
  2586     }
  2391 
  2587 
  2392 CAknFixedPointQueryDialog::CAknFixedPointQueryDialog
  2588 CAknFixedPointQueryDialog::CAknFixedPointQueryDialog
  2393     (TInt& aNumber, const TTone& aTone) : CAknQueryDialog(aTone), iNumber(aNumber)
  2589     (TInt& aNumber, const TTone& aTone) : CAknQueryDialog(aTone), iNumber(aNumber)
  2399     AKNTASHOOK_REMOVE();
  2595     AKNTASHOOK_REMOVE();
  2400     }
  2596     }
  2401 EXPORT_C void CAknFixedPointQueryDialog::SetSizeAndPosition(
  2597 EXPORT_C void CAknFixedPointQueryDialog::SetSizeAndPosition(
  2402         const TSize& aSize )
  2598         const TSize& aSize )
  2403     {
  2599     {
       
  2600     _AKNTRACE_FUNC_ENTER;
       
  2601     _AKNTRACE( "[%s][%s] aSize (W[%d],H[%d]) ", "CAknFixedPointQueryDialog", __FUNCTION__, aSize.iWidth, aSize.iHeight);
  2404     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());    
  2602     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());    
  2405     if(control)
  2603     if(control)
  2406         {
  2604         {
  2407         if ( AknLayoutUtils::PenEnabled() )
  2605         if ( AknLayoutUtils::PenEnabled() )
  2408             {
  2606             {
  2432                 layoutHeading.LayoutRect(mainPane, headingL); 
  2630                 layoutHeading.LayoutRect(mainPane, headingL); 
  2433                 TRect headRect(layoutHeading.Rect());
  2631                 TRect headRect(layoutHeading.Rect());
  2434 
  2632 
  2435                 winRect.iTl.iY -= headRect.Height();
  2633                 winRect.iTl.iY -= headRect.Height();
  2436                 }
  2634                 }
  2437             
  2635             _AKNTRACE( "[%s][%s] winRect(x[%d], y[%d], W[%d], H[%d] ) ", 
       
  2636                   "CAknFixedPointQueryDialog", __FUNCTION__, winRect.iTl.iX, winRect.iTl.iY,
       
  2637                   winRect.Width(), winRect.Height());
  2438             SetRect(winRect);
  2638             SetRect(winRect);
  2439             }
  2639             }
  2440         }
  2640         }
       
  2641     _AKNTRACE_FUNC_EXIT;
  2441     }
  2642     }
  2442 
  2643 
  2443 EXPORT_C CAknQueryControl* CAknFixedPointQueryDialog::QueryControl() const
  2644 EXPORT_C CAknQueryControl* CAknFixedPointQueryDialog::QueryControl() const
  2444     {
  2645     {
  2445     CCoeControl* controlPtr = FindControlOnAnyPageWithControlType(EAknExtCtQuery);
  2646     CCoeControl* controlPtr = FindControlOnAnyPageWithControlType(EAknExtCtQuery);
  2452     return 0;
  2653     return 0;
  2453     }
  2654     }
  2454 
  2655 
  2455 EXPORT_C void CAknFixedPointQueryDialog::PreLayoutDynInitL()
  2656 EXPORT_C void CAknFixedPointQueryDialog::PreLayoutDynInitL()
  2456     {
  2657     {
       
  2658     _AKNTRACE_FUNC_ENTER;
  2457 #ifndef RD_NO_DIALOG_BORDERS
  2659 #ifndef RD_NO_DIALOG_BORDERS
  2458     SetBorder(AknBorderId::EAknBorderNotePopup);
  2660     SetBorder(AknBorderId::EAknBorderNotePopup);
  2459 #else
  2661 #else
  2460     SetBorder(TGulBorder::ENone);
  2662     SetBorder(TGulBorder::ENone);
  2461 #endif
  2663 #endif
  2480         }
  2682         }
  2481     // Create CaptionRetriever for FEP
  2683     // Create CaptionRetriever for FEP
  2482     delete iExtension;
  2684     delete iExtension;
  2483     iExtension = NULL;
  2685     iExtension = NULL;
  2484     iExtension = new(ELeave) CAknQueryDialogExtension(this);
  2686     iExtension = new(ELeave) CAknQueryDialogExtension(this);
       
  2687     _AKNTRACE_FUNC_EXIT;
  2485     }
  2688     }
  2486 
  2689 
  2487 EXPORT_C void CAknFixedPointQueryDialog::PostLayoutDynInitL()
  2690 EXPORT_C void CAknFixedPointQueryDialog::PostLayoutDynInitL()
  2488     {
  2691     {
       
  2692     _AKNTRACE_FUNC_ENTER;
  2489     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2693     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2490     if (control)
  2694     if (control)
  2491         control->StartAnimationL();
  2695         control->StartAnimationL();
       
  2696     _AKNTRACE_FUNC_EXIT;
  2492     }
  2697     }
  2493 
  2698 
  2494 EXPORT_C TBool CAknFixedPointQueryDialog::NeedToDismissQueryL(const TKeyEvent& /*aKeyEvent*/)
  2699 EXPORT_C TBool CAknFixedPointQueryDialog::NeedToDismissQueryL(const TKeyEvent& /*aKeyEvent*/)
  2495     {   
  2700     {   
  2496     return EFalse;
  2701     return EFalse;
  2505         }
  2710         }
  2506 }
  2711 }
  2507 
  2712 
  2508 EXPORT_C TBool CAknFixedPointQueryDialog::OkToExitL(TInt aButtonId)
  2713 EXPORT_C TBool CAknFixedPointQueryDialog::OkToExitL(TInt aButtonId)
  2509     {
  2714     {
       
  2715     _AKNTRACE( "[%s][%s] aButtonId : %d  ", "CAknFixedPointQueryDialog", __FUNCTION__, aButtonId);
  2510     if((IsLeftSoftkeyVisible() && 
  2716     if((IsLeftSoftkeyVisible() && 
  2511         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  2717         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  2512         {   
  2718         {   
  2513         CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2719         CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2514         if ( control )
  2720         if ( control )
  2515             {
  2721             {
  2516             iNumber = control->GetFixedPointNumber();
  2722             iNumber = control->GetFixedPointNumber();
  2517             }
  2723             }
       
  2724         _AKNTRACE( "[%s][%s] get point number and return ETrue ", "CAknFixedPointQueryDialog", __FUNCTION__);
  2518         return ETrue;
  2725         return ETrue;
  2519         }
  2726         }
  2520     else if(aButtonId == GetRightCBAShortKeyPress())
  2727     else if(aButtonId == GetRightCBAShortKeyPress())
  2521         {
  2728         {
       
  2729         _AKNTRACE( "[%s][%s] do nothing and return ETrue ", "CAknFixedPointQueryDialog", __FUNCTION__);
  2522         return ETrue;
  2730         return ETrue;
  2523         }
  2731         }
       
  2732     _AKNTRACE( "[%s][%s] return EFalse ", "CAknFixedPointQueryDialog", __FUNCTION__);
  2524     return EFalse;
  2733     return EFalse;
  2525     }
  2734     }
  2526 
  2735 
  2527 
  2736 
  2528 EXPORT_C void CAknFixedPointQueryDialog::UpdateLeftSoftKeyL()
  2737 EXPORT_C void CAknFixedPointQueryDialog::UpdateLeftSoftKeyL()
  2654     }
  2863     }
  2655 
  2864 
  2656 
  2865 
  2657 EXPORT_C void CAknMultiLineIpQueryDialog::PreLayoutDynInitL()
  2866 EXPORT_C void CAknMultiLineIpQueryDialog::PreLayoutDynInitL()
  2658     {
  2867     {
       
  2868     _AKNTRACE_FUNC_ENTER;
  2659     if (Layout_Meta_Data::IsLandscapeOrientation())
  2869     if (Layout_Meta_Data::IsLandscapeOrientation())
  2660         {
  2870         {
  2661         SetBorder( TGulBorder::ENone );
  2871         SetBorder( TGulBorder::ENone );
  2662         }
  2872         }
  2663     SetEditableL( ETrue );
  2873     SetEditableL( ETrue );
  2688     
  2898     
  2689     // Create CaptionRetriever for FEP
  2899     // Create CaptionRetriever for FEP
  2690     delete iExtension;
  2900     delete iExtension;
  2691     iExtension = NULL;
  2901     iExtension = NULL;
  2692     iExtension = new(ELeave) CAknMultilineQueryDialogExtension(this, CAknMultilineQueryDialogExtension::EMultIPQuery);
  2902     iExtension = new(ELeave) CAknMultilineQueryDialogExtension(this, CAknMultilineQueryDialogExtension::EMultIPQuery);
       
  2903     _AKNTRACE_FUNC_EXIT;
  2693     }
  2904     }
  2694 
  2905 
  2695 EXPORT_C void CAknMultiLineIpQueryDialog::SetPromptL(const TDesC& aFP, const TDesC& aSP)
  2906 EXPORT_C void CAknMultiLineIpQueryDialog::SetPromptL(const TDesC& aFP, const TDesC& aSP)
  2696 //
  2907 //
  2697 //Store new prompt values
  2908 //Store new prompt values
  2747     return -1;
  2958     return -1;
  2748     }
  2959     }
  2749 
  2960 
  2750 void CAknMultiLineIpQueryDialog::HandleOrientationSwitch()
  2961 void CAknMultiLineIpQueryDialog::HandleOrientationSwitch()
  2751     {
  2962     {
       
  2963     _AKNTRACE_FUNC_ENTER;
  2752     TBool firstLineEnabled = FirstLineEnabled();
  2964     TBool firstLineEnabled = FirstLineEnabled();
  2753     TBool secondLineEnabled = SecondLineEnabled();
  2965     TBool secondLineEnabled = SecondLineEnabled();
  2754 
  2966 
  2755     if (!firstLineEnabled && !secondLineEnabled)
  2967     if (!firstLineEnabled && !secondLineEnabled)
  2756     {
  2968     {
  2776     ctrl1->SetLatentGroupLineFollows(!firstLineEnabled);
  2988     ctrl1->SetLatentGroupLineFollows(!firstLineEnabled);
  2777     ctrl2->SetLatentGroupLineFollows(!secondLineEnabled);
  2989     ctrl2->SetLatentGroupLineFollows(!secondLineEnabled);
  2778     ctrl1->SetFocusing(firstLineEnabled);
  2990     ctrl1->SetFocusing(firstLineEnabled);
  2779     ctrl2->SetFocusing(secondLineEnabled);
  2991     ctrl2->SetFocusing(secondLineEnabled);
  2780     Layout();
  2992     Layout();
       
  2993     _AKNTRACE_FUNC_EXIT;
  2781     }
  2994     }
  2782 
  2995 
  2783 
  2996 
  2784 EXPORT_C void CAknMultiLineIpQueryDialog::HandleResourceChange(TInt aType)
  2997 EXPORT_C void CAknMultiLineIpQueryDialog::HandleResourceChange(TInt aType)
  2785     {
  2998     {
       
  2999 	_AKNTRACE_FUNC_ENTER;
  2786     CAknQueryDialog::HandleResourceChange(aType);
  3000     CAknQueryDialog::HandleResourceChange(aType);
  2787     if (aType == KEikDynamicLayoutVariantSwitch)
  3001     if (aType == KEikDynamicLayoutVariantSwitch)
  2788         {
  3002         {
  2789         if (Layout_Meta_Data::IsLandscapeOrientation())
  3003         if (Layout_Meta_Data::IsLandscapeOrientation())
  2790             {
  3004             {
  2795             SetBorder(AknBorderId::EAknBorderNotePopup);
  3009             SetBorder(AknBorderId::EAknBorderNotePopup);
  2796             }
  3010             }
  2797         HandleOrientationSwitch();
  3011         HandleOrientationSwitch();
  2798         TRAP_IGNORE( UpdateLeftSoftKeyL() );
  3012         TRAP_IGNORE( UpdateLeftSoftKeyL() );
  2799         }
  3013         }
       
  3014     _AKNTRACE_FUNC_EXIT;
  2800     }
  3015     }
  2801     
  3016     
  2802 EXPORT_C TBool CAknMultiLineIpQueryDialog::OkToExitL(TInt aButtonId)
  3017 EXPORT_C TBool CAknMultiLineIpQueryDialog::OkToExitL(TInt aButtonId)
  2803     {    
  3018     {    
  2804     if (Layout_Meta_Data::IsLandscapeOrientation())
  3019     if (Layout_Meta_Data::IsLandscapeOrientation())