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