calendarui/views/src/calenweekcontainer.cpp
branchRCL_3
changeset 30 d68a4b5d5885
parent 21 9711e452b5e9
child 36 9c5b1510919f
equal deleted inserted replaced
27:55d60436f00b 30:d68a4b5d5885
   400 // CCalenWeekContainer::SetActiveContextFromHighlightL
   400 // CCalenWeekContainer::SetActiveContextFromHighlightL
   401 // Set Active date and time
   401 // Set Active date and time
   402 // (other items were commented in a header).
   402 // (other items were commented in a header).
   403 // ----------------------------------------------------------------------------
   403 // ----------------------------------------------------------------------------
   404 //
   404 //
   405 void CCalenWeekContainer::SetActiveContextFromHighlightL()
   405 void CCalenWeekContainer::SetActiveContextFromHighlightL(TBool aInstAvailable)
   406     {
   406     {
   407     TRACE_ENTRY_POINT;
   407     TRACE_ENTRY_POINT;
   408 
   408 
   409     MCalenContext& context = iServices.Context();
   409     MCalenContext& context = iServices.Context();
   410     TCalTime currentDayCalTime;
   410     TCalTime currentDayCalTime;
   422         // Focused item
   422         // Focused item
   423         // 1. Non-timed item, 1 for each cell, on same/ different day
   423         // 1. Non-timed item, 1 for each cell, on same/ different day
   424         //    * Focus on instanceId and datetime
   424         //    * Focus on instanceId and datetime
   425         // 2. Timed item, 1-n for each cell, on same/ different day
   425         // 2. Timed item, 1-n for each cell, on same/ different day
   426         //    * Focus on datetime
   426         //    * Focus on datetime
   427         if( itemInfo.HasInstance() )
   427         if( itemInfo.HasInstance() && aInstAvailable)
   428             {
   428             {
   429             TCalenInstanceId instId = TCalenInstanceId::CreateL( *itemInfo.iInstance );
   429             TCalenInstanceId instId = TCalenInstanceId::CreateL( *itemInfo.iInstance );
   430             if( !itemInfo.IsTimed() )       // todo/anniv/memo
   430             if( !itemInfo.IsTimed() )       // todo/anniv/memo
   431                 {
   431                 {
   432                 dt.SetHour( KNonTimedNoteDefautDisplayTime );
   432                 dt.SetHour( KNonTimedNoteDefautDisplayTime );
   436                 }
   436                 }
   437             else    // meeting
   437             else    // meeting
   438                 {
   438                 {
   439                 TTime focusTime = CalenDateUtils::BeginningOfDay( iTime ) + itemInfo.iStartTime;
   439                 TTime focusTime = CalenDateUtils::BeginningOfDay( iTime ) + itemInfo.iStartTime;
   440                 currentDayCalTime.SetTimeLocalL( focusTime );
   440                 currentDayCalTime.SetTimeLocalL( focusTime );
   441  //               context.SetFocusDateAndTimeL( currentDayCalTime,
       
   442   //                                              TVwsViewId( KUidCalendar, KUidCalenWeekView ) );
       
   443                 context.SetFocusDateAndTimeAndInstanceL( currentDayCalTime, instId, 
   441                 context.SetFocusDateAndTimeAndInstanceL( currentDayCalTime, instId, 
   444                                                 TVwsViewId( KUidCalendar, KUidCalenWeekView ) );
   442                                             TVwsViewId( KUidCalendar, KUidCalenWeekView ) );
   445                                                 
       
   446                 TDateTime focusTimeTemp = focusTime.DateTime();
       
   447                 
       
   448                 }
   443                 }
   449             }
   444             }
   450         else if( itemInfo.iStartTime.Int() == KErrNotFound )    // empty non-timed cell
   445         else if( itemInfo.iStartTime.Int() == KErrNotFound )    // empty non-timed cell
   451             {
   446             {
   452             dt.SetHour( KNonTimedNoteDefautDisplayTime );
   447             dt.SetHour( KNonTimedNoteDefautDisplayTime );
  2065 
  2060 
  2066     if(AknLayoutUtils::PenEnabled())
  2061     if(AknLayoutUtils::PenEnabled())
  2067         {
  2062         {
  2068         TInt direction(0);
  2063         TInt direction(0);
  2069         if(aEventID == EAknNaviDecoratorEventLeftTabArrow)
  2064         if(aEventID == EAknNaviDecoratorEventLeftTabArrow)
  2070                     {
  2065             {
  2071                     if(AknLayoutUtils::LayoutMirrored())
  2066             if(AknLayoutUtils::LayoutMirrored())
  2072 						{
  2067                 {
  2073                         direction = 1;
  2068                 direction = 1;
  2074 						}
  2069                 }
  2075                     else
  2070             else
  2076 						{
  2071                 {
  2077                         direction = -1;
  2072                 direction = -1;
  2078 						}
  2073                 }
  2079                     }
  2074             }            
  2080                     
  2075         else if(aEventID == EAknNaviDecoratorEventRightTabArrow)
  2081                 else if(aEventID == EAknNaviDecoratorEventRightTabArrow)
  2076             { 
  2082                     { 
  2077             if(AknLayoutUtils::LayoutMirrored())
  2083                     if(AknLayoutUtils::LayoutMirrored())
  2078                 {
  2084 						{
  2079                 direction = -1;
  2085                         direction = -1;
  2080                 }
  2086 						}
  2081             else
  2087                     else
  2082                 {
  2088 						{
  2083                 direction = 1;
  2089                         direction = 1;
  2084                 }
  2090 						}
  2085             }
  2091                     }
       
  2092         else
  2086         else
  2093             return;
  2087             return;
       
  2088         
  2094         HorizontalWeekMoveL(direction);
  2089         HorizontalWeekMoveL(direction);
  2095         SetActiveContextFromHighlightL();
  2090         SetActiveContextFromHighlightL(EFalse);
  2096         WeekView().SetStatusPaneFromActiveContextL();
  2091         WeekView().SetStatusPaneFromActiveContextL();
  2097         iView->BeginRepopulationL();
  2092         iView->BeginRepopulationL();
  2098         }
  2093         }
  2099 
  2094 
  2100     TRACE_EXIT_POINT;
  2095     TRACE_EXIT_POINT;