meetingrequest/mrgui/src/cesmrtrackingview.cpp
branchRCL_3
changeset 12 4ce476e64c59
child 16 b5fbb9b25d57
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  ESMR Tracking view UI Container class
       
    15 *
       
    16 */
       
    17 
       
    18 // <cmail> custom sw help files not avilable in Cmail
       
    19 //#include <fscale.hlp.hrh> //for custom_sw helps
       
    20 //#include <fsmr.hlp.hrh> //for custom_sw helps
       
    21 // </cmail>
       
    22 #include "cesmrtrackingview.h"
       
    23 #include "mesmrmeetingrequestentry.h"
       
    24 #include "esmrinternaluid.h"
       
    25 #include "cesmrtitlepane.h"
       
    26 #include "cesmrfield.h"
       
    27 #include "mesmrcalentry.h"
       
    28 #include "nmrlayoutmanager.h"
       
    29 #include "cesmrtrackingviewdialog.h"
       
    30 
       
    31 #include <eiklabel.h>
       
    32 #include <avkon.hrh>
       
    33 #include <magnentryui.h>
       
    34 #include <stringloader.h>
       
    35 #include <gulcolor.h>
       
    36 #include <eikimage.h>
       
    37 #include <esmrgui.rsg>
       
    38 #include <akniconutils.h>
       
    39 #include <eikenv.h>
       
    40 #include <aknsconstants.h>
       
    41 #include <aknutils.h>
       
    42 #include <aknsdrawutils.h>
       
    43 #include <aknsbasicbackgroundcontrolcontext.h>
       
    44 #include <hlplch.h>
       
    45 #include <akniconarray.h>
       
    46 #include <eikclbd.h>
       
    47 #include <calentry.h>
       
    48 #include <caluser.h>
       
    49 #include <gulicon.h>
       
    50 
       
    51 #include "emailtrace.h"
       
    52 
       
    53 
       
    54 namespace{
       
    55 // The string format of item in listbox.
       
    56 _LIT(KListItemFormat, "%d\t%S"); 
       
    57 
       
    58 static const TInt KIconArrayCount( 4 );
       
    59 static const TInt KListboxItemGranularity( 3 );
       
    60 static const TInt KMaxItemStringLen (128);
       
    61 }
       
    62 // <cmail> Removed profiling. </cmail>
       
    63 
       
    64 
       
    65 // ======== MEMBER FUNCTIONS ========
       
    66 
       
    67 // ---------------------------------------------------------------------------
       
    68 // CESMRTrackingView::CESMRTrackingView()
       
    69 // ---------------------------------------------------------------------------
       
    70 //
       
    71 CESMRTrackingView::CESMRTrackingView( MESMRCalEntry& aEntry, 
       
    72         const TInt &aReqAttendee,
       
    73         const TInt &aOptAttendee) :
       
    74     iEntry(aEntry),iReqAttendeeCount(aReqAttendee),iOptAttendeeCount(aOptAttendee)
       
    75     {
       
    76     FUNC_LOG;
       
    77     // Do nothing
       
    78     }
       
    79 
       
    80 // ---------------------------------------------------------------------------
       
    81 // CESMRTrackingView::NewL()
       
    82 // ---------------------------------------------------------------------------
       
    83 //
       
    84 CESMRTrackingView* CESMRTrackingView::NewL(
       
    85         MESMRCalEntry& aEntry,
       
    86         const TRect& aRect,
       
    87         const TInt &aReqAttendee,
       
    88         const TInt &aOptAttendee)
       
    89     {
       
    90     FUNC_LOG;
       
    91     CESMRTrackingView* self = new (ELeave) CESMRTrackingView( aEntry ,aReqAttendee , aOptAttendee );
       
    92     CleanupStack::PushL( self );
       
    93     self->ConstructL( aRect );
       
    94     CleanupStack::Pop( self );
       
    95     return self;
       
    96     }
       
    97 
       
    98 // ---------------------------------------------------------------------------
       
    99 // CESMRTrackingView::ConstructL()
       
   100 // ---------------------------------------------------------------------------
       
   101 //
       
   102 void CESMRTrackingView::ConstructL( const TRect& aRect )
       
   103     {
       
   104     FUNC_LOG;
       
   105     iBgContext = CAknsBasicBackgroundControlContext::NewL( 
       
   106             KAknsIIDQsnBgAreaMain, aRect, ETrue);
       
   107 
       
   108     iTitle = CESMRTitlePane::NewL();
       
   109     // Default title text is set here.
       
   110 
       
   111     HBufC* title ;
       
   112     switch (iEntry.Type())
       
   113         {
       
   114         case MESMRCalEntry::EESMRCalEntryTodo:
       
   115             {
       
   116             title = StringLoader::LoadLC ( R_QTN_CALENDAR_TITLE_NEW_TODO );
       
   117             break;
       
   118             }
       
   119         case MESMRCalEntry::EESMRCalEntryMemo:
       
   120             {
       
   121             title = StringLoader::LoadLC ( R_QTN_CALENDAR_TITLE_NEW_MEMO );
       
   122             break;
       
   123             }
       
   124         case MESMRCalEntry::EESMRCalEntryAnniversary:
       
   125             {
       
   126             title = StringLoader::LoadLC(R_QTN_CALENDAR_TITLE_NEW_ANNIVERSARY);
       
   127             break;
       
   128             }
       
   129         case MESMRCalEntry::EESMRCalEntryMeetingRequest: // Fall through
       
   130         case MESMRCalEntry::EESMRCalEntryMeeting: // Fall through
       
   131         case MESMRCalEntry::EESMRCalEntryReminder: // Fall through
       
   132         default:
       
   133             {
       
   134             title = StringLoader::LoadLC( R_QTN_MEET_REQ_TITLE );
       
   135             break;
       
   136             }
       
   137         }
       
   138 
       
   139     iTitle->SetTextL( *title );
       
   140     CleanupStack::PopAndDestroy( title );
       
   141     
       
   142     iESMRStatic.ConnectL();
       
   143     iMenuHandler = &iESMRStatic.ContactMenuHandlerL();
       
   144 
       
   145     SetRect( aRect );
       
   146     }
       
   147 
       
   148 // ---------------------------------------------------------------------------
       
   149 // CESMRTrackingView::~CESMRTrackingView()
       
   150 // ---------------------------------------------------------------------------
       
   151 //
       
   152 CESMRTrackingView::~CESMRTrackingView()
       
   153     {
       
   154     FUNC_LOG;
       
   155     if ( iMenuHandler )
       
   156         {
       
   157         iMenuHandler->Reset();
       
   158         }
       
   159     iESMRStatic.Close();
       
   160     delete iTitle;
       
   161     iList->Reset();
       
   162     delete iList;
       
   163     delete iBgContext;
       
   164     delete iAddress;
       
   165     }
       
   166 
       
   167 // ---------------------------------------------------------------------------
       
   168 // CESMRTrackingView::ExternalizeL()
       
   169 // ---------------------------------------------------------------------------
       
   170 //
       
   171 void CESMRTrackingView::ExternalizeL( TBool /*aForceValidation*/ )
       
   172     {
       
   173     FUNC_LOG;
       
   174     }
       
   175 
       
   176 // ---------------------------------------------------------------------------
       
   177 // CESMRTrackingView::InternalizeL()
       
   178 // ---------------------------------------------------------------------------
       
   179 //
       
   180 void CESMRTrackingView::InternalizeL()
       
   181     {
       
   182     FUNC_LOG;
       
   183     }
       
   184 
       
   185 // ---------------------------------------------------------------------------
       
   186 // CESMRTrackingView::LaunchViewerHelpL
       
   187 // ---------------------------------------------------------------------------
       
   188 //
       
   189 void CESMRTrackingView::LaunchViewerHelpL()
       
   190     {
       
   191     FUNC_LOG;
       
   192 
       
   193     }
       
   194 
       
   195 // ---------------------------------------------------------------------------
       
   196 // CESMRTrackingView::LaunchHelpL
       
   197 // ---------------------------------------------------------------------------
       
   198 //
       
   199 void CESMRTrackingView::LaunchHelpL( const TDesC& aContext )
       
   200     {
       
   201     FUNC_LOG;
       
   202     TUid uid = { KUidCalendarApplication };
       
   203     CArrayFix<TCoeHelpContext>* cntx = 
       
   204         new (ELeave) CArrayFixFlat<TCoeHelpContext>(1);
       
   205     CleanupStack::PushL(cntx);
       
   206     cntx->AppendL( TCoeHelpContext( uid, aContext ) );
       
   207     CleanupStack::Pop(cntx);
       
   208     HlpLauncher::LaunchHelpApplicationL( iCoeEnv->WsSession(), cntx );
       
   209     }
       
   210 
       
   211 // ---------------------------------------------------------------------------
       
   212 // CESMRTrackingView::SetContainerWindowL
       
   213 // ---------------------------------------------------------------------------
       
   214 //
       
   215 void CESMRTrackingView::SetContainerWindowL(const CCoeControl& aContainer)
       
   216     {
       
   217     FUNC_LOG;
       
   218     CCoeControl::SetContainerWindowL( aContainer );
       
   219     iTitle->SetContainerWindowL( *this );
       
   220     /**
       
   221      * Somehow if list is constructed before this SetContainerWindowL is called,
       
   222      * all redraws throws KERN-EXEC 3 (the CCoeControl's iWin variable is NULL)
       
   223      */
       
   224     
       
   225     CreateTrackingListL();
       
   226     InitTrackingListL();
       
   227     }
       
   228 
       
   229 // ---------------------------------------------------------------------------
       
   230 // CESMRTrackingView::CreateTrackingList
       
   231 // ---------------------------------------------------------------------------
       
   232 //
       
   233 void CESMRTrackingView::CreateTrackingListL()
       
   234     {
       
   235     iList = new(ELeave) CAknSingleGraphicStyleListBox();
       
   236     iList->ConstructL(this);     
       
   237     iList->SetContainerWindowL(*this); 
       
   238     iList->SetBackground( this );
       
   239     iList->CreateScrollBarFrameL(ETrue); 
       
   240     iList->ScrollBarFrame()->SetScrollBarVisibilityL( 
       
   241             CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto );
       
   242     iList->SetListBoxObserver(this);
       
   243     }
       
   244 
       
   245 // ---------------------------------------------------------------------------
       
   246 // CESMRTrackingView::InitTrackingList
       
   247 // ---------------------------------------------------------------------------
       
   248 //
       
   249 void CESMRTrackingView::InitTrackingListL()
       
   250     {
       
   251     RPointerArray<CCalAttendee> attendees = iEntry.Entry().AttendeesL();
       
   252     
       
   253     // Init the array of item string and send ownership to listbox
       
   254     iItemArray = new (ELeave) CDesCArrayFlat( KListboxItemGranularity ); 
       
   255     iList->Model()->SetItemTextArray( iItemArray ); 
       
   256     iList->Model()->SetOwnershipType( ELbmOwnsItemArray ); 
       
   257     
       
   258     InitStatusIconArrayL();
       
   259     
       
   260     TBuf16<KMaxItemStringLen> itemString; 
       
   261       
       
   262     if(iReqAttendeeCount > 0)
       
   263         {
       
   264         // Add the "Required" item
       
   265         TBuf<10> textRequired(_L("Required"));
       
   266         itemString.Format( KListItemFormat, ENoneIcon, &textRequired);
       
   267         static_cast<CDesCArray*>(iItemArray)->AppendL( itemString ); 
       
   268     
       
   269         // Add required attendees
       
   270         for(TInt i = 0; i < iReqAttendeeCount; i++)
       
   271             {
       
   272             TPtrC text;
       
   273             text.Set(attendees[i]->CommonName());
       
   274             HBufC* name = text.AllocL();
       
   275             itemString.Format( KListItemFormat, EAcceptIcon, name);
       
   276             static_cast<CDesCArray*>(iItemArray)->AppendL( itemString ); 
       
   277             }
       
   278         
       
   279         iIndexOfOptLabel = iReqAttendeeCount + 1;
       
   280         }
       
   281    
       
   282     if(iOptAttendeeCount > 0)
       
   283         {
       
   284         // Add the "Optional" item
       
   285         TBuf<10> textOptioal(_L("Optional"));
       
   286         itemString.Format( KListItemFormat, ENoneIcon, &textOptioal);
       
   287         static_cast<CDesCArray*>(iItemArray)->AppendL( itemString ); 
       
   288             
       
   289         // Add Optional attendees
       
   290         for(TInt i = iReqAttendeeCount; i < iReqAttendeeCount + iOptAttendeeCount; i++)
       
   291             {
       
   292             TPtrC text;
       
   293             text.Set(attendees[i]->CommonName());
       
   294             HBufC* name = text.AllocL();
       
   295             itemString.Format( KListItemFormat, EAcceptIcon, name);
       
   296             static_cast<CDesCArray*>(iItemArray)->AppendL( itemString ); 
       
   297             }
       
   298         }
       
   299     
       
   300     iList->HandleItemAdditionL();
       
   301     
       
   302     }
       
   303 
       
   304 // ---------------------------------------------------------------------------
       
   305 // CESMRTrackingView::InitStatusIconArray
       
   306 // ---------------------------------------------------------------------------
       
   307 //
       
   308 void CESMRTrackingView::InitStatusIconArrayL()
       
   309     {
       
   310     // Set icon array for listbox
       
   311     CArrayPtr<CGulIcon>* iconArray = new (ELeave) CAknIconArray( KIconArrayCount ); 
       
   312     CleanupStack::PushL( iconArray );
       
   313     
       
   314     // Init status Icons
       
   315     CGulIcon* acceptIcon = InitStatusIconL(NMRBitmapManager::EMRBitmapTrackingAccept);
       
   316     CGulIcon* rejectIcon = InitStatusIconL(NMRBitmapManager::EMRBitmapTrackingReject);
       
   317     CGulIcon* tentativeIcon = InitStatusIconL(NMRBitmapManager::EMRBitmapTrackingTentative);
       
   318     CGulIcon* noneIcon = InitStatusIconL(NMRBitmapManager::EMRBitmapTrackingNone);
       
   319     
       
   320     // Append status icons
       
   321     iconArray->AppendL( acceptIcon );
       
   322     iconArray->AppendL( rejectIcon );
       
   323     iconArray->AppendL( tentativeIcon );
       
   324     iconArray->AppendL( noneIcon );
       
   325     
       
   326     // set icons array to list 
       
   327     iList->ItemDrawer()->ColumnData()->SetIconArray( iconArray ); 
       
   328     CleanupStack::Pop( iconArray );  
       
   329     
       
   330     }
       
   331 
       
   332 // ---------------------------------------------------------------------------
       
   333 // CESMRTrackingView::InitStatusIcon
       
   334 // ---------------------------------------------------------------------------
       
   335 //
       
   336 CGulIcon* CESMRTrackingView::InitStatusIconL(NMRBitmapManager::TMRBitmapId aStatus)
       
   337     {
       
   338     CFbsBitmap* bitMap( NULL );
       
   339     CFbsBitmap* bitMapMask( NULL );    
       
   340     TSize sz(0,0);
       
   341     User::LeaveIfError( 
       
   342                   NMRBitmapManager::GetSkinBasedBitmap( 
       
   343                           aStatus, 
       
   344                           bitMap, bitMapMask, sz ) ); 
       
   345     CGulIcon* icon = CGulIcon::NewL(bitMap, bitMapMask);
       
   346     return icon;
       
   347     }
       
   348 
       
   349 // ---------------------------------------------------------------------------
       
   350 // CESMRTrackingView::CountComponentControls
       
   351 // ---------------------------------------------------------------------------
       
   352 //
       
   353 TInt CESMRTrackingView::CountComponentControls() const
       
   354     {
       
   355     FUNC_LOG;
       
   356     TInt count( 0 );
       
   357 
       
   358     if ( iTitle )
       
   359         ++count;
       
   360 
       
   361     if ( iList )
       
   362         ++count;
       
   363 
       
   364     return count;
       
   365     }
       
   366 
       
   367 // ---------------------------------------------------------------------------
       
   368 // CESMRTrackingView::ComponentControl()
       
   369 // ---------------------------------------------------------------------------
       
   370 //
       
   371 CCoeControl* CESMRTrackingView::ComponentControl( TInt aInd ) const
       
   372     {
       
   373     FUNC_LOG;
       
   374     switch ( aInd )
       
   375         {
       
   376         case 0:
       
   377             {
       
   378             return iTitle;
       
   379             }
       
   380         case 1:
       
   381             {
       
   382             return iList;
       
   383             }
       
   384         default:
       
   385             {
       
   386             return NULL;
       
   387             }
       
   388         }
       
   389     }
       
   390 
       
   391 // ---------------------------------------------------------------------------
       
   392 // CESMRTrackingView::SizeChanged()
       
   393 // ---------------------------------------------------------------------------
       
   394 //
       
   395 void CESMRTrackingView::SizeChanged()
       
   396     {
       
   397     FUNC_LOG;
       
   398     
       
   399     TRect rect( Rect() );
       
   400     if ( iTitle )
       
   401         {
       
   402         TAknWindowComponentLayout titleLayout =
       
   403             NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutCtrlBar );
       
   404         AknLayoutUtils::LayoutControl( iTitle, rect, titleLayout );
       
   405         }
       
   406     if ( iList )
       
   407         {
       
   408         TAknWindowComponentLayout listLayout =
       
   409             NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutContentArea );
       
   410         AknLayoutUtils::LayoutControl( iList, rect, listLayout );
       
   411         }
       
   412     if( iBgContext )
       
   413         {
       
   414         iBgContext->SetRect( rect );
       
   415         if ( &Window() )
       
   416             {
       
   417             iBgContext->SetParentPos( PositionRelativeToScreen() );
       
   418             }
       
   419         }
       
   420     }
       
   421 
       
   422 // ---------------------------------------------------------------------------
       
   423 // CESMRTrackingView::MinimumSize()
       
   424 // Gets the main pane size needed by CEikDialog to layout itself correctly
       
   425 // ---------------------------------------------------------------------------
       
   426 //
       
   427 TSize CESMRTrackingView::MinimumSize()
       
   428     {
       
   429     FUNC_LOG;
       
   430     TRect rect;
       
   431     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect );
       
   432     return rect.Size();
       
   433     }
       
   434 
       
   435 // ---------------------------------------------------------------------------
       
   436 // CESMRTrackingView::OfferKeyEventL
       
   437 // ---------------------------------------------------------------------------
       
   438 //
       
   439 TKeyResponse CESMRTrackingView::OfferKeyEventL(
       
   440         const TKeyEvent &aKeyEvent, 
       
   441         TEventCode aType)
       
   442     {
       
   443     FUNC_LOG;
       
   444     TKeyResponse response( EKeyWasNotConsumed );
       
   445     if ( iList )
       
   446         {
       
   447         response = iList->OfferKeyEventL( aKeyEvent, aType );
       
   448         iList->DrawDeferred();
       
   449         }
       
   450     return response;
       
   451     }
       
   452 
       
   453 // ---------------------------------------------------------------------------
       
   454 // CESMRTrackingView::Draw
       
   455 // This Draw is called when background for title pane (iTitle) is drawn
       
   456 // ---------------------------------------------------------------------------
       
   457 //
       
   458 void CESMRTrackingView::Draw( const TRect& aRect ) const
       
   459     {
       
   460     FUNC_LOG;
       
   461     CWindowGc& gc = SystemGc();
       
   462       
       
   463     // Draw the background for iTitle using the current skin
       
   464     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   465     MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
       
   466     AknsDrawUtils::Background( skin, cc, this, gc, aRect );
       
   467     }
       
   468 
       
   469 // ---------------------------------------------------------------------------
       
   470 // CESMRTrackingView::Draw
       
   471 // This draw method draws the dialog area
       
   472 // ---------------------------------------------------------------------------
       
   473 //
       
   474 void CESMRTrackingView::Draw(
       
   475         CWindowGc& aGc, 
       
   476         const CCoeControl& aControl, 
       
   477         const TRect& /*aRect*/) const
       
   478     {
       
   479     FUNC_LOG;
       
   480     // Draw the background for aControl using the current skin
       
   481     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   482     MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
       
   483     AknsDrawUtils::Background( skin, cc, &aControl, aGc, aControl.Rect() );
       
   484     }
       
   485 
       
   486 // ---------------------------------------------------------------------------
       
   487 // CESMRTrackingView::GetTextDrawer
       
   488 // ---------------------------------------------------------------------------
       
   489 //
       
   490 void CESMRTrackingView::GetTextDrawer(
       
   491         CCoeTextDrawerBase*& /*aText*/, 
       
   492         const CCoeControl* /*aControl*/) const
       
   493     {
       
   494     // Do nothing
       
   495     }
       
   496 
       
   497 // ---------------------------------------------------------------------------
       
   498 // CESMRTrackingView::SetTitleL()
       
   499 // ---------------------------------------------------------------------------
       
   500 //
       
   501 void CESMRTrackingView::SetTitleL( const TDesC& aTitle )
       
   502     {
       
   503     FUNC_LOG;
       
   504     iTitle->SetTextL( aTitle );
       
   505     }
       
   506 
       
   507 // ---------------------------------------------------------------------------
       
   508 // CESMRTrackingView::FontSizeSettingsChanged()
       
   509 // ---------------------------------------------------------------------------
       
   510 //
       
   511 void CESMRTrackingView::FontSizeSettingsChanged()
       
   512     {
       
   513     FUNC_LOG;
       
   514 //    iList->HandleFontChange();
       
   515     SizeChanged();
       
   516     }
       
   517 
       
   518 // ---------------------------------------------------------------------------
       
   519 // CESMRTrackingView::HandleResourceChange()
       
   520 // ---------------------------------------------------------------------------
       
   521 //
       
   522 void CESMRTrackingView::HandleResourceChange( TInt aType )
       
   523     {
       
   524     FUNC_LOG;
       
   525     CCoeControl::HandleResourceChange( aType );
       
   526     TInt error = KErrNone;
       
   527     
       
   528     switch ( aType )
       
   529         {
       
   530         case KEikDynamicLayoutVariantSwitch:
       
   531         case KAknLocalZoomLayoutSwitch:
       
   532             {
       
   533             SizeChanged();
       
   534             break;
       
   535             }
       
   536         default:
       
   537             {
       
   538             break;
       
   539             }
       
   540         }
       
   541 
       
   542     if ( error != KErrNone )
       
   543         {
       
   544         iCoeEnv->HandleError( error );
       
   545         }
       
   546     }
       
   547 
       
   548 // ---------------------------------------------------------------------------
       
   549 // CESMRTrackingView::MopSupplyObject()
       
   550 // ---------------------------------------------------------------------------
       
   551 //
       
   552 TTypeUid::Ptr CESMRTrackingView::MopSupplyObject( TTypeUid aId )
       
   553     {
       
   554     if ( iBgContext )
       
   555         {
       
   556         return MAknsControlContext::SupplyMopObject( aId, iBgContext );
       
   557         }
       
   558     return CCoeControl::MopSupplyObject( aId );
       
   559     }
       
   560 
       
   561 // ---------------------------------------------------------------------------
       
   562 // CESMRTrackingViewDialog::HandleListBoxEventL
       
   563 // ---------------------------------------------------------------------------
       
   564 //
       
   565 void CESMRTrackingView::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
       
   566     {
       
   567     if( EEventItemClicked == aEventType )
       
   568         {
       
   569         TInt currentFocusingIndex = aListBox->CurrentItemIndex();
       
   570         // Make sure the focus item is not the req/opt 
       
   571         if(currentFocusingIndex != 0 && currentFocusingIndex != iIndexOfOptLabel)
       
   572             {
       
   573             // Tap on the focused item 
       
   574             if(currentFocusingIndex == iFocusedItemIndex)
       
   575                 {
       
   576                 iParentDialog->HandleListEventL();
       
   577                 }
       
   578             // Focus changed
       
   579             else
       
   580                 {
       
   581                 TInt attendeeIndex = currentFocusingIndex;
       
   582                 
       
   583                 if(currentFocusingIndex > 0 && currentFocusingIndex < iIndexOfOptLabel)
       
   584                     attendeeIndex--;
       
   585                 if(currentFocusingIndex > iIndexOfOptLabel)
       
   586                     attendeeIndex -= 2;
       
   587 
       
   588                 RPointerArray<CCalAttendee> attendees = iEntry.Entry().AttendeesL();
       
   589                 iAddress = attendees[attendeeIndex]->Address().AllocL();
       
   590                 
       
   591                 iMenuHandler->SetValueL(*iAddress, CESMRContactMenuHandler::EValueTypeEmail);
       
   592                 }
       
   593             }
       
   594         else
       
   595             {
       
   596             iMenuHandler->Reset();
       
   597             }
       
   598         // Record the focused item index
       
   599         iFocusedItemIndex = currentFocusingIndex;
       
   600         }
       
   601     }
       
   602 
       
   603 // ---------------------------------------------------------------------------
       
   604 // CESMRTrackingViewDialog::HandleListBoxEventL
       
   605 // ---------------------------------------------------------------------------
       
   606 //
       
   607 void CESMRTrackingView::SetParentDialog(CCoeControl* aParentDialog)
       
   608     {
       
   609     iParentDialog = (CESMRTrackingViewDialog*)aParentDialog;
       
   610     }
       
   611 
       
   612 // EOF
       
   613 
       
   614