meetingrequest/mrservices/src/cesmrcaluserutil.cpp
branchRCL_3
changeset 12 4ce476e64c59
parent 0 8466d47a6819
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
    21 //<cmail>
    21 //<cmail>
    22 #include "esmrdef.h"
    22 #include "esmrdef.h"
    23 //</cmail>
    23 //</cmail>
    24 #include <calentry.h>
    24 #include <calentry.h>
    25 #include <caluser.h>
    25 #include <caluser.h>
       
    26 
       
    27 namespace { // codescanner::namespace
       
    28 
       
    29 // Definition for 0
       
    30 const TInt KZero = 0;
       
    31 
       
    32 // Definition for number of hours within day
       
    33 const TInt KHoursInDay = 24;
       
    34 
       
    35 } // namespace
    26 
    36 
    27 // ======== MEMBER FUNCTIONS ========
    37 // ======== MEMBER FUNCTIONS ========
    28 
    38 
    29 // ---------------------------------------------------------------------------
    39 // ---------------------------------------------------------------------------
    30 // CESMRCalUserUtil::CESMRCalUserUtil
    40 // CESMRCalUserUtil::CESMRCalUserUtil
   193         }
   203         }
   194     
   204     
   195     return role;
   205     return role;
   196     }
   206     }
   197 
   207 
       
   208 // ---------------------------------------------------------------------------
       
   209 // CESMRCalUserUtil::IsAlldayEventL
       
   210 // ---------------------------------------------------------------------------
       
   211 //
       
   212 EXPORT_C TBool CESMRCalUserUtil::IsAlldayEventL() const
       
   213     {
       
   214     FUNC_LOG;
       
   215     
       
   216     TBool allDayEvent(EFalse);
       
   217 
       
   218     TCalTime startTime = iEntry.StartTimeL();
       
   219     TCalTime stopTime  = iEntry.EndTimeL();
       
   220 
       
   221     TTimeIntervalHours hoursBetweenStartAndEnd;
       
   222     stopTime.TimeLocalL().HoursFrom(
       
   223             startTime.TimeLocalL(),
       
   224             hoursBetweenStartAndEnd );
       
   225 
       
   226     TCalTime::TTimeMode mode = startTime.TimeMode();
       
   227 
       
   228     TInt hoursBetweenStartAndEndAsInt(  hoursBetweenStartAndEnd.Int() );
       
   229     TInt alldayDivident(  hoursBetweenStartAndEndAsInt % KHoursInDay );
       
   230 
       
   231     TDateTime startTimeLocal = startTime.TimeLocalL().DateTime();
       
   232     TDateTime stopTimeLocal =  stopTime.TimeLocalL().DateTime();
       
   233     
       
   234     if ( hoursBetweenStartAndEndAsInt && KZero == alldayDivident )
       
   235         {
       
   236         if ( startTimeLocal.Hour() == stopTimeLocal.Hour() &&
       
   237              startTimeLocal.Minute() == stopTimeLocal.Minute() &&
       
   238              startTimeLocal.Second() == stopTimeLocal.Second() )
       
   239             {
       
   240             allDayEvent = ETrue;
       
   241             }
       
   242         }
       
   243     
       
   244     return allDayEvent;
       
   245     }
       
   246 
   198 // EOF
   247 // EOF
   199 
   248