uifw/AvKon/src/AknQueryDialog.cpp
branchRCL_3
changeset 4 8ca85d2f0db7
parent 0 2f259fa3e83a
child 25 941195f2d488
equal deleted inserted replaced
0:2f259fa3e83a 4:8ca85d2f0db7
    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)
   414     CAknsFrameBackgroundControlContext* cc = (CAknsFrameBackgroundControlContext*)AknsDrawUtils::ControlContext( this );
   429     CAknsFrameBackgroundControlContext* cc = (CAknsFrameBackgroundControlContext*)AknsDrawUtils::ControlContext( this );
   415     cc->SetCenter(KAknsIIDQsnFrPopupCenterQuery);
   430     cc->SetCenter(KAknsIIDQsnFrPopupCenterQuery);
   416 
   431 
   417     SetGloballyCapturing(ETrue); 
   432     SetGloballyCapturing(ETrue); 
   418     TInt ret = CAknDialog::RunLD();
   433     TInt ret = CAknDialog::RunLD();
       
   434     _AKNTRACE( "[%s][%s] ret: %d", "CAknQueryDialog", __FUNCTION__, ret );
   419     if (soundSystem)
   435     if (soundSystem)
   420         {
   436         {
   421         soundSystem->PopContext();
   437         soundSystem->PopContext();
   422         }
   438         }
   423     SetGloballyCapturing(EFalse); 
   439     SetGloballyCapturing(EFalse); 
       
   440     _AKNTRACE_FUNC_EXIT;
   424     return ret;
   441     return ret;
   425     }
   442     }
   426 
   443 
   427 /**
   444 /**
   428  * deprecated
   445  * deprecated
   441  * compiler will complain if this is not implemented in
   458  * compiler will complain if this is not implemented in
   442  * derived class as well
   459  * derived class as well
   443  */
   460  */
   444 EXPORT_C TInt CAknQueryDialog::ExecuteLD(TInt aResourceId)
   461 EXPORT_C TInt CAknQueryDialog::ExecuteLD(TInt aResourceId)
   445     {
   462     {
       
   463     _AKNTRACE_FUNC_ENTER;
       
   464     _AKNTRACE( "[%s][%s] aResourceId: %d", "CAknQueryDialog", __FUNCTION__, aResourceId );
   446     PrepareLC(aResourceId);
   465     PrepareLC(aResourceId);
   447     return(RunLD());
   466     TInt ret = RunLD();
       
   467     _AKNTRACE( "[%s][%s] ret:%d", "CAknQueryDialog", __FUNCTION__,ret );
       
   468     _AKNTRACE_FUNC_EXIT;
       
   469     return ret;
   448     }
   470     }
   449 
   471 
   450 /**
   472 /**
   451  * Call PrepareLC, set the prompt and display dialog.
   473  * Call PrepareLC, set the prompt and display dialog.
   452  */
   474  */
   453 EXPORT_C TInt CAknQueryDialog::ExecuteLD(TInt aResourceId,const TDesC& aPrompt)
   475 EXPORT_C TInt CAknQueryDialog::ExecuteLD(TInt aResourceId,const TDesC& aPrompt)
   454     {
   476     {
       
   477     _AKNTRACE_FUNC_ENTER;
   455     PrepareLC(aResourceId);
   478     PrepareLC(aResourceId);
   456     SetPromptL(aPrompt);
   479     SetPromptL(aPrompt);
   457     return(RunLD());
   480     _AKNTRACE( "[%s][%s] aResourceId: %d", "CAknQueryDialog", __FUNCTION__, aResourceId );
       
   481     TInt ret= RunLD();
       
   482     _AKNTRACE( "[%s][%s] ret:%d", "CAknQueryDialog", __FUNCTION__,ret );
       
   483     _AKNTRACE_FUNC_EXIT;
       
   484     return ret;
   458     }
   485     }
   459 /**
   486 /**
   460  * Get layout information from the control and use this layout
   487  * Get layout information from the control and use this layout
   461  * information to do layout. If there is a heading, add the 
   488  * information to do layout. If there is a heading, add the 
   462  * heading height to the height returned by the control layout
   489  * heading height to the height returned by the control layout
   472  * Therefore use iAvkonAppUi->ApplicationRect() minus the height 
   499  * Therefore use iAvkonAppUi->ApplicationRect() minus the height 
   473  * of the control pane (KAknSoftkeyPaneHeight) instead of ClientRect().
   500  * of the control pane (KAknSoftkeyPaneHeight) instead of ClientRect().
   474  */
   501  */
   475 EXPORT_C void CAknQueryDialog::SetSizeAndPosition( const TSize& /*aSize*/ )
   502 EXPORT_C void CAknQueryDialog::SetSizeAndPosition( const TSize& /*aSize*/ )
   476     {
   503     {
       
   504     _AKNTRACE_FUNC_ENTER;
   477     CAknQueryControl* control = QueryControl();
   505     CAknQueryControl* control = QueryControl();
   478     CAknPopupHeadingPane* controlHeading = QueryHeading();
   506     CAknPopupHeadingPane* controlHeading = QueryHeading();
   479     
   507     
   480     if(control)
   508     if(control)
   481         {
   509         {
   491     		control->MopGetObject( dialog );
   519     		control->MopGetObject( dialog );
   492        		if ( dialog && ( dialog->DialogFlags() & EEikDialogFlagVirtualInput ) )
   520        		if ( dialog && ( dialog->DialogFlags() & EEikDialogFlagVirtualInput ) )
   493        			{
   521        			{
   494        			TAknWindowLineLayout lay = AknLayoutScalable_Avkon::application_window(0);
   522        			TAknWindowLineLayout lay = AknLayoutScalable_Avkon::application_window(0);
   495        			TRect re(0, 0, lay.iW, lay.iH);
   523        			TRect re(0, 0, lay.iW, lay.iH);
       
   524        			_AKNTRACE( "[%s][%s] Rect: x[%d],y[%d],w[%d],h[%d]", "CAknQueryDialog", __FUNCTION__, 
       
   525 							re.iTl.iX, re.iTl.iY, re.Width(),re.Height());
   496            		SetRect(re);
   526            		SetRect(re);
       
   527            		_AKNTRACE_FUNC_EXIT;
   497            		return;
   528            		return;
   498        			}
   529        			}
   499             }
   530             }
   500 #endif
   531 #endif
   501         TAknWindowLineLayout windowLineLayoutScreen = AknLayoutScalable_Avkon::Screen().LayoutLine();
   532         TAknWindowLineLayout windowLineLayoutScreen = AknLayoutScalable_Avkon::Screen().LayoutLine();
   502         TRect rectZero = TRect(0,0,0,0);
   533         TRect rectZero = TRect(0,0,0,0);
   503         TAknLayoutRect layoutRect;
   534         TAknLayoutRect layoutRect;
   504         layoutRect.LayoutRect( rectZero, windowLineLayoutScreen );
   535         layoutRect.LayoutRect( rectZero, windowLineLayoutScreen );
   505         TRect rectScreen( layoutRect.Rect() );
   536         TRect rectScreen( layoutRect.Rect() );
   506     	TSize maxSize = rectScreen.Size();
   537     	TSize maxSize = rectScreen.Size();
   507     	
   538     	_AKNTRACE( "[%s][%s] maxSize: w[%d],h[%d]", "CAknQueryDialog", __FUNCTION__, 
       
   539     			maxSize.iWidth,maxSize.iHeight);
   508         if ( AknLayoutUtils::PenEnabled() )
   540         if ( AknLayoutUtils::PenEnabled() )
   509             {
   541             {
   510             CAknDialog::SetSizeAndPosition( PreferredSize( maxSize ) );
   542             TSize preferredSize = PreferredSize( maxSize );
       
   543             
       
   544             _AKNTRACE( "[%s][%s] call CAknDialog::SetSizeAndPosition( PreferredSize( w[%d],h[%d] ) )", "CAknQueryDialog", 
       
   545             		__FUNCTION__, preferredSize.iWidth, preferredSize.iHeight);
       
   546             
       
   547             CAknDialog::SetSizeAndPosition( preferredSize );
   511             }
   548             }
   512         else
   549         else
   513             {
   550             {
   514             TAknWindowLineLayout layout;
   551             TAknWindowLineLayout layout;
   515             control->WindowLayout( layout );
   552             control->WindowLayout( layout );
   528                 TAknLayoutRect headingLayoutRect;
   565                 TAknLayoutRect headingLayoutRect;
   529                 headingLayoutRect.LayoutRect(mainPane,
   566                 headingLayoutRect.LayoutRect(mainPane,
   530                         AknLayoutScalable_Avkon::heading_pane(0)); 
   567                         AknLayoutScalable_Avkon::heading_pane(0)); 
   531                 winRect.iTl.iY -= headingLayoutRect.Rect().Height();
   568                 winRect.iTl.iY -= headingLayoutRect.Rect().Height();
   532                 }
   569                 }
       
   570             _AKNTRACE( "[%s][%s] Rect: x[%d],y[%d],w[%d],h[%d]", "CAknQueryDialog", __FUNCTION__, 
       
   571             		winRect.iTl.iX, winRect.iTl.iY, winRect.Width(),winRect.Height());
   533             SetRect(winRect);
   572             SetRect(winRect);
   534             }            
   573             }            
   535         }
   574         }
       
   575     _AKNTRACE_FUNC_EXIT;
   536     }
   576     }
   537 
   577 
   538 /**
   578 /**
   539  *
   579  *
   540  */
   580  */
   541 EXPORT_C void CAknQueryDialog::PreLayoutDynInitL()
   581 EXPORT_C void CAknQueryDialog::PreLayoutDynInitL()
   542     {
   582     {
       
   583     _AKNTRACE_FUNC_ENTER;
   543     SetBorder( TGulBorder::ENone );
   584     SetBorder( TGulBorder::ENone );
   544     SetEditableL( ETrue ) ;
   585     SetEditableL( ETrue ) ;
   545     DoSetPromptL();
   586     DoSetPromptL();
   546 
   587 
   547     CAknQueryControl* control = QueryControl();
   588     CAknQueryControl* control = QueryControl();
   562     
   603     
   563     // Create CaptionRetriever for FEP
   604     // Create CaptionRetriever for FEP
   564     delete iExtension;
   605     delete iExtension;
   565     iExtension = NULL;
   606     iExtension = NULL;
   566     iExtension = new(ELeave) CAknQueryDialogExtension(this);
   607     iExtension = new(ELeave) CAknQueryDialogExtension(this);
       
   608     _AKNTRACE_FUNC_EXIT;
   567     }
   609     }
   568 
   610 
   569 /**
   611 /**
   570  *
   612  *
   571  */
   613  */
   572 EXPORT_C void CAknQueryDialog::PostLayoutDynInitL()
   614 EXPORT_C void CAknQueryDialog::PostLayoutDynInitL()
   573     {
   615     {
       
   616     _AKNTRACE_FUNC_ENTER;
   574     CAknQueryControl* control = QueryControl();
   617     CAknQueryControl* control = QueryControl();
   575     if (control)
   618     if (control)
   576         control->StartAnimationL();
   619         control->StartAnimationL();
   577 
   620     _AKNTRACE_FUNC_EXIT;
   578     }
   621     }
   579 
   622 
   580 /**
   623 /**
   581  *
   624  *
   582  */
   625  */
   583 EXPORT_C TKeyResponse CAknQueryDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
   626 EXPORT_C TKeyResponse CAknQueryDialog::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
   584                                                             TEventCode aType)
   627                                                             TEventCode aType)
   585     {
   628     {
       
   629     _AKNTRACE( "[%s][%s] aKeyEvent.iCode[%d],aType[%d]", "CAknQueryDialog", __FUNCTION__,aKeyEvent.iCode, aType);
   586     if( NeedToDismissQueryL(aKeyEvent) )
   630     if( NeedToDismissQueryL(aKeyEvent) )
   587             return EKeyWasConsumed;
   631     	{
   588  	
   632     	_AKNTRACE( "[%s][%s] Need Dismiss Query, return EKeyWasConsumed", "CAknQueryDialog", __FUNCTION__);
       
   633     	return EKeyWasConsumed;
       
   634     	}
       
   635     
   589 	if (aType == EEventKey && aKeyEvent.iCode == EKeyOK) 	
   636 	if (aType == EEventKey && aKeyEvent.iCode == EKeyOK) 	
   590 		{
   637 		{
   591 		CAknQueryControl* control = QueryControl();
   638 		CAknQueryControl* control = QueryControl();
   592 		if (control)
   639 		if (control)
   593 			{
   640 			{
   594 			if (IsLeftSoftkeyVisible())
   641 			if (IsLeftSoftkeyVisible())
   595 				{
   642 				{
   596 				TryExitL(EEikBidOk);
   643 				TryExitL(EEikBidOk);
       
   644 				_AKNTRACE( "[%s][%s] TryExitL(EEikBidOk) and reutrn EKeyWasConsumed", "CAknQueryDialog", __FUNCTION__);
   597 				return EKeyWasConsumed;
   645 				return EKeyWasConsumed;
   598 				}
   646 				}
   599             }
   647             }
   600 		}
   648 		}
   601 	else if ( aType == EEventKey && aKeyEvent.iCode == EKeyEnter )	
   649 	else if ( aType == EEventKey && aKeyEvent.iCode == EKeyEnter )	
   605 		if (control)
   653 		if (control)
   606 			{
   654 			{
   607 			if (IsLeftSoftkeyVisible())
   655 			if (IsLeftSoftkeyVisible())
   608 				{
   656 				{
   609 				TryExitL(EEikBidOk);
   657 				TryExitL(EEikBidOk);
       
   658 				_AKNTRACE( "[%s][%s] TryExitL(EEikBidOk) and reutrn EKeyWasConsumed", "CAknQueryDialog", __FUNCTION__);
   610 				return EKeyWasConsumed;
   659 				return EKeyWasConsumed;
   611 				}
   660 				}
   612             }
   661             }
   613 		}
   662 		}
   614 	
   663 	TKeyResponse response = CAknDialog::OfferKeyEventL(aKeyEvent,aType);
   615 
   664 	_AKNTRACE( "[%s][%s] return [%d]", "CAknQueryDialog", __FUNCTION__, response);
   616     return CAknDialog::OfferKeyEventL(aKeyEvent,aType);
   665 	return response;
   617     }
   666     }
   618 
   667 
   619 /**
   668 /**
   620  * Allows dismissing of queries. Only mandatory requirement is that PIN
   669  * Allows dismissing of queries. Only mandatory requirement is that PIN
   621  * queries are dismissed by the # key. Clients can
   670  * queries are dismissed by the # key. Clients can
   622  * override this and implement something different. 
   671  * override this and implement something different. 
   623  *
   672  *
   624  */
   673  */
   625 EXPORT_C TBool CAknQueryDialog::NeedToDismissQueryL(const TKeyEvent& aKeyEvent)
   674 EXPORT_C TBool CAknQueryDialog::NeedToDismissQueryL(const TKeyEvent& aKeyEvent)
   626     {
   675     {
       
   676     _AKNTRACE( "[%s][%s] aKeyEvent.iScanCode [%d]", "CAknQueryDialog", __FUNCTION__, aKeyEvent.iScanCode);
   627     if (aKeyEvent.iScanCode == EStdKeyHash)
   677     if (aKeyEvent.iScanCode == EStdKeyHash)
   628         {
   678         {
   629         CAknQueryControl* control = QueryControl();
   679         CAknQueryControl* control = QueryControl();
   630         if (control && control->QueryType() == EPinLayout)
   680         if (control && control->QueryType() == EPinLayout)
   631             {
   681             {
       
   682             _AKNTRACE( "[%s][%s] EPinLayout, Dismiss Query and return ETrue", "CAknQueryDialog", __FUNCTION__);
   632             DismissQueryL();
   683             DismissQueryL();
   633             return ETrue;
   684             return ETrue;
   634             }
   685             }
   635         }
   686         }
       
   687     _AKNTRACE( "[%s][%s] return EFalse", "CAknQueryDialog", __FUNCTION__);
   636     return EFalse;
   688     return EFalse;
   637     }
   689     }
   638 
   690 
   639 /**
   691 /**
   640  * Dismiss query. Query is accepted if the left softkey is displayed 
   692  * Dismiss query. Query is accepted if the left softkey is displayed 
   642  * Query is discarded if the left softkey is not displayed.
   694  * Query is discarded if the left softkey is not displayed.
   643  * Clients can override this and implement something different.
   695  * Clients can override this and implement something different.
   644  */
   696  */
   645 EXPORT_C void CAknQueryDialog::DismissQueryL()
   697 EXPORT_C void CAknQueryDialog::DismissQueryL()
   646     {
   698     {
       
   699     _AKNTRACE_FUNC_ENTER;
   647     if (IsLeftSoftkeyVisible())
   700     if (IsLeftSoftkeyVisible())
   648         {
   701         {
       
   702         _AKNTRACE( "[%s][%s] TryExitL(EEikBidOk) ", "CAknQueryDialog", __FUNCTION__);
   649         TryExitL(EEikBidOk);
   703         TryExitL(EEikBidOk);
   650         }
   704         }
   651     else
   705     else
   652         {
   706         {
       
   707         _AKNTRACE( "[%s][%s] TryExitL(EEikBidCancel) ", "CAknQueryDialog", __FUNCTION__);
   653         TryExitL(EEikBidCancel);
   708         TryExitL(EEikBidCancel);
   654         }
   709         }
       
   710     _AKNTRACE_FUNC_EXIT;
   655     }
   711     }
   656 
   712 
   657 /**
   713 /**
   658  *
   714  *
   659  */
   715  */
   660 EXPORT_C TBool CAknQueryDialog::OkToExitL(TInt aButtonId)
   716 EXPORT_C TBool CAknQueryDialog::OkToExitL(TInt aButtonId)
   661     {
   717     {
       
   718     _AKNTRACE( "[%s][%s] aButtonId : %d ", "CAknQueryDialog", __FUNCTION__,aButtonId);
   662     if ( aButtonId == EAknSoftkeyEmergencyCall )
   719     if ( aButtonId == EAknSoftkeyEmergencyCall )
   663         {
   720         {
   664         // ECS number entered and "call" softkey pressed,
   721         // ECS number entered and "call" softkey pressed,
   665         // send a key event to the query control to
   722         // send a key event to the query control to
   666         // initiate the call.
   723         // initiate the call.
   667         CAknQueryControl* control = QueryControl();
   724         CAknQueryControl* control = QueryControl();
   668         if ( control )
   725         if ( control )
   669             {
   726             {
       
   727             _AKNTRACE( "[%s][%s] AttemptEmergencyCall ", "CAknQueryDialog", __FUNCTION__);
   670             control->AttemptEmergencyCallL();
   728             control->AttemptEmergencyCallL();
   671             }
   729             }
   672         
   730         _AKNTRACE( "[%s][%s] return ETrue without doing anything", "CAknQueryDialog", __FUNCTION__);
   673         return ETrue;
   731         return ETrue;
   674         }
   732         }
   675     else if((IsLeftSoftkeyVisible() && 
   733     else if((IsLeftSoftkeyVisible() && 
   676         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk))
   734         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk))
   677         || aButtonId == GetRightCBAShortKeyPress() )
   735         || aButtonId == GetRightCBAShortKeyPress() )
   678         {   
   736         { 
       
   737         _AKNTRACE( "[%s][%s] return ETrue without doing anything ", "CAknQueryDialog", __FUNCTION__);
   679         return ETrue;
   738         return ETrue;
   680         }
   739         }
       
   740     
       
   741     _AKNTRACE( "[%s][%s] return EFalse without doing anyting ", "CAknQueryDialog", __FUNCTION__);
   681     return EFalse;
   742     return EFalse;
   682     }
   743     }
   683 
   744 
   684 /**
   745 /**
   685  * Return pointer to query heading or NULL (use QueryHeading())
   746  * Return pointer to query heading or NULL (use QueryHeading())
   694 /**
   755 /**
   695  * Set prompt text for query. 
   756  * Set prompt text for query. 
   696  */
   757  */
   697 EXPORT_C void CAknQueryDialog::SetPromptL(const TDesC& aPrompt)
   758 EXPORT_C void CAknQueryDialog::SetPromptL(const TDesC& aPrompt)
   698     {
   759     {
       
   760     _AKNTRACE_FUNC_ENTER;
   699     delete iPrompt;
   761     delete iPrompt;
   700     iPrompt = NULL;
   762     iPrompt = NULL;
   701     iPrompt = aPrompt.AllocL();
   763     iPrompt = aPrompt.AllocL();
   702     DoSetPromptL();
   764     DoSetPromptL();
       
   765     _AKNTRACE_FUNC_EXIT;
   703     }
   766     }
   704 
   767 
   705 EXPORT_C void CAknQueryDialog::DoSetPromptL()
   768 EXPORT_C void CAknQueryDialog::DoSetPromptL()
   706     {
   769     {
   707     CAknQueryControl* control = QueryControl();
   770     CAknQueryControl* control = QueryControl();
   776     return 0;
   839     return 0;
   777     }
   840     }
   778 
   841 
   779 EXPORT_C void CAknQueryDialog::MakeLeftSoftkeyVisible(TBool aVisible)
   842 EXPORT_C void CAknQueryDialog::MakeLeftSoftkeyVisible(TBool aVisible)
   780     {  
   843     {  
       
   844     _AKNTRACE_FUNC_ENTER;
       
   845     _AKNTRACE( "[%s][%s] aVisible: %d ", "CAknQueryDialog", __FUNCTION__, aVisible);
   781     CEikButtonGroupContainer& btnGroupContainer = ButtonGroupContainer();
   846     CEikButtonGroupContainer& btnGroupContainer = ButtonGroupContainer();
   782 
   847 
   783     // left softkey
   848     // left softkey
   784     TBool isVisible = btnGroupContainer.IsCommandVisibleByPosition(CEikButtonGroupContainer::ELeftSoftkeyPosition);
   849     TBool isVisible = btnGroupContainer.IsCommandVisibleByPosition(CEikButtonGroupContainer::ELeftSoftkeyPosition);
       
   850     _AKNTRACE( "[%s][%s] isVisible: %d ", "CAknQueryDialog", __FUNCTION__, isVisible);
   785     if ( isVisible != aVisible )
   851     if ( isVisible != aVisible )
   786         {
   852         {
   787         btnGroupContainer.MakeCommandVisibleByPosition(CEikButtonGroupContainer::ELeftSoftkeyPosition,aVisible);
   853         btnGroupContainer.MakeCommandVisibleByPosition(CEikButtonGroupContainer::ELeftSoftkeyPosition,aVisible);
   788         }
   854         }
   789 
   855 
   794         if ( isVisible != aVisible )
   860         if ( isVisible != aVisible )
   795             {
   861             {
   796             btnGroupContainer.MakeCommandVisibleByPosition(CEikButtonGroupContainer::EMiddleSoftkeyPosition,aVisible);
   862             btnGroupContainer.MakeCommandVisibleByPosition(CEikButtonGroupContainer::EMiddleSoftkeyPosition,aVisible);
   797             }
   863             }
   798         }
   864         }
       
   865     _AKNTRACE_FUNC_EXIT;
   799     }
   866     }
   800 
   867 
   801 
   868 
   802 
   869 
   803 void CAknQueryDialog::PlayTone()
   870 void CAknQueryDialog::PlayTone()
   804     {
   871     {
       
   872     _AKNTRACE_FUNC_ENTER;
   805     if (iTone != 0 && iSoundSystem)
   873     if (iTone != 0 && iSoundSystem)
   806         {
   874         {
       
   875         _AKNTRACE( "[%s][%s] iSoundSystem->PlaySound(iTone)", "CAknQueryDialog", __FUNCTION__);
   807         iSoundSystem->PlaySound(iTone);
   876         iSoundSystem->PlaySound(iTone);
   808         }
   877         }
       
   878     _AKNTRACE_FUNC_EXIT;
   809     }
   879     }
   810 
   880 
   811 /** 
   881 /** 
   812  * Reset timers monitoring user inactivity. Will make applications
   882  * Reset timers monitoring user inactivity. Will make applications
   813  * using these timers react, e.g. if the screen saver is running,
   883  * using these timers react, e.g. if the screen saver is running,
   814  * this will disactivate it (as from screen saver specs)
   884  * this will disactivate it (as from screen saver specs)
   815  */ 
   885  */ 
   816 void CAknQueryDialog::ReportUserActivity() const 
   886 void CAknQueryDialog::ReportUserActivity() const 
   817     {
   887     {
       
   888     _AKNTRACE_FUNC_ENTER;
   818 #ifdef AVKON_RDEBUG_INFO
   889 #ifdef AVKON_RDEBUG_INFO
   819     RDebug::Print(_L("Reset user inactivity"));
   890     RDebug::Print(_L("Reset user inactivity"));
   820 #endif
   891 #endif
   821     User::ResetInactivityTime();
   892     User::ResetInactivityTime();
       
   893     _AKNTRACE_FUNC_EXIT;
   822     }
   894     }
   823 
   895 
   824 TInt CAknQueryDialog::GetLeftCBAShortKeyPress()
   896 TInt CAknQueryDialog::GetLeftCBAShortKeyPress()
   825     {
   897     {
   826     return TInt16(0xffff & TInt16(ButtonGroupContainer().ButtonGroup()->CommandId(0)));
   898     return TInt16(0xffff & TInt16(ButtonGroupContainer().ButtonGroup()->CommandId(0)));
   831     return TInt16(0xffff & TInt16(ButtonGroupContainer().ButtonGroup()->CommandId(2)));
   903     return TInt16(0xffff & TInt16(ButtonGroupContainer().ButtonGroup()->CommandId(2)));
   832     }
   904     }
   833 
   905 
   834 TBool CAknQueryDialog::IsLeftSoftkeyVisible()
   906 TBool CAknQueryDialog::IsLeftSoftkeyVisible()
   835     {
   907     {
   836     return ButtonGroupContainer().ButtonGroup()->IsCommandVisible(
   908     _AKNTRACE_FUNC_ENTER;
   837                       ButtonGroupContainer().ButtonGroup()->CommandId(0));
   909     TBool visible = ButtonGroupContainer().ButtonGroup()->IsCommandVisible(
       
   910             ButtonGroupContainer().ButtonGroup()->CommandId(0));
       
   911     _AKNTRACE( "[%s][%s] visible: %d", "CAknQueryDialog", __FUNCTION__, visible);
       
   912     _AKNTRACE_FUNC_EXIT;
       
   913     return visible;
   838     }
   914     }
   839 
   915 
   840 /**
   916 /**
   841  * Sets emergency call support enabled. Must be called prior to PreLayoutDynamicInitL
   917  * Sets emergency call support enabled. Must be called prior to PreLayoutDynamicInitL
   842  */
   918  */
   843 EXPORT_C void CAknQueryDialog::SetEmergencyCallSupport( TBool aOnOff )
   919 EXPORT_C void CAknQueryDialog::SetEmergencyCallSupport( TBool aOnOff )
   844     {
   920     {
       
   921     _AKNTRACE_FUNC_ENTER;
       
   922     _AKNTRACE( "[%s][%s] aOnOff: %d", "CAknQueryDialog", __FUNCTION__, aOnOff);
   845     iFlags.Assign(CAknQueryControl::EEmergencyCallsEnabledByAPI, aOnOff );
   923     iFlags.Assign(CAknQueryControl::EEmergencyCallsEnabledByAPI, aOnOff );
       
   924     _AKNTRACE_FUNC_EXIT;
   846     }
   925     }
   847 
   926 
   848 EXPORT_C void CAknQueryDialog::SetPredictiveTextInputPermitted( TBool aPermitted )
   927 EXPORT_C void CAknQueryDialog::SetPredictiveTextInputPermitted( TBool aPermitted )
   849     {
   928     {
       
   929     _AKNTRACE_FUNC_ENTER;
       
   930     _AKNTRACE( "[%s][%s] aPermitted: %d", "CAknQueryDialog", __FUNCTION__, aPermitted);
   850     iFlags.Assign( CAknQueryControl::EPredictiveTextEntryPermitted, aPermitted );
   931     iFlags.Assign( CAknQueryControl::EPredictiveTextEntryPermitted, aPermitted );
       
   932     _AKNTRACE_FUNC_EXIT;
   851     }
   933     }
   852 
   934 
   853 EXPORT_C void CAknQueryDialog::RemoveEditorIndicator()
   935 EXPORT_C void CAknQueryDialog::RemoveEditorIndicator()
   854     {
   936     {
       
   937     _AKNTRACE_FUNC_ENTER;
   855     iFlags.Assign(CAknQueryControl::EEditorIndicatorOff,ETrue);
   938     iFlags.Assign(CAknQueryControl::EEditorIndicatorOff,ETrue);
       
   939     _AKNTRACE_FUNC_EXIT;
   856     }
   940     }
   857 
   941 
   858 EXPORT_C void CAknQueryDialog::SetHeaderTextL(const TDesC& aHeader)
   942 EXPORT_C void CAknQueryDialog::SetHeaderTextL(const TDesC& aHeader)
   859     {
   943     {
       
   944     _AKNTRACE_FUNC_ENTER;
       
   945     _AKNTRACE( "[%s][%s] aHeader: %s", "CAknQueryDialog", __FUNCTION__, &aHeader);
   860     CAknPopupHeadingPane* controlHeading = QueryHeading();
   946     CAknPopupHeadingPane* controlHeading = QueryHeading();
   861     if (controlHeading)
   947     if (controlHeading)
   862         controlHeading->SetTextL(aHeader);
   948         controlHeading->SetTextL(aHeader);
   863         
       
   864     LayoutAndDraw();
   949     LayoutAndDraw();
       
   950     _AKNTRACE_FUNC_EXIT;
   865     }
   951     }
   866 
   952 
   867 /** 
   953 /** 
   868  * Show left CBA only if editor text is valid
   954  * Show left CBA only if editor text is valid
   869  */ 
   955  */ 
   872     CAknQueryControl*       /*aQueryControl*/, 
   958     CAknQueryControl*       /*aQueryControl*/, 
   873     TQueryControlEvent      aEventType, 
   959     TQueryControlEvent      aEventType, 
   874     TQueryValidationStatus  /*aStatus*/
   960     TQueryValidationStatus  /*aStatus*/
   875     )
   961     )
   876     {
   962     {
       
   963     _AKNTRACE_FUNC_ENTER;
       
   964     _AKNTRACE( "[%s][%s] aEventType: %d", "CAknQueryDialog", __FUNCTION__, aEventType);
   877     if (aEventType == EEmergencyCallAttempted)
   965     if (aEventType == EEmergencyCallAttempted)
   878         {
   966         {
       
   967         _AKNTRACE( "[%s][%s] TryExitL(EEikBidCancel)", "CAknQueryDialog", __FUNCTION__);
   879         TryExitL(EEikBidCancel);
   968         TryExitL(EEikBidCancel);
   880         }
   969         }
   881     else
   970     else
   882         {
   971         {
   883         UpdateLeftSoftKeyL();
   972         UpdateLeftSoftKeyL();
   884         }
   973         }
       
   974     _AKNTRACE_FUNC_EXIT;
   885     return EFalse;
   975     return EFalse;
   886     }
   976     }
   887 
   977 
   888 
   978 
   889 EXPORT_C void CAknQueryDialog::SetHeaderImageL(CEikImage* aImage)
   979 EXPORT_C void CAknQueryDialog::SetHeaderImageL(CEikImage* aImage)
  1039 // number is entered to the query.
  1129 // number is entered to the query.
  1040 // ---------------------------------------------------------------------------
  1130 // ---------------------------------------------------------------------------
  1041 //
  1131 //
  1042 EXPORT_C void CAknQueryDialog::SetEmergencyCallSupportForCBA( TBool aOnOff )
  1132 EXPORT_C void CAknQueryDialog::SetEmergencyCallSupportForCBA( TBool aOnOff )
  1043     {
  1133     {
       
  1134     _AKNTRACE_FUNC_ENTER;
       
  1135     _AKNTRACE( "[%s][%s] aOnOff:%d ", "CAknQueryDialog", __FUNCTION__, aOnOff);
  1044     if ( aOnOff )
  1136     if ( aOnOff )
  1045         {
  1137         {
  1046         // Ensure also that the EEmergencyCallsEnabledByAPI is set.
  1138         // Ensure also that the EEmergencyCallsEnabledByAPI is set.
  1047         iFlags.Assign( CAknQueryControl::EEmergencyCallsEnabledByAPI, aOnOff );
  1139         iFlags.Assign( CAknQueryControl::EEmergencyCallsEnabledByAPI, aOnOff );
  1048         }
  1140         }
  1049     iFlags.Assign( CAknQueryControl::EEmergencyCallsCBASupport, aOnOff );
  1141     iFlags.Assign( CAknQueryControl::EEmergencyCallsCBASupport, aOnOff );
       
  1142     _AKNTRACE_FUNC_EXIT;
  1050     }
  1143     }
  1051 
  1144 
  1052 
  1145 
  1053 
  1146 
  1054 /************************
  1147 /************************
  1059  * Second phase construction required to align API with multiline queries 
  1152  * Second phase construction required to align API with multiline queries 
  1060  * and because in future MAknQueryData will be used.
  1153  * and because in future MAknQueryData will be used.
  1061  */
  1154  */
  1062 EXPORT_C CAknTextQueryDialog* CAknTextQueryDialog::NewL(TDes& aDataText, const TTone& aTone)
  1155 EXPORT_C CAknTextQueryDialog* CAknTextQueryDialog::NewL(TDes& aDataText, const TTone& aTone)
  1063     {
  1156     {
       
  1157     _AKNTRACE_FUNC_ENTER;
  1064     CAknTextQueryDialog* self = new (ELeave) CAknTextQueryDialog(aDataText, aTone);
  1158     CAknTextQueryDialog* self = new (ELeave) CAknTextQueryDialog(aDataText, aTone);
  1065     AKNTASHOOK_ADDL( self, "CAknTextQueryDialog" );
  1159     AKNTASHOOK_ADDL( self, "CAknTextQueryDialog" );
       
  1160     _AKNTRACE_FUNC_EXIT;
  1066     return self;
  1161     return self;
  1067     }
  1162     }
  1068 
  1163 
  1069 
  1164 
  1070 EXPORT_C CAknTextQueryDialog::CAknTextQueryDialog
  1165 EXPORT_C CAknTextQueryDialog::CAknTextQueryDialog
  1080     {
  1175     {
  1081     }
  1176     }
  1082 
  1177 
  1083 EXPORT_C CAknTextQueryDialog::~CAknTextQueryDialog()
  1178 EXPORT_C CAknTextQueryDialog::~CAknTextQueryDialog()
  1084     {
  1179     {
       
  1180 	_AKNTRACE( "[%s][%s] ", "CAknTextQueryDialog", "~CAknTextQueryDialog");
  1085     AKNTASHOOK_REMOVE();
  1181     AKNTASHOOK_REMOVE();
  1086     }
  1182     }
  1087 
  1183 
  1088 EXPORT_C TBool CAknTextQueryDialog::CheckIfEntryTextOk() const
  1184 EXPORT_C TBool CAknTextQueryDialog::CheckIfEntryTextOk() const
  1089     {
  1185     {
  1098     return EFalse;
  1194     return EFalse;
  1099     }
  1195     }
  1100 
  1196 
  1101 EXPORT_C void CAknTextQueryDialog::SetDefaultInputMode(TInt aInputMode)
  1197 EXPORT_C void CAknTextQueryDialog::SetDefaultInputMode(TInt aInputMode)
  1102     {
  1198     {
       
  1199     _AKNTRACE_FUNC_ENTER;
       
  1200     _AKNTRACE( "[%s][%s] aInputMode:%d ", "CAknTextQueryDialog", __FUNCTION__,aInputMode);
  1103     CAknQueryControl* control = QueryControl();
  1201     CAknQueryControl* control = QueryControl();
  1104     if ( control )
  1202     if ( control )
  1105         {
  1203         {
  1106         CEikSecretEditor* secretEditor = STATIC_CAST(CEikSecretEditor*, control->ControlByLayoutOrNull( ECodeLayout ));
  1204         CEikSecretEditor* secretEditor = STATIC_CAST(CEikSecretEditor*, control->ControlByLayoutOrNull( ECodeLayout ));
  1107         if (secretEditor)
  1205         if (secretEditor)
  1108             {
  1206             {
  1109             secretEditor->SetDefaultInputMode(aInputMode);
  1207             secretEditor->SetDefaultInputMode(aInputMode);
  1110             }
  1208             }
  1111         }
  1209         }
       
  1210     _AKNTRACE_FUNC_EXIT;
  1112     }
  1211     }
  1113 
  1212 
  1114 EXPORT_C void CAknTextQueryDialog::PreLayoutDynInitL()
  1213 EXPORT_C void CAknTextQueryDialog::PreLayoutDynInitL()
  1115     {
  1214     {
       
  1215     _AKNTRACE_FUNC_ENTER;
  1116     CAknQueryDialog::PreLayoutDynInitL();
  1216     CAknQueryDialog::PreLayoutDynInitL();
  1117 
  1217 
  1118     SetControlTextL();
  1218     SetControlTextL();
  1119     UpdateLeftSoftKeyL();
  1219     UpdateLeftSoftKeyL();
       
  1220     _AKNTRACE_FUNC_EXIT;
  1120     }
  1221     }
  1121 
  1222 
  1122 
  1223 
  1123 EXPORT_C void CAknTextQueryDialog::SetMaxLength(TInt aLength)
  1224 EXPORT_C void CAknTextQueryDialog::SetMaxLength(TInt aLength)
  1124     {
  1225     {
  1152  *
  1253  *
  1153  * @see IsLeftSoftkeyVisible
  1254  * @see IsLeftSoftkeyVisible
  1154  */
  1255  */
  1155 EXPORT_C TBool CAknTextQueryDialog::OkToExitL( TInt aButtonId )
  1256 EXPORT_C TBool CAknTextQueryDialog::OkToExitL( TInt aButtonId )
  1156     {
  1257     {
       
  1258     _AKNTRACE( "[%s][%s] aButtonId:%d ", "CAknTextQueryDialog", __FUNCTION__,aButtonId);
  1157     if ( aButtonId == EAknSoftkeyEmergencyCall )
  1259     if ( aButtonId == EAknSoftkeyEmergencyCall )
  1158         {
  1260         {
  1159         // ECS number entered and "call" softkey pressed,
  1261         // ECS number entered and "call" softkey pressed,
  1160         // send a key event to the query control to
  1262         // send a key event to the query control to
  1161         // initiate the call.
  1263         // initiate the call.
  1162         CAknQueryControl* control = QueryControl();
  1264         CAknQueryControl* control = QueryControl();
  1163         if ( control )
  1265         if ( control )
  1164             {
  1266             {
  1165             control->AttemptEmergencyCallL();
  1267             control->AttemptEmergencyCallL();
  1166             }
  1268             }
  1167         
  1269         _AKNTRACE( "[%s][%s] return ETrue ", "CAknTextQueryDialog", __FUNCTION__);
  1168         return ETrue;
  1270         return ETrue;
  1169         }
  1271         }
  1170     else if ( ( IsLeftSoftkeyVisible() && 
  1272     else if ( ( IsLeftSoftkeyVisible() && 
  1171               ( aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk ) ) )
  1273               ( aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk ) ) )
  1172         {
  1274         {
  1174         if ( control )
  1276         if ( control )
  1175             {
  1277             {
  1176             control->GetText( iDataText );
  1278             control->GetText( iDataText );
  1177             }
  1279             }
  1178             
  1280             
       
  1281         _AKNTRACE( "[%s][%s] GetText and return ETrue ", "CAknTextQueryDialog", __FUNCTION__);
  1179         return ETrue;
  1282         return ETrue;
  1180         }
  1283         }
  1181     else if( aButtonId == GetRightCBAShortKeyPress() )
  1284     else if( aButtonId == GetRightCBAShortKeyPress() )
  1182         {
  1285         {
       
  1286         _AKNTRACE( "[%s][%s] do nothing and return ETrue", "CAknTextQueryDialog", __FUNCTION__);
  1183         return ETrue;
  1287         return ETrue;
  1184         }
  1288         }
  1185  
  1289  
       
  1290     _AKNTRACE( "[%s][%s] return EFalse ", "CAknTextQueryDialog", __FUNCTION__);
  1186     return EFalse;
  1291     return EFalse;
  1187     }
  1292     }
  1188 
  1293 
  1189 void CAknTextQueryDialog::SetControlTextL()
  1294 void CAknTextQueryDialog::SetControlTextL()
  1190     {
  1295     {
  1230  * Second phase construction required to align API with multiline queries 
  1335  * Second phase construction required to align API with multiline queries 
  1231  * and because in future MAknQueryData will be used.
  1336  * and because in future MAknQueryData will be used.
  1232  */
  1337  */
  1233 EXPORT_C CAknNumberQueryDialog* CAknNumberQueryDialog::NewL(TInt& aNumber, const TTone& aTone)
  1338 EXPORT_C CAknNumberQueryDialog* CAknNumberQueryDialog::NewL(TInt& aNumber, const TTone& aTone)
  1234     {
  1339     {
       
  1340     _AKNTRACE_FUNC_ENTER;
  1235     CAknNumberQueryDialog* self = new (ELeave) CAknNumberQueryDialog(aNumber, aTone);
  1341     CAknNumberQueryDialog* self = new (ELeave) CAknNumberQueryDialog(aNumber, aTone);
  1236     AKNTASHOOK_ADDL( self, "CAknNumberQueryDialog" );
  1342     AKNTASHOOK_ADDL( self, "CAknNumberQueryDialog" );
       
  1343     _AKNTRACE_FUNC_EXIT;
  1237     return self;
  1344     return self;
  1238     }
  1345     }
  1239 
  1346 
  1240 
  1347 
  1241 EXPORT_C CAknNumberQueryDialog::CAknNumberQueryDialog
  1348 EXPORT_C CAknNumberQueryDialog::CAknNumberQueryDialog
  1248     AKNTASHOOK_REMOVE();
  1355     AKNTASHOOK_REMOVE();
  1249     }
  1356     }
  1250 
  1357 
  1251 EXPORT_C void CAknNumberQueryDialog::PreLayoutDynInitL()
  1358 EXPORT_C void CAknNumberQueryDialog::PreLayoutDynInitL()
  1252     {
  1359     {
       
  1360     _AKNTRACE_FUNC_ENTER;
  1253     CAknQueryDialog::PreLayoutDynInitL();
  1361     CAknQueryDialog::PreLayoutDynInitL();
  1254 
  1362 
  1255     CAknQueryControl* control = QueryControl();
  1363     CAknQueryControl* control = QueryControl();
  1256     if (control)
  1364     if (control)
  1257         control->SetNumberL(iNumber);
  1365         control->SetNumberL(iNumber);
       
  1366     _AKNTRACE_FUNC_EXIT;
  1258     }
  1367     }
  1259 
  1368 
  1260 EXPORT_C void CAknNumberQueryDialog::SetMinimumAndMaximum( TInt aMinimumValue,
  1369 EXPORT_C void CAknNumberQueryDialog::SetMinimumAndMaximum( TInt aMinimumValue,
  1261                                                            TInt aMaximumValue)
  1370                                                            TInt aMaximumValue)
  1262 {
  1371 {
  1267         }
  1376         }
  1268 }
  1377 }
  1269 
  1378 
  1270 EXPORT_C TBool CAknNumberQueryDialog::OkToExitL( TInt aButtonId )
  1379 EXPORT_C TBool CAknNumberQueryDialog::OkToExitL( TInt aButtonId )
  1271     {
  1380     {
       
  1381     _AKNTRACE( "[%s][%s] aButtonId:%d ", "CAknNumberQueryDialog", __FUNCTION__,aButtonId);
  1272     if ( aButtonId == EAknSoftkeyEmergencyCall )
  1382     if ( aButtonId == EAknSoftkeyEmergencyCall )
  1273         {
  1383         {
  1274         // ECS number entered and "call" softkey pressed,
  1384         // ECS number entered and "call" softkey pressed,
  1275         // send a key event to the query control to
  1385         // send a key event to the query control to
  1276         // initiate the call.
  1386         // initiate the call.
  1277         CAknQueryControl* control = QueryControl();
  1387         CAknQueryControl* control = QueryControl();
  1278         if ( control )
  1388         if ( control )
  1279             {
  1389             {
  1280             control->AttemptEmergencyCallL();
  1390             control->AttemptEmergencyCallL();
  1281             }
  1391             }
  1282         
  1392         _AKNTRACE( "[%s][%s] attempt emergency and return ETrue ", "CAknNumberQueryDialog", __FUNCTION__);
  1283         return ETrue;
  1393         return ETrue;
  1284         }
  1394         }
  1285     else if ( aButtonId == GetRightCBAShortKeyPress() )
  1395     else if ( aButtonId == GetRightCBAShortKeyPress() )
  1286         {
  1396         {
       
  1397         _AKNTRACE( "[%s][%s] do nothing and reutrn ETrue ", "CAknNumberQueryDialog", __FUNCTION__);
  1287         return ETrue;
  1398         return ETrue;
  1288         }
  1399         }
  1289     else if ( ( IsLeftSoftkeyVisible() && 
  1400     else if ( ( IsLeftSoftkeyVisible() && 
  1290               ( aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk ) ) )
  1401               ( aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk ) ) )
  1291         {
  1402         {
  1294         if ( control && control->CheckNumber() )
  1405         if ( control && control->CheckNumber() )
  1295             {
  1406             {
  1296             TRAP( e, control->PrepareForFocusLossL() );
  1407             TRAP( e, control->PrepareForFocusLossL() );
  1297             if ( e != KErrNone )
  1408             if ( e != KErrNone )
  1298                 {
  1409                 {
       
  1410                 _AKNTRACE( "[%s][%s] reutrn EFalse ", "CAknNumberQueryDialog", __FUNCTION__);
  1299                 return EFalse;
  1411                 return EFalse;
  1300                 }
  1412                 }
  1301             iNumber = control->GetNumber();
  1413             iNumber = control->GetNumber();
       
  1414             _AKNTRACE( "[%s][%s] get number and return ETrue ", "CAknNumberQueryDialog", __FUNCTION__);
  1302             return ETrue;
  1415             return ETrue;
  1303             }
  1416             }
  1304        }
  1417        }
  1305 
  1418     _AKNTRACE( "[%s][%s] return EFalse", "CAknNumberQueryDialog", __FUNCTION__);
  1306     return EFalse;
  1419     return EFalse;
  1307     }
  1420     }
  1308 
  1421 
  1309 EXPORT_C void CAknNumberQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1422 EXPORT_C void CAknNumberQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1310     { 
  1423     { 
  1341  * Second phase construction required to align API with multiline queries 
  1454  * Second phase construction required to align API with multiline queries 
  1342  * and because in future MAknQueryData will be used.
  1455  * and because in future MAknQueryData will be used.
  1343  */
  1456  */
  1344 EXPORT_C CAknTimeQueryDialog* CAknTimeQueryDialog::NewL(TTime& aTime, const TTone& aTone)
  1457 EXPORT_C CAknTimeQueryDialog* CAknTimeQueryDialog::NewL(TTime& aTime, const TTone& aTone)
  1345     {
  1458     {
       
  1459     _AKNTRACE_FUNC_ENTER;
  1346     CAknTimeQueryDialog* self = new (ELeave) CAknTimeQueryDialog(aTime, aTone);
  1460     CAknTimeQueryDialog* self = new (ELeave) CAknTimeQueryDialog(aTime, aTone);
  1347     AKNTASHOOK_ADDL( self, "CAknTimeQueryDialog" );
  1461     AKNTASHOOK_ADDL( self, "CAknTimeQueryDialog" );
       
  1462     _AKNTRACE_FUNC_EXIT;
  1348     return self;
  1463     return self;
  1349     }
  1464     }
  1350 
  1465 
  1351 EXPORT_C CAknTimeQueryDialog::CAknTimeQueryDialog
  1466 EXPORT_C CAknTimeQueryDialog::CAknTimeQueryDialog
  1352     (TTime& aTime, const TTone& aTone) : CAknQueryDialog(aTone), iTime(aTime)
  1467     (TTime& aTime, const TTone& aTone) : CAknQueryDialog(aTone), iTime(aTime)
  1366     AKNTASHOOK_REMOVE();
  1481     AKNTASHOOK_REMOVE();
  1367     }
  1482     }
  1368 
  1483 
  1369 EXPORT_C void CAknTimeQueryDialog::PreLayoutDynInitL()
  1484 EXPORT_C void CAknTimeQueryDialog::PreLayoutDynInitL()
  1370     {
  1485     {
       
  1486     _AKNTRACE_FUNC_ENTER;
  1371     CAknQueryDialog::PreLayoutDynInitL();
  1487     CAknQueryDialog::PreLayoutDynInitL();
  1372     CAknQueryControl* control = QueryControl();
  1488     CAknQueryControl* control = QueryControl();
  1373     if (control)
  1489     if (control)
  1374         control->SetTime(iTime);
  1490         control->SetTime(iTime);
       
  1491     _AKNTRACE_FUNC_EXIT;
  1375     }
  1492     }
  1376 
  1493 
  1377 EXPORT_C void CAknTimeQueryDialog::SetMinimumAndMaximum( const TTime& aMinimum, 
  1494 EXPORT_C void CAknTimeQueryDialog::SetMinimumAndMaximum( const TTime& aMinimum, 
  1378                                                          const TTime& aMaximum)
  1495                                                          const TTime& aMaximum)
  1379 {
  1496 {
  1384         }
  1501         }
  1385 }
  1502 }
  1386 
  1503 
  1387 EXPORT_C TBool CAknTimeQueryDialog::OkToExitL(TInt aButtonId)
  1504 EXPORT_C TBool CAknTimeQueryDialog::OkToExitL(TInt aButtonId)
  1388     {
  1505     {
       
  1506     _AKNTRACE( "[%s][%s] aButtonId:%d ", "CAknTimeQueryDialog", __FUNCTION__,aButtonId);
  1389     if((IsLeftSoftkeyVisible() && 
  1507     if((IsLeftSoftkeyVisible() && 
  1390         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1508         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1391         {   
  1509         {   
  1392         CAknQueryControl* control = QueryControl();
  1510         CAknQueryControl* control = QueryControl();
  1393         if ( control )
  1511         if ( control )
  1394             {
  1512             {
  1395             iTime = control->GetTime();
  1513             iTime = control->GetTime();
  1396             }
  1514             }
       
  1515         _AKNTRACE( "[%s][%s] get time and return ETrue ", "CAknTimeQueryDialog", __FUNCTION__);
  1397         return ETrue;
  1516         return ETrue;
  1398         }
  1517         }
  1399     else if(aButtonId == GetRightCBAShortKeyPress())
  1518     else if(aButtonId == GetRightCBAShortKeyPress())
  1400         return ETrue;
  1519     	{
  1401 
  1520     	_AKNTRACE( "[%s][%s] do nothing, return ETrue ", "CAknTimeQueryDialog", __FUNCTION__);
       
  1521     	return ETrue;
       
  1522     	}
       
  1523     _AKNTRACE( "[%s][%s] do nothing and return EFalse ", "CAknTimeQueryDialog", __FUNCTION__);
  1402     return EFalse;
  1524     return EFalse;
  1403     }
  1525     }
  1404 
  1526 
  1405 EXPORT_C void CAknTimeQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1527 EXPORT_C void CAknTimeQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1406     { 
  1528     { 
  1436  * Second phase construction required to align API with multiline queries 
  1558  * Second phase construction required to align API with multiline queries 
  1437  * and because in future MAknQueryData will be used.
  1559  * and because in future MAknQueryData will be used.
  1438  */
  1560  */
  1439 EXPORT_C CAknDurationQueryDialog* CAknDurationQueryDialog::NewL(TTimeIntervalSeconds& aDuration, const TTone& aTone)
  1561 EXPORT_C CAknDurationQueryDialog* CAknDurationQueryDialog::NewL(TTimeIntervalSeconds& aDuration, const TTone& aTone)
  1440     {
  1562     {
       
  1563     _AKNTRACE_FUNC_ENTER;
  1441     CAknDurationQueryDialog* self = new (ELeave) CAknDurationQueryDialog(aDuration, aTone);
  1564     CAknDurationQueryDialog* self = new (ELeave) CAknDurationQueryDialog(aDuration, aTone);
  1442     AKNTASHOOK_ADDL( self, "CAknDurationQueryDialog" );
  1565     AKNTASHOOK_ADDL( self, "CAknDurationQueryDialog" );
       
  1566     _AKNTRACE_FUNC_EXIT;
  1443     return self;
  1567     return self;
  1444     }
  1568     }
  1445 
  1569 
  1446 EXPORT_C CAknDurationQueryDialog::CAknDurationQueryDialog
  1570 EXPORT_C CAknDurationQueryDialog::CAknDurationQueryDialog
  1447     (TTimeIntervalSeconds& aDuration, const TTone& aTone) : CAknQueryDialog(aTone), iDuration(aDuration)
  1571     (TTimeIntervalSeconds& aDuration, const TTone& aTone) : CAknQueryDialog(aTone), iDuration(aDuration)
  1453     AKNTASHOOK_REMOVE();
  1577     AKNTASHOOK_REMOVE();
  1454     }
  1578     }
  1455 
  1579 
  1456 EXPORT_C void CAknDurationQueryDialog::PreLayoutDynInitL()
  1580 EXPORT_C void CAknDurationQueryDialog::PreLayoutDynInitL()
  1457     {
  1581     {
       
  1582     _AKNTRACE_FUNC_ENTER;
  1458     CAknQueryDialog::PreLayoutDynInitL();
  1583     CAknQueryDialog::PreLayoutDynInitL();
  1459     CAknQueryControl* control = QueryControl();
  1584     CAknQueryControl* control = QueryControl();
  1460     
  1585     
  1461     if (control)
  1586     if (control)
  1462         control->SetDuration(iDuration);
  1587         control->SetDuration(iDuration);
       
  1588     _AKNTRACE_FUNC_EXIT;
  1463     }
  1589     }
  1464 
  1590 
  1465 EXPORT_C void CAknDurationQueryDialog::SetMinimumAndMaximum( const TTimeIntervalSeconds& aMinimumDuration, 
  1591 EXPORT_C void CAknDurationQueryDialog::SetMinimumAndMaximum( const TTimeIntervalSeconds& aMinimumDuration, 
  1466                                                              const TTimeIntervalSeconds& aMaximumDuration)
  1592                                                              const TTimeIntervalSeconds& aMaximumDuration)
  1467 {
  1593 {
  1472         }
  1598         }
  1473 }
  1599 }
  1474 
  1600 
  1475 EXPORT_C TBool CAknDurationQueryDialog::OkToExitL(TInt aButtonId)
  1601 EXPORT_C TBool CAknDurationQueryDialog::OkToExitL(TInt aButtonId)
  1476     {
  1602     {
       
  1603 	_AKNTRACE( "[%s][%s] aButtonId:%d ", "CAknDurationQueryDialog", __FUNCTION__,aButtonId);
  1477     if((IsLeftSoftkeyVisible() && 
  1604     if((IsLeftSoftkeyVisible() && 
  1478         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1605         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1479         {   
  1606         {   
  1480         CAknQueryControl* control = QueryControl();
  1607         CAknQueryControl* control = QueryControl();
  1481         if ( control )
  1608         if ( control )
  1482             {
  1609             {
  1483             iDuration = control->GetDuration();
  1610             iDuration = control->GetDuration();
  1484             }
  1611             }
       
  1612         _AKNTRACE( "[%s][%s] get duration and return ETrue ", "CAknDurationQueryDialog", __FUNCTION__);
  1485         return ETrue;
  1613         return ETrue;
  1486         }
  1614         }
  1487     else if(aButtonId == GetRightCBAShortKeyPress())
  1615     else if(aButtonId == GetRightCBAShortKeyPress())
  1488         {
  1616         {
       
  1617         _AKNTRACE( "[%s][%s] do nothing, return ETrue ", "CAknDurationQueryDialog", __FUNCTION__);
  1489         return ETrue;
  1618         return ETrue;
  1490         }
  1619         }
       
  1620     _AKNTRACE( "[%s][%s] return ETrue ", "CAknDurationQueryDialog", __FUNCTION__);
  1491     return EFalse;
  1621     return EFalse;
  1492     }
  1622     }
  1493     
  1623     
  1494 EXPORT_C void CAknDurationQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1624 EXPORT_C void CAknDurationQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1495     { 
  1625     { 
  1542     AKNTASHOOK_REMOVE();
  1672     AKNTASHOOK_REMOVE();
  1543     }
  1673     }
  1544 
  1674 
  1545 EXPORT_C void CAknFloatingPointQueryDialog::PreLayoutDynInitL()
  1675 EXPORT_C void CAknFloatingPointQueryDialog::PreLayoutDynInitL()
  1546     {
  1676     {
       
  1677     _AKNTRACE_FUNC_ENTER;
  1547     CAknQueryDialog::PreLayoutDynInitL();
  1678     CAknQueryDialog::PreLayoutDynInitL();
  1548     CAknQueryControl* control = QueryControl();
  1679     CAknQueryControl* control = QueryControl();
  1549   
  1680   
  1550     if ( control )
  1681     if ( control )
  1551         {
  1682         {
  1552         control->SetQueryControlObserver(this);
  1683         control->SetQueryControlObserver(this);
  1553         control->SetFloatingPointNumberL(&iNumber);
  1684         control->SetFloatingPointNumberL(&iNumber);
  1554         DoSetPromptL();
  1685         DoSetPromptL();
  1555         }
  1686         }
       
  1687     _AKNTRACE_FUNC_EXIT;
  1556     }
  1688     }
  1557 
  1689 
  1558 EXPORT_C void CAknFloatingPointQueryDialog::SetMinimumAndMaximum( const TReal& aMinimumNumber, 
  1690 EXPORT_C void CAknFloatingPointQueryDialog::SetMinimumAndMaximum( const TReal& aMinimumNumber, 
  1559                                                              const TReal& aMaximumNumber)
  1691                                                              const TReal& aMaximumNumber)
  1560 {
  1692 {
  1565         }
  1697         }
  1566 }
  1698 }
  1567 
  1699 
  1568 EXPORT_C TBool CAknFloatingPointQueryDialog::OkToExitL(TInt aButtonId)
  1700 EXPORT_C TBool CAknFloatingPointQueryDialog::OkToExitL(TInt aButtonId)
  1569     {
  1701     {
       
  1702     _AKNTRACE( "[%s][%s] aButtonId :%d ", "CAknFloatingPointQueryDialog", __FUNCTION__,aButtonId);
  1570     if((IsLeftSoftkeyVisible() && 
  1703     if((IsLeftSoftkeyVisible() && 
  1571         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1704         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1572         {   
  1705         {   
  1573         CAknQueryControl* control = QueryControl();
  1706         CAknQueryControl* control = QueryControl();
  1574         if ( control )
  1707         if ( control )
  1575             {
  1708             {
  1576             iNumber = control->GetFloatingPointNumberL();
  1709             iNumber = control->GetFloatingPointNumberL();
  1577             }
  1710             }
       
  1711         _AKNTRACE( "[%s][%s] Get Floatingpoint number and return ETrue ", "CAknFloatingPointQueryDialog", __FUNCTION__);
  1578         return ETrue;
  1712         return ETrue;
  1579         }
  1713         }
  1580     else if(aButtonId == GetRightCBAShortKeyPress())
  1714     else if(aButtonId == GetRightCBAShortKeyPress())
  1581         {
  1715         {
       
  1716         _AKNTRACE( "[%s][%s] do nothing, return ETrue ", "CAknFloatingPointQueryDialog", __FUNCTION__);
  1582         return ETrue;
  1717         return ETrue;
  1583         }
  1718         }
       
  1719     _AKNTRACE( "[%s][%s] return ETrue ", "CAknFloatingPointQueryDialog", __FUNCTION__);
  1584     return EFalse;
  1720     return EFalse;
  1585     }
  1721     }
  1586     
  1722     
  1587 EXPORT_C void CAknFloatingPointQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1723 EXPORT_C void CAknFloatingPointQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  1588     { 
  1724     { 
  1776 EXPORT_C void CAknMultiLineDataQueryDialog::SetPromptL(const TDesC& aFP, const TDesC& aSP)
  1912 EXPORT_C void CAknMultiLineDataQueryDialog::SetPromptL(const TDesC& aFP, const TDesC& aSP)
  1777 //
  1913 //
  1778 //Store new prompt values
  1914 //Store new prompt values
  1779 //
  1915 //
  1780     {
  1916     {
       
  1917     _AKNTRACE_FUNC_ENTER;
  1781     delete iSecondPrompt;
  1918     delete iSecondPrompt;
  1782     iSecondPrompt = NULL;
  1919     iSecondPrompt = NULL;
  1783     iSecondPrompt = aSP.AllocL();
  1920     iSecondPrompt = aSP.AllocL();
  1784 
  1921 
  1785     CAknQueryDialog::SetPromptL(aFP);
  1922     CAknQueryDialog::SetPromptL(aFP);
       
  1923     _AKNTRACE_FUNC_EXIT;
  1786     }
  1924     }
  1787 
  1925 
  1788 EXPORT_C void CAknMultiLineDataQueryDialog::DoSetPromptL()
  1926 EXPORT_C void CAknMultiLineDataQueryDialog::DoSetPromptL()
  1789     {
  1927     {
       
  1928     _AKNTRACE_FUNC_ENTER;
  1790 //
  1929 //
  1791 //Set prompt in query controls, called during layout
  1930 //Set prompt in query controls, called during layout
  1792 //
  1931 //
  1793     CAknMultilineQueryControl* secondControl = SecondControl();
  1932     CAknMultilineQueryControl* secondControl = SecondControl();
  1794     if(secondControl && iSecondPrompt && iSecondPrompt->Length())
  1933     if(secondControl && iSecondPrompt && iSecondPrompt->Length())
  1795         secondControl->SetPromptL(*iSecondPrompt);
  1934         secondControl->SetPromptL(*iSecondPrompt);
  1796     
  1935     
  1797     CAknQueryDialog::DoSetPromptL();        
  1936     CAknQueryDialog::DoSetPromptL();        
       
  1937     _AKNTRACE_FUNC_EXIT;
  1798     }
  1938     }
  1799 
  1939 
  1800 /**
  1940 /**
  1801 * Allows dismissing of queries. Same as base class implementation only take into
  1941 * Allows dismissing of queries. Same as base class implementation only take into
  1802 * consideration both controls
  1942 * consideration both controls
  1853         HandleOrientationSwitch();
  1993         HandleOrientationSwitch();
  1854 
  1994 
  1855         UpdateLeftSoftKeyL();
  1995         UpdateLeftSoftKeyL();
  1856 		return ETrue;
  1996 		return ETrue;
  1857 		}
  1997 		}
  1858 
       
  1859 
       
  1860     return EFalse;
  1998     return EFalse;
  1861     }
  1999     }
  1862 
  2000 
  1863 
  2001 
  1864 TBool CAknMultiLineDataQueryDialog::FirstLineEnabled() const
  2002 TBool CAknMultiLineDataQueryDialog::FirstLineEnabled() const
  1882    return -1;
  2020    return -1;
  1883 }
  2021 }
  1884 
  2022 
  1885 void CAknMultiLineDataQueryDialog::HandleOrientationSwitch()
  2023 void CAknMultiLineDataQueryDialog::HandleOrientationSwitch()
  1886 {
  2024 {
       
  2025 	_AKNTRACE_FUNC_ENTER;
  1887 	TBool firstLineEnabled = FirstLineEnabled();
  2026 	TBool firstLineEnabled = FirstLineEnabled();
  1888 	TBool secondLineEnabled = SecondLineEnabled();
  2027 	TBool secondLineEnabled = SecondLineEnabled();
  1889 
  2028 
  1890     if (!firstLineEnabled && !secondLineEnabled)
  2029     if (!firstLineEnabled && !secondLineEnabled)
  1891     {
  2030     {
  1911 	ctrl1->SetLatentGroupLineFollows(!firstLineEnabled);
  2050 	ctrl1->SetLatentGroupLineFollows(!firstLineEnabled);
  1912 	ctrl2->SetLatentGroupLineFollows(!secondLineEnabled);
  2051 	ctrl2->SetLatentGroupLineFollows(!secondLineEnabled);
  1913 	ctrl1->SetFocusing(firstLineEnabled);
  2052 	ctrl1->SetFocusing(firstLineEnabled);
  1914 	ctrl2->SetFocusing(secondLineEnabled);
  2053 	ctrl2->SetFocusing(secondLineEnabled);
  1915 	Layout();
  2054 	Layout();
       
  2055 	_AKNTRACE_FUNC_EXIT;
  1916 }
  2056 }
  1917 
  2057 
  1918 EXPORT_C void CAknMultiLineDataQueryDialog::HandleResourceChange(TInt aType)
  2058 EXPORT_C void CAknMultiLineDataQueryDialog::HandleResourceChange(TInt aType)
  1919 {
  2059 {
       
  2060 	_AKNTRACE_FUNC_ENTER;
  1920 	CAknQueryDialog::HandleResourceChange(aType);
  2061 	CAknQueryDialog::HandleResourceChange(aType);
  1921 	if (aType == KEikDynamicLayoutVariantSwitch)
  2062 	if (aType == KEikDynamicLayoutVariantSwitch)
  1922 		{
  2063 		{
  1923         if (Layout_Meta_Data::IsLandscapeOrientation())
  2064         if (Layout_Meta_Data::IsLandscapeOrientation())
  1924             {
  2065             {
  1929             SetBorder(AknBorderId::EAknBorderNotePopup);
  2070             SetBorder(AknBorderId::EAknBorderNotePopup);
  1930             }
  2071             }
  1931 		HandleOrientationSwitch();
  2072 		HandleOrientationSwitch();
  1932 		TRAP_IGNORE( UpdateLeftSoftKeyL() );
  2073 		TRAP_IGNORE( UpdateLeftSoftKeyL() );
  1933 		}
  2074 		}
       
  2075 	_AKNTRACE_FUNC_EXIT;
  1934 }
  2076 }
  1935 
  2077 
  1936 EXPORT_C TBool CAknMultiLineDataQueryDialog::OkToExitL(TInt aButtonId)
  2078 EXPORT_C TBool CAknMultiLineDataQueryDialog::OkToExitL(TInt aButtonId)
  1937     {
  2079     {
       
  2080     _AKNTRACE( "[%s][%s] aButtonId :%d ", "CAknMultiLineDataQueryDialog", __FUNCTION__, aButtonId);
  1938     if (Layout_Meta_Data::IsLandscapeOrientation())
  2081     if (Layout_Meta_Data::IsLandscapeOrientation())
  1939     	{
  2082     	{
  1940     if((IsLeftSoftkeyVisible() && 
  2083     if((IsLeftSoftkeyVisible() && 
  1941         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  2084         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1942         {
  2085         {
  1958 				CEikCaptionedControl *ctrl2 = GetLineByLineAndPageIndex(line2, 0);
  2101 				CEikCaptionedControl *ctrl2 = GetLineByLineAndPageIndex(line2, 0);
  1959 				TryChangeFocusToL(ctrl2->iId);
  2102 				TryChangeFocusToL(ctrl2->iId);
  1960                 HandleOrientationSwitch();
  2103                 HandleOrientationSwitch();
  1961 
  2104 
  1962                 UpdateLeftSoftKeyL();
  2105                 UpdateLeftSoftKeyL();
  1963 
  2106                 _AKNTRACE( "[%s][%s] return EFalse", "CAknMultiLineDataQueryDialog", __FUNCTION__);
  1964         		return EFalse;      		        		        		
  2107                 return EFalse;      		        		        		
  1965         		}
  2108         		}
  1966         	}
  2109         	}
  1967     	}
  2110     	}
  1968     if((IsLeftSoftkeyVisible() && 
  2111     if((IsLeftSoftkeyVisible() && 
  1969         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  2112         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  1999                 secondControl->GetText( ptext );
  2142                 secondControl->GetText( ptext );
  2000                 iSecondText->Copy( *text );                        
  2143                 iSecondText->Copy( *text );                        
  2001                 CleanupStack::PopAndDestroy( text );   	
  2144                 CleanupStack::PopAndDestroy( text );   	
  2002                 }
  2145                 }
  2003             }
  2146             }
  2004 
  2147         _AKNTRACE( "[%s][%s] return ETrue ", "CAknMultiLineDataQueryDialog", __FUNCTION__);
  2005         return ETrue;
  2148         return ETrue;
  2006         }
  2149         }
  2007     else if(aButtonId == GetRightCBAShortKeyPress())
  2150     else if(aButtonId == GetRightCBAShortKeyPress())
  2008         {
  2151         {
       
  2152         _AKNTRACE( "[%s][%s] do nothing,return ETrue  ", "CAknMultiLineDataQueryDialog", __FUNCTION__);
  2009         return ETrue;
  2153         return ETrue;
  2010         }
  2154         }
  2011     
  2155     _AKNTRACE( "[%s][%s] do nothing,return EFalse ", "CAknMultiLineDataQueryDialog", __FUNCTION__);
  2012     return EFalse;
  2156     return EFalse;
  2013     }
  2157     }
  2014 
  2158 
  2015 EXPORT_C void CAknMultiLineDataQueryDialog::UpdateLeftSoftKeyL()
  2159 EXPORT_C void CAknMultiLineDataQueryDialog::UpdateLeftSoftKeyL()
  2016     {
  2160     {
  2017     
       
  2018     if (Layout_Meta_Data::IsLandscapeOrientation())
  2161     if (Layout_Meta_Data::IsLandscapeOrientation())
  2019     	{
  2162     	{
  2020 	    if ( (FirstControl()->EditorContentIsValidL() && FirstControl()->IsFocused()) || (SecondControl()->EditorContentIsValidL() && FirstControl()->EditorContentIsValidL()) )
  2163 	    if ( (FirstControl()->EditorContentIsValidL() && FirstControl()->IsFocused()) || (SecondControl()->EditorContentIsValidL() && FirstControl()->EditorContentIsValidL()) )
  2021 	        {
  2164 	        {
  2022 	        MakeLeftSoftkeyVisible(ETrue);
  2165 	        MakeLeftSoftkeyVisible(ETrue);
  2068                                                                     TDesC* aPrompt,
  2211                                                                     TDesC* aPrompt,
  2069                                                                     TDesC* aPrompt2,
  2212                                                                     TDesC* aPrompt2,
  2070                                                                     const TTone& aTone)
  2213                                                                     const TTone& aTone)
  2071                                                                     : CAknQueryDialog(aTone)
  2214                                                                     : CAknQueryDialog(aTone)
  2072     {
  2215     {
       
  2216     _AKNTRACE_FUNC_ENTER;
  2073     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2217     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2074     TRAP(ignore,SetDataL(*aTime,*aTime2));
  2218     TRAP(ignore,SetDataL(*aTime,*aTime2));
  2075     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2219     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
       
  2220     _AKNTRACE_FUNC_EXIT;
  2076     }
  2221     }
  2077 
  2222 
  2078 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText,
  2223 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText,
  2079                                                                     TDes* aDataText2,
  2224                                                                     TDes* aDataText2,
  2080                                                                     TDesC* aPrompt,
  2225                                                                     TDesC* aPrompt,
  2081                                                                     TDesC* aPrompt2,
  2226                                                                     TDesC* aPrompt2,
  2082                                                                     const TTone& aTone)
  2227                                                                     const TTone& aTone)
  2083                                                                     : CAknQueryDialog(aTone)
  2228                                                                     : CAknQueryDialog(aTone)
  2084     {
  2229     {
       
  2230     _AKNTRACE_FUNC_ENTER;
  2085     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2231     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2086     TRAP(ignore,SetDataL(*aDataText,*aDataText2));
  2232     TRAP(ignore,SetDataL(*aDataText,*aDataText2));
  2087 
  2233 
  2088     iText = aDataText;
  2234     iText = aDataText;
  2089     iSecondText = aDataText2;
  2235     iSecondText = aDataText2;
  2090     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2236     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
       
  2237     _AKNTRACE_FUNC_EXIT;
  2091     }
  2238     }
  2092 
  2239 
  2093 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText, 
  2240 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText, 
  2094                                                                     TTime* aTime,
  2241                                                                     TTime* aTime,
  2095                                                                     TDesC* aPrompt,
  2242                                                                     TDesC* aPrompt,
  2096                                                                     TDesC* aPrompt2,
  2243                                                                     TDesC* aPrompt2,
  2097                                                                     const TTone& aTone)
  2244                                                                     const TTone& aTone)
  2098                                                                     : CAknQueryDialog(aTone)
  2245                                                                     : CAknQueryDialog(aTone)
  2099     {
  2246     {
       
  2247     _AKNTRACE_FUNC_ENTER;
  2100     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2248     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2101     TRAP(ignore,SetDataL(*aDataText,*aTime));
  2249     TRAP(ignore,SetDataL(*aDataText,*aTime));
  2102 
  2250 
  2103     iText = aDataText;
  2251     iText = aDataText;
  2104     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2252     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
       
  2253     _AKNTRACE_FUNC_EXIT;
  2105     }
  2254     }
  2106 
  2255 
  2107 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText, 
  2256 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText, 
  2108                                                                     TInt* aNumber,
  2257                                                                     TInt* aNumber,
  2109                                                                     TDesC* aPrompt,
  2258                                                                     TDesC* aPrompt,
  2110                                                                     TDesC* aPrompt2,
  2259                                                                     TDesC* aPrompt2,
  2111                                                                     const TTone& aTone)
  2260                                                                     const TTone& aTone)
  2112                                                                     : CAknQueryDialog(aTone)
  2261                                                                     : CAknQueryDialog(aTone)
  2113     {
  2262     {
       
  2263     _AKNTRACE_FUNC_ENTER;
  2114     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2264     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2115     TRAP(ignore,SetDataL(*aDataText,*aNumber));
  2265     TRAP(ignore,SetDataL(*aDataText,*aNumber));
  2116 
  2266 
  2117     iText = aDataText;
  2267     iText = aDataText;
  2118     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2268     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
       
  2269     _AKNTRACE_FUNC_EXIT;
  2119     }
  2270     }
  2120 
  2271 
  2121 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TInt* aNumber, 
  2272 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TInt* aNumber, 
  2122                                                                     TInt* aNumber2,
  2273                                                                     TInt* aNumber2,
  2123                                                                     TDesC* aPrompt,
  2274                                                                     TDesC* aPrompt,
  2124                                                                     TDesC* aPrompt2,
  2275                                                                     TDesC* aPrompt2,
  2125                                                                     const TTone& aTone)
  2276                                                                     const TTone& aTone)
  2126                                                                     : CAknQueryDialog(aTone)
  2277                                                                     : CAknQueryDialog(aTone)
  2127     {
  2278     {
       
  2279     _AKNTRACE_FUNC_ENTER;
  2128     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2280     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2129     TRAP(ignore,SetDataL(*aNumber,*aNumber2));
  2281     TRAP(ignore,SetDataL(*aNumber,*aNumber2));
  2130     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2282     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
       
  2283     _AKNTRACE_FUNC_EXIT;
  2131     }
  2284     }
  2132 
  2285 
  2133 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText, 
  2286 EXPORT_C CAknMultiLineDataQueryDialog::CAknMultiLineDataQueryDialog( TDes* aDataText, 
  2134                                                                     TTimeIntervalSeconds* aDuration,
  2287                                                                     TTimeIntervalSeconds* aDuration,
  2135                                                                     TDesC* aPrompt,
  2288                                                                     TDesC* aPrompt,
  2136                                                                     TDesC* aPrompt2,
  2289                                                                     TDesC* aPrompt2,
  2137                                                                     const TTone& aTone)
  2290                                                                     const TTone& aTone)
  2138                                                                     : CAknQueryDialog(aTone)
  2291                                                                     : CAknQueryDialog(aTone)
  2139     {
  2292     {
       
  2293     _AKNTRACE_FUNC_ENTER;
  2140     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2294     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2141     TRAP(ignore,SetDataL(*aDataText,*aDuration));
  2295     TRAP(ignore,SetDataL(*aDataText,*aDuration));
  2142     
  2296     
  2143     iText = aDataText;
  2297     iText = aDataText;
  2144     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2298     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2149                                                                     TDesC* aPrompt,
  2303                                                                     TDesC* aPrompt,
  2150                                                                     TDesC* aPrompt2,
  2304                                                                     TDesC* aPrompt2,
  2151                                                                     const TTone& aTone)
  2305                                                                     const TTone& aTone)
  2152                                                                     : CAknQueryDialog(aTone)
  2306                                                                     : CAknQueryDialog(aTone)
  2153     {
  2307     {
       
  2308     _AKNTRACE_FUNC_ENTER;
  2154     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2309     TRAPD(ignore, SetPromptL(DesOrNull(aPrompt), DesOrNull(aPrompt2)));
  2155     TRAP(ignore,SetDataL(*aTime,*aDuration));
  2310     TRAP(ignore,SetDataL(*aTime,*aDuration));
  2156     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
  2311     AKNTASHOOK_ADD( this, "CAknMultiLineDataQueryDialog" );
       
  2312     _AKNTRACE_FUNC_EXIT;
  2157     }
  2313     }
  2158     
  2314     
  2159 EXPORT_C void CAknMultiLineDataQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  2315 EXPORT_C void CAknMultiLineDataQueryDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
  2160     { 
  2316     { 
  2161     CAknQueryDialog::HandlePointerEventL(aPointerEvent); 
  2317     CAknQueryDialog::HandlePointerEventL(aPointerEvent); 
  2192  * Second phase construction required to align API with multiline queries 
  2348  * Second phase construction required to align API with multiline queries 
  2193  * and because in future MAknQueryData will be used.
  2349  * and because in future MAknQueryData will be used.
  2194  */
  2350  */
  2195 EXPORT_C CAknIpAddressQueryDialog* CAknIpAddressQueryDialog::NewL(TInetAddr& aInetAddr, const TTone& aTone)
  2351 EXPORT_C CAknIpAddressQueryDialog* CAknIpAddressQueryDialog::NewL(TInetAddr& aInetAddr, const TTone& aTone)
  2196     {
  2352     {
       
  2353     _AKNTRACE_FUNC_ENTER;
  2197     CAknIpAddressQueryDialog* self = new (ELeave) CAknIpAddressQueryDialog(aInetAddr, aTone);
  2354     CAknIpAddressQueryDialog* self = new (ELeave) CAknIpAddressQueryDialog(aInetAddr, aTone);
  2198     AKNTASHOOK_ADDL( self, "CAknIpAddressQueryDialog" );
  2355     AKNTASHOOK_ADDL( self, "CAknIpAddressQueryDialog" );
       
  2356     _AKNTRACE_FUNC_EXIT;
  2199     return self;
  2357     return self;
  2200     }
  2358     }
  2201 
  2359 
  2202 CAknIpAddressQueryDialog::CAknIpAddressQueryDialog
  2360 CAknIpAddressQueryDialog::CAknIpAddressQueryDialog
  2203     (TInetAddr& aInetAddr, const TTone& aTone) : CAknQueryDialog(aTone), iInetAddr(aInetAddr)
  2361     (TInetAddr& aInetAddr, const TTone& aTone) : CAknQueryDialog(aTone), iInetAddr(aInetAddr)
  2204     {
  2362     {
  2205     }
  2363     }
  2206 
  2364 
  2207 EXPORT_C CAknIpAddressQueryDialog::~CAknIpAddressQueryDialog()
  2365 EXPORT_C CAknIpAddressQueryDialog::~CAknIpAddressQueryDialog()
  2208     {
  2366     {
       
  2367     _AKNTRACE_FUNC_ENTER;
  2209     AKNTASHOOK_REMOVE();
  2368     AKNTASHOOK_REMOVE();
       
  2369     _AKNTRACE_FUNC_EXIT;
  2210     }
  2370     }
  2211 EXPORT_C void CAknIpAddressQueryDialog::SetSizeAndPosition(
  2371 EXPORT_C void CAknIpAddressQueryDialog::SetSizeAndPosition(
  2212         const TSize& aSize )
  2372         const TSize& aSize )
  2213     {
  2373     {
       
  2374     _AKNTRACE_FUNC_ENTER;
       
  2375     _AKNTRACE( "[%s][%s] aSize (W[%d],H[%d]) ", "CAknIpAddressQueryDialog", __FUNCTION__, aSize.iWidth, aSize.iHeight);
  2214     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());    
  2376     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());    
  2215     if(control)
  2377     if(control)
  2216         {
  2378         {
  2217         if ( AknLayoutUtils::PenEnabled() )
  2379         if ( AknLayoutUtils::PenEnabled() )
  2218             {
  2380             {
  2242                 layoutHeading.LayoutRect(mainPane, headingL); 
  2404                 layoutHeading.LayoutRect(mainPane, headingL); 
  2243                 TRect headRect(layoutHeading.Rect());
  2405                 TRect headRect(layoutHeading.Rect());
  2244 
  2406 
  2245                 winRect.iTl.iY -= headRect.Height();
  2407                 winRect.iTl.iY -= headRect.Height();
  2246                 }
  2408                 }
  2247             
  2409             _AKNTRACE( "[%s][%s] winRect(x[%d], y[%d], W[%d], H[%d] ) ", 
       
  2410             		"CAknIpAddressQueryDialog", __FUNCTION__, winRect.iTl.iX, winRect.iTl.iY,
       
  2411             		winRect.Width(), winRect.Height());
  2248             SetRect(winRect);
  2412             SetRect(winRect);
  2249             }
  2413             }
  2250         }
  2414         }
       
  2415     _AKNTRACE_FUNC_EXIT;
  2251     }
  2416     }
  2252 
  2417 
  2253 EXPORT_C CAknQueryControl* CAknIpAddressQueryDialog::QueryControl() const
  2418 EXPORT_C CAknQueryControl* CAknIpAddressQueryDialog::QueryControl() const
  2254     {
  2419     {
  2255     CCoeControl* controlPtr = FindControlOnAnyPageWithControlType(EAknExtCtQuery);
  2420     CCoeControl* controlPtr = FindControlOnAnyPageWithControlType(EAknExtCtQuery);
  2262     return 0;
  2427     return 0;
  2263     }
  2428     }
  2264 
  2429 
  2265 EXPORT_C void CAknIpAddressQueryDialog::PreLayoutDynInitL()
  2430 EXPORT_C void CAknIpAddressQueryDialog::PreLayoutDynInitL()
  2266     {
  2431     {
       
  2432     _AKNTRACE_FUNC_ENTER;
  2267 #ifndef RD_NO_DIALOG_BORDERS
  2433 #ifndef RD_NO_DIALOG_BORDERS
  2268     SetBorder(AknBorderId::EAknBorderNotePopup);
  2434     SetBorder(AknBorderId::EAknBorderNotePopup);
  2269 #else
  2435 #else
  2270     SetBorder(TGulBorder::ENone);
  2436     SetBorder(TGulBorder::ENone);
  2271 #endif
  2437 #endif
  2290         }
  2456         }
  2291     // Create CaptionRetriever for FEP
  2457     // Create CaptionRetriever for FEP
  2292     delete iExtension;
  2458     delete iExtension;
  2293     iExtension = NULL;
  2459     iExtension = NULL;
  2294     iExtension = new(ELeave) CAknQueryDialogExtension(this);
  2460     iExtension = new(ELeave) CAknQueryDialogExtension(this);
       
  2461     _AKNTRACE_FUNC_EXIT;
  2295     }
  2462     }
  2296 
  2463 
  2297 EXPORT_C void CAknIpAddressQueryDialog::PostLayoutDynInitL()
  2464 EXPORT_C void CAknIpAddressQueryDialog::PostLayoutDynInitL()
  2298     {
  2465     {
       
  2466     _AKNTRACE_FUNC_ENTER;
  2299     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2467     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2300     if (control)
  2468     if (control)
  2301         control->StartAnimationL();
  2469         control->StartAnimationL();
       
  2470     _AKNTRACE_FUNC_EXIT;
  2302     }
  2471     }
  2303 
  2472 
  2304 EXPORT_C TBool CAknIpAddressQueryDialog::NeedToDismissQueryL(const TKeyEvent& /*aKeyEvent*/)
  2473 EXPORT_C TBool CAknIpAddressQueryDialog::NeedToDismissQueryL(const TKeyEvent& /*aKeyEvent*/)
  2305     {   
  2474     {   
  2306     return EFalse;
  2475     return EFalse;
  2315         }
  2484         }
  2316 }
  2485 }
  2317 
  2486 
  2318 EXPORT_C TBool CAknIpAddressQueryDialog::OkToExitL(TInt aButtonId)
  2487 EXPORT_C TBool CAknIpAddressQueryDialog::OkToExitL(TInt aButtonId)
  2319     {
  2488     {
       
  2489     _AKNTRACE( "[%s][%s] aButtonId : %d ", 
       
  2490                 		"CAknIpAddressQueryDialog", __FUNCTION__, aButtonId);
  2320     if((IsLeftSoftkeyVisible() && 
  2491     if((IsLeftSoftkeyVisible() && 
  2321         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  2492         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  2322         {   
  2493         {   
  2323         CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2494         CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2324         if ( control )
  2495         if ( control )
  2325             {
  2496             {
  2326             iInetAddr = control->GetInetAddress();
  2497             iInetAddr = control->GetInetAddress();
  2327             }
  2498             }
       
  2499         _AKNTRACE( "[%s][%s] get address and return ETrue", "CAknIpAddressQueryDialog", __FUNCTION__);
  2328         return ETrue;
  2500         return ETrue;
  2329         }
  2501         }
  2330     else if(aButtonId == GetRightCBAShortKeyPress())
  2502     else if(aButtonId == GetRightCBAShortKeyPress())
  2331         {
  2503         {
       
  2504         _AKNTRACE( "[%s][%s] do nothing, return ETrue", "CAknIpAddressQueryDialog", __FUNCTION__);
  2332         return ETrue;
  2505         return ETrue;
  2333         }
  2506         }
       
  2507     _AKNTRACE( "[%s][%s] do nothing, return EFalse", "CAknIpAddressQueryDialog", __FUNCTION__);
  2334     return EFalse;
  2508     return EFalse;
  2335     }
  2509     }
  2336 
  2510 
  2337 
  2511 
  2338 EXPORT_C void CAknIpAddressQueryDialog::UpdateLeftSoftKeyL()
  2512 EXPORT_C void CAknIpAddressQueryDialog::UpdateLeftSoftKeyL()
  2382  * Second phase construction required to align API with multiline queries 
  2556  * Second phase construction required to align API with multiline queries 
  2383  * and because in future MAknQueryData will be used.
  2557  * and because in future MAknQueryData will be used.
  2384  */
  2558  */
  2385 EXPORT_C CAknFixedPointQueryDialog* CAknFixedPointQueryDialog::NewL(TInt& aNumber, const TTone& aTone)
  2559 EXPORT_C CAknFixedPointQueryDialog* CAknFixedPointQueryDialog::NewL(TInt& aNumber, const TTone& aTone)
  2386     {
  2560     {
       
  2561     _AKNTRACE_FUNC_ENTER;
  2387     CAknFixedPointQueryDialog* self = new (ELeave) CAknFixedPointQueryDialog(aNumber, aTone);
  2562     CAknFixedPointQueryDialog* self = new (ELeave) CAknFixedPointQueryDialog(aNumber, aTone);
  2388     AKNTASHOOK_ADDL( self, "CAknFixedPointQueryDialog" );
  2563     AKNTASHOOK_ADDL( self, "CAknFixedPointQueryDialog" );
       
  2564     _AKNTRACE_FUNC_EXIT;
  2389     return self;
  2565     return self;
  2390     }
  2566     }
  2391 
  2567 
  2392 CAknFixedPointQueryDialog::CAknFixedPointQueryDialog
  2568 CAknFixedPointQueryDialog::CAknFixedPointQueryDialog
  2393     (TInt& aNumber, const TTone& aTone) : CAknQueryDialog(aTone), iNumber(aNumber)
  2569     (TInt& aNumber, const TTone& aTone) : CAknQueryDialog(aTone), iNumber(aNumber)
  2399     AKNTASHOOK_REMOVE();
  2575     AKNTASHOOK_REMOVE();
  2400     }
  2576     }
  2401 EXPORT_C void CAknFixedPointQueryDialog::SetSizeAndPosition(
  2577 EXPORT_C void CAknFixedPointQueryDialog::SetSizeAndPosition(
  2402         const TSize& aSize )
  2578         const TSize& aSize )
  2403     {
  2579     {
       
  2580     _AKNTRACE_FUNC_ENTER;
       
  2581     _AKNTRACE( "[%s][%s] aSize (W[%d],H[%d]) ", "CAknFixedPointQueryDialog", __FUNCTION__, aSize.iWidth, aSize.iHeight);
  2404     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());    
  2582     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());    
  2405     if(control)
  2583     if(control)
  2406         {
  2584         {
  2407         if ( AknLayoutUtils::PenEnabled() )
  2585         if ( AknLayoutUtils::PenEnabled() )
  2408             {
  2586             {
  2432                 layoutHeading.LayoutRect(mainPane, headingL); 
  2610                 layoutHeading.LayoutRect(mainPane, headingL); 
  2433                 TRect headRect(layoutHeading.Rect());
  2611                 TRect headRect(layoutHeading.Rect());
  2434 
  2612 
  2435                 winRect.iTl.iY -= headRect.Height();
  2613                 winRect.iTl.iY -= headRect.Height();
  2436                 }
  2614                 }
  2437             
  2615             _AKNTRACE( "[%s][%s] winRect(x[%d], y[%d], W[%d], H[%d] ) ", 
       
  2616                   "CAknFixedPointQueryDialog", __FUNCTION__, winRect.iTl.iX, winRect.iTl.iY,
       
  2617                   winRect.Width(), winRect.Height());
  2438             SetRect(winRect);
  2618             SetRect(winRect);
  2439             }
  2619             }
  2440         }
  2620         }
       
  2621     _AKNTRACE_FUNC_EXIT;
  2441     }
  2622     }
  2442 
  2623 
  2443 EXPORT_C CAknQueryControl* CAknFixedPointQueryDialog::QueryControl() const
  2624 EXPORT_C CAknQueryControl* CAknFixedPointQueryDialog::QueryControl() const
  2444     {
  2625     {
  2445     CCoeControl* controlPtr = FindControlOnAnyPageWithControlType(EAknExtCtQuery);
  2626     CCoeControl* controlPtr = FindControlOnAnyPageWithControlType(EAknExtCtQuery);
  2452     return 0;
  2633     return 0;
  2453     }
  2634     }
  2454 
  2635 
  2455 EXPORT_C void CAknFixedPointQueryDialog::PreLayoutDynInitL()
  2636 EXPORT_C void CAknFixedPointQueryDialog::PreLayoutDynInitL()
  2456     {
  2637     {
       
  2638     _AKNTRACE_FUNC_ENTER;
  2457 #ifndef RD_NO_DIALOG_BORDERS
  2639 #ifndef RD_NO_DIALOG_BORDERS
  2458     SetBorder(AknBorderId::EAknBorderNotePopup);
  2640     SetBorder(AknBorderId::EAknBorderNotePopup);
  2459 #else
  2641 #else
  2460     SetBorder(TGulBorder::ENone);
  2642     SetBorder(TGulBorder::ENone);
  2461 #endif
  2643 #endif
  2480         }
  2662         }
  2481     // Create CaptionRetriever for FEP
  2663     // Create CaptionRetriever for FEP
  2482     delete iExtension;
  2664     delete iExtension;
  2483     iExtension = NULL;
  2665     iExtension = NULL;
  2484     iExtension = new(ELeave) CAknQueryDialogExtension(this);
  2666     iExtension = new(ELeave) CAknQueryDialogExtension(this);
       
  2667     _AKNTRACE_FUNC_EXIT;
  2485     }
  2668     }
  2486 
  2669 
  2487 EXPORT_C void CAknFixedPointQueryDialog::PostLayoutDynInitL()
  2670 EXPORT_C void CAknFixedPointQueryDialog::PostLayoutDynInitL()
  2488     {
  2671     {
       
  2672     _AKNTRACE_FUNC_ENTER;
  2489     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2673     CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2490     if (control)
  2674     if (control)
  2491         control->StartAnimationL();
  2675         control->StartAnimationL();
       
  2676     _AKNTRACE_FUNC_EXIT;
  2492     }
  2677     }
  2493 
  2678 
  2494 EXPORT_C TBool CAknFixedPointQueryDialog::NeedToDismissQueryL(const TKeyEvent& /*aKeyEvent*/)
  2679 EXPORT_C TBool CAknFixedPointQueryDialog::NeedToDismissQueryL(const TKeyEvent& /*aKeyEvent*/)
  2495     {   
  2680     {   
  2496     return EFalse;
  2681     return EFalse;
  2505         }
  2690         }
  2506 }
  2691 }
  2507 
  2692 
  2508 EXPORT_C TBool CAknFixedPointQueryDialog::OkToExitL(TInt aButtonId)
  2693 EXPORT_C TBool CAknFixedPointQueryDialog::OkToExitL(TInt aButtonId)
  2509     {
  2694     {
       
  2695     _AKNTRACE( "[%s][%s] aButtonId : %d  ", "CAknFixedPointQueryDialog", __FUNCTION__, aButtonId);
  2510     if((IsLeftSoftkeyVisible() && 
  2696     if((IsLeftSoftkeyVisible() && 
  2511         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  2697         (aButtonId == GetLeftCBAShortKeyPress() || aButtonId == EEikBidOk)))
  2512         {   
  2698         {   
  2513         CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2699         CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
  2514         if ( control )
  2700         if ( control )
  2515             {
  2701             {
  2516             iNumber = control->GetFixedPointNumber();
  2702             iNumber = control->GetFixedPointNumber();
  2517             }
  2703             }
       
  2704         _AKNTRACE( "[%s][%s] get point number and return ETrue ", "CAknFixedPointQueryDialog", __FUNCTION__);
  2518         return ETrue;
  2705         return ETrue;
  2519         }
  2706         }
  2520     else if(aButtonId == GetRightCBAShortKeyPress())
  2707     else if(aButtonId == GetRightCBAShortKeyPress())
  2521         {
  2708         {
       
  2709         _AKNTRACE( "[%s][%s] do nothing and return ETrue ", "CAknFixedPointQueryDialog", __FUNCTION__);
  2522         return ETrue;
  2710         return ETrue;
  2523         }
  2711         }
       
  2712     _AKNTRACE( "[%s][%s] return EFalse ", "CAknFixedPointQueryDialog", __FUNCTION__);
  2524     return EFalse;
  2713     return EFalse;
  2525     }
  2714     }
  2526 
  2715 
  2527 
  2716 
  2528 EXPORT_C void CAknFixedPointQueryDialog::UpdateLeftSoftKeyL()
  2717 EXPORT_C void CAknFixedPointQueryDialog::UpdateLeftSoftKeyL()
  2654     }
  2843     }
  2655 
  2844 
  2656 
  2845 
  2657 EXPORT_C void CAknMultiLineIpQueryDialog::PreLayoutDynInitL()
  2846 EXPORT_C void CAknMultiLineIpQueryDialog::PreLayoutDynInitL()
  2658     {
  2847     {
       
  2848     _AKNTRACE_FUNC_ENTER;
  2659     if (Layout_Meta_Data::IsLandscapeOrientation())
  2849     if (Layout_Meta_Data::IsLandscapeOrientation())
  2660         {
  2850         {
  2661         SetBorder( TGulBorder::ENone );
  2851         SetBorder( TGulBorder::ENone );
  2662         }
  2852         }
  2663     SetEditableL( ETrue );
  2853     SetEditableL( ETrue );
  2688     
  2878     
  2689     // Create CaptionRetriever for FEP
  2879     // Create CaptionRetriever for FEP
  2690     delete iExtension;
  2880     delete iExtension;
  2691     iExtension = NULL;
  2881     iExtension = NULL;
  2692     iExtension = new(ELeave) CAknMultilineQueryDialogExtension(this, CAknMultilineQueryDialogExtension::EMultIPQuery);
  2882     iExtension = new(ELeave) CAknMultilineQueryDialogExtension(this, CAknMultilineQueryDialogExtension::EMultIPQuery);
       
  2883     _AKNTRACE_FUNC_EXIT;
  2693     }
  2884     }
  2694 
  2885 
  2695 EXPORT_C void CAknMultiLineIpQueryDialog::SetPromptL(const TDesC& aFP, const TDesC& aSP)
  2886 EXPORT_C void CAknMultiLineIpQueryDialog::SetPromptL(const TDesC& aFP, const TDesC& aSP)
  2696 //
  2887 //
  2697 //Store new prompt values
  2888 //Store new prompt values
  2747     return -1;
  2938     return -1;
  2748     }
  2939     }
  2749 
  2940 
  2750 void CAknMultiLineIpQueryDialog::HandleOrientationSwitch()
  2941 void CAknMultiLineIpQueryDialog::HandleOrientationSwitch()
  2751     {
  2942     {
       
  2943     _AKNTRACE_FUNC_ENTER;
  2752     TBool firstLineEnabled = FirstLineEnabled();
  2944     TBool firstLineEnabled = FirstLineEnabled();
  2753     TBool secondLineEnabled = SecondLineEnabled();
  2945     TBool secondLineEnabled = SecondLineEnabled();
  2754 
  2946 
  2755     if (!firstLineEnabled && !secondLineEnabled)
  2947     if (!firstLineEnabled && !secondLineEnabled)
  2756     {
  2948     {
  2776     ctrl1->SetLatentGroupLineFollows(!firstLineEnabled);
  2968     ctrl1->SetLatentGroupLineFollows(!firstLineEnabled);
  2777     ctrl2->SetLatentGroupLineFollows(!secondLineEnabled);
  2969     ctrl2->SetLatentGroupLineFollows(!secondLineEnabled);
  2778     ctrl1->SetFocusing(firstLineEnabled);
  2970     ctrl1->SetFocusing(firstLineEnabled);
  2779     ctrl2->SetFocusing(secondLineEnabled);
  2971     ctrl2->SetFocusing(secondLineEnabled);
  2780     Layout();
  2972     Layout();
       
  2973     _AKNTRACE_FUNC_EXIT;
  2781     }
  2974     }
  2782 
  2975 
  2783 
  2976 
  2784 EXPORT_C void CAknMultiLineIpQueryDialog::HandleResourceChange(TInt aType)
  2977 EXPORT_C void CAknMultiLineIpQueryDialog::HandleResourceChange(TInt aType)
  2785     {
  2978     {
       
  2979 	_AKNTRACE_FUNC_ENTER;
  2786     CAknQueryDialog::HandleResourceChange(aType);
  2980     CAknQueryDialog::HandleResourceChange(aType);
  2787     if (aType == KEikDynamicLayoutVariantSwitch)
  2981     if (aType == KEikDynamicLayoutVariantSwitch)
  2788         {
  2982         {
  2789         if (Layout_Meta_Data::IsLandscapeOrientation())
  2983         if (Layout_Meta_Data::IsLandscapeOrientation())
  2790             {
  2984             {
  2795             SetBorder(AknBorderId::EAknBorderNotePopup);
  2989             SetBorder(AknBorderId::EAknBorderNotePopup);
  2796             }
  2990             }
  2797         HandleOrientationSwitch();
  2991         HandleOrientationSwitch();
  2798         TRAP_IGNORE( UpdateLeftSoftKeyL() );
  2992         TRAP_IGNORE( UpdateLeftSoftKeyL() );
  2799         }
  2993         }
       
  2994     _AKNTRACE_FUNC_EXIT;
  2800     }
  2995     }
  2801     
  2996     
  2802 EXPORT_C TBool CAknMultiLineIpQueryDialog::OkToExitL(TInt aButtonId)
  2997 EXPORT_C TBool CAknMultiLineIpQueryDialog::OkToExitL(TInt aButtonId)
  2803     {    
  2998     {    
  2804     if (Layout_Meta_Data::IsLandscapeOrientation())
  2999     if (Layout_Meta_Data::IsLandscapeOrientation())