meetingrequest/mrgui/src/cesmrresponsedialog.cpp
branchRCL_3
changeset 12 4ce476e64c59
parent 0 8466d47a6819
child 16 b5fbb9b25d57
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
     1 /*
     1 /*
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    22 #include "esmrdef.h"
    22 #include "esmrdef.h"
    23 //</cmail>
    23 //</cmail>
    24 #include "esmrinternaluid.h"
    24 #include "esmrinternaluid.h"
    25 
    25 
    26 #include <eikenv.h>
    26 #include <eikenv.h>
       
    27 #include <eikcolib.h>
    27 #include <eikappui.h>
    28 #include <eikappui.h>
    28 #include <avkon.hrh>
    29 #include <avkon.hrh>
    29 #include <MAgnEntryUi.h>
    30 #include <magnentryui.h>
    30 #include <eikedwin.h>
    31 #include <eikedwin.h>
    31 #include <esmrgui.rsg>
    32 #include <esmrgui.rsg>
    32 #include <calentry.h>
    33 #include <calentry.h>
    33 #include <hlplch.h>
    34 #include <hlplch.h>
    34 #include <akntoolbar.h>
    35 #include <akntoolbar.h>
    35 #include <aknappui.h>
       
    36 #include <aknViewAppUi.h>
       
    37 #include <aknview.h>
       
    38 #include <eikcolib.h>
       
    39 #include <akntoolbarobserver.h>
       
    40 #include <aknbutton.h>
       
    41 
       
    42 #include <featmgr.h>
       
    43 //</cmail>
       
    44 
    36 
    45 // <cmail> custom sw help files not avilable in Cmail
    37 // <cmail> custom sw help files not avilable in Cmail
    46 //#include <fsmr.hlp.hrh>
    38 #include <csxhelp/cmail.hlp.hrh>
    47 // </cmail>
    39 // </cmail>
    48 
    40 
    49 // DEBUG
    41 // DEBUG
    50 #include "emailtrace.h"
    42 #include "emailtrace.h"
    51 
    43 #include "FreestyleEmailUiConstants.h"
    52 
    44 
    53 // ---------------------------------------------------------------------------
    45 // ---------------------------------------------------------------------------
    54 // CESMRResponseDialog::CESMRResponseDialog
    46 // CESMRResponseDialog::CESMRResponseDialog
    55 // ---------------------------------------------------------------------------
    47 // ---------------------------------------------------------------------------
    56 //
    48 //
    65 // ---------------------------------------------------------------------------
    57 // ---------------------------------------------------------------------------
    66 //
    58 //
    67 CESMRResponseDialog::~CESMRResponseDialog()
    59 CESMRResponseDialog::~CESMRResponseDialog()
    68     {
    60     {
    69     FUNC_LOG;
    61     FUNC_LOG;
    70     TRAP_IGNORE( RestoreMrGuiToolbarL() );
    62     static_cast<CEikAppUiFactory*>( 
       
    63     		iEikonEnv->AppUiFactory() )->CurrentFixedToolbar()->
       
    64     		SetToolbarVisibility( iPreviousVisibility );
    71     // iView is deleted by framework because it uses the
    65     // iView is deleted by framework because it uses the
    72     // custom control mechanism.
    66     // custom control mechanism.
    73     }
    67     }
    74 
    68 
    75 // ---------------------------------------------------------------------------
    69 // ---------------------------------------------------------------------------
    93 //
    87 //
    94 void CESMRResponseDialog::ConstructL()
    88 void CESMRResponseDialog::ConstructL()
    95     {
    89     {
    96     FUNC_LOG;
    90     FUNC_LOG;
    97     CAknDialog::ConstructL( R_RESPONSE_DIALOG_MENUBAR );
    91     CAknDialog::ConstructL( R_RESPONSE_DIALOG_MENUBAR );
    98     CEikonEnv* eikonEnv = CEikonEnv::Static();// codescanner::eikonenvstatic
    92     iPreviousVisibility = static_cast<CEikAppUiFactory*>( 
    99     TRect clientRect = eikonEnv->EikAppUi()->ClientRect();
    93     		iEikonEnv->AppUiFactory() )->CurrentFixedToolbar()->IsShown();
       
    94     static_cast<CEikAppUiFactory*>( 
       
    95         	iEikonEnv->AppUiFactory() )->CurrentFixedToolbar()->SetToolbarVisibility( EFalse );
       
    96     TRect clientRect = iEikonEnv->EikAppUi()->ClientRect();
   100     iView = CESMRResponseDialogView::NewL();
    97     iView = CESMRResponseDialogView::NewL();
   101     iView->SetRect( clientRect );
    98     iView->SetRect( clientRect );
   102     iView->SetSize(clientRect.Size());
    99     iView->SetSize(clientRect.Size());
   103 
       
   104     MakeResponseToolbarL();
       
   105     }
   100     }
   106 
   101 
   107 // ---------------------------------------------------------------------------
   102 // ---------------------------------------------------------------------------
   108 // CESMRResponseDialog::ProcessCommandL
   103 // CESMRResponseDialog::ProcessCommandL
   109 // ---------------------------------------------------------------------------
   104 // ---------------------------------------------------------------------------
   115 
   110 
   116     switch ( aCommand )
   111     switch ( aCommand )
   117         {
   112         {
   118         case EAknCmdHelp:
   113         case EAknCmdHelp:
   119             {
   114             {
   120             // <cmail>
   115             CArrayFix<TCoeHelpContext>* cntx =
   121             // TUid uid = { KUidCalendarApplication };
       
   122             // </cmail>
       
   123             CArrayFix<TCoeHelpContext>* cntx = 
       
   124 				new (ELeave) CArrayFixFlat<TCoeHelpContext>(1);
   116 				new (ELeave) CArrayFixFlat<TCoeHelpContext>(1);
   125             CleanupStack::PushL( cntx );
   117             CleanupStack::PushL( cntx );
   126             // <cmail>
   118             cntx->AppendL( TCoeHelpContext( KFSEmailUiUid, KFSCA_HLP_RESPONSE_EDITOR ) );
   127             //cntx->AppendL( TCoeHelpContext( uid, KFSCA_HLP_RESPONSE_EDITOR ) );
       
   128             // /</cmail>
       
   129             CleanupStack::Pop( cntx );
   119             CleanupStack::Pop( cntx );
   130             HlpLauncher::LaunchHelpApplicationL( iCoeEnv->WsSession(), cntx );
   120             HlpLauncher::LaunchHelpApplicationL( iCoeEnv->WsSession(), cntx );
   131             break;
   121             break;
   132             }
   122             }
   133         case EESMRCmdSendMR: // Fall through
   123         case EESMRCmdSendMR: // Fall through
   141             {
   131             {
   142             break;
   132             break;
   143             }
   133             }
   144         }
   134         }
   145     }
   135     }
   146 // ---------------------------------------------------------------------------
   136 
   147 // CESMRResponseDialog::DynInitMenuPaneL()
       
   148 // ---------------------------------------------------------------------------
       
   149 //
       
   150 void CESMRResponseDialog::DynInitMenuPaneL(
       
   151         /*TInt aResourceId,*/
       
   152         CEikMenuPane* aMenuPane )
       
   153     {
       
   154     FUNC_LOG;
       
   155 	if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) )
       
   156 		{
       
   157 		// remove help support in pf5250
       
   158 		aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue);      
       
   159 		}
       
   160     }
       
   161 // ---------------------------------------------------------------------------
   137 // ---------------------------------------------------------------------------
   162 // CESMRResponseDialog::OfferKeyEventL
   138 // CESMRResponseDialog::OfferKeyEventL
   163 // ---------------------------------------------------------------------------
   139 // ---------------------------------------------------------------------------
   164 //
   140 //
   165 TKeyResponse CESMRResponseDialog::OfferKeyEventL(
   141 TKeyResponse CESMRResponseDialog::OfferKeyEventL(
   234     {
   210     {
   235     FUNC_LOG;
   211     FUNC_LOG;
   236     return ExecuteLD( R_RESPONSE_DIALOG );
   212     return ExecuteLD( R_RESPONSE_DIALOG );
   237     }
   213     }
   238 
   214 
   239 // ---------------------------------------------------------------------------
       
   240 // CESMRViewerDialog::OfferToolbarEventL
       
   241 // ---------------------------------------------------------------------------
       
   242 //
       
   243 void CESMRResponseDialog::OfferToolbarEventL( TInt aCommand ) 
       
   244     {
       
   245     TryExitL( aCommand );
       
   246     }
       
   247 
       
   248 // ---------------------------------------------------------------------------
       
   249 // CESMRViewerDialog::MakeResponseToolbarL
       
   250 // ---------------------------------------------------------------------------
       
   251 //
       
   252 void CESMRResponseDialog::MakeResponseToolbarL()
       
   253     {
       
   254     CAknToolbar* currentToolbar = static_cast<CEikAppUiFactory*>( iEikonEnv->AppUiFactory() )->CurrentFixedToolbar();
       
   255     iOldObserver = currentToolbar->ToolbarObserver();
       
   256     currentToolbar->SetToolbarObserver( this );
       
   257 
       
   258     CAknButton* buttonSend = CAknButton::NewL();
       
   259     buttonSend->ConstructFromResourceL( R_SEND_BUTTON );
       
   260     CAknButton* buttonEmpty1 = CAknButton::NewL();
       
   261     CAknButton* buttonEmpty2 = CAknButton::NewL();
       
   262     
       
   263     currentToolbar->AddItemL( buttonSend, EAknCtButton, EESMRCmdSendMR, 0, 0 );
       
   264     currentToolbar->AddItemL( buttonEmpty1, EAknCtButton, EESMRCmdUndefined, 0, 1 );
       
   265     currentToolbar->AddItemL( buttonEmpty2, EAknCtButton, EESMRCmdUndefined, 0, 2 );
       
   266     }
       
   267 
       
   268 // ---------------------------------------------------------------------------
       
   269 // CESMRViewerDialog::RestoreMrGuiToolbarL
       
   270 // ---------------------------------------------------------------------------
       
   271 //
       
   272 void CESMRResponseDialog::RestoreMrGuiToolbarL()
       
   273     {
       
   274     CAknToolbar* currentToolbar = static_cast<CEikAppUiFactory*>( iEikonEnv->AppUiFactory() )->CurrentFixedToolbar();
       
   275 
       
   276     currentToolbar->SetToolbarObserver( iOldObserver );
       
   277 
       
   278     CAknButton* buttonAccept    = CAknButton::NewL();
       
   279     CAknButton* buttonTentative = CAknButton::NewL();
       
   280     CAknButton* buttonDecline   = CAknButton::NewL();
       
   281     buttonAccept->ConstructFromResourceL( R_ACCEPT_BUTTON );
       
   282     buttonTentative->ConstructFromResourceL( R_TENTATIVE_BUTTON );
       
   283     buttonDecline->ConstructFromResourceL( R_DECLINE_BUTTON );
       
   284     currentToolbar->AddItemL( buttonAccept, EAknCtButton, EESMRCmdAcceptMR, 0, 0 );
       
   285     currentToolbar->AddItemL( buttonTentative, EAknCtButton, EESMRCmdTentativeMR, 0, 1 );
       
   286     currentToolbar->AddItemL( buttonDecline, EAknCtButton, EESMRCmdDeclineMR, 0, 2 );
       
   287     }
       
   288 // EOF
   215 // EOF