pimappsupport/chinesecalendaralg/pluginsrc/calendar.h
branchRCL_3
changeset 12 38571fd2a704
equal deleted inserted replaced
5:42814f902fe6 12:38571fd2a704
       
     1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __CALENDAR_H__
       
    17 #define __CALENDAR_H__
       
    18 
       
    19 // System includes
       
    20 #include <e32std.h>
       
    21 #include <e32def.h>
       
    22 
       
    23 // Constants
       
    24 const TInt KCalConvDayOffsetByOne = 1;
       
    25 const TInt KCalConvMonthOffsetByOne = 1;
       
    26 const TInt KCalConvYearOffsetByOne = 1;
       
    27 const TReal KCalConvPointFive = 0.5;
       
    28 
       
    29 class TCalendar
       
    30 	{
       
    31 public:
       
    32 	TCalendar();
       
    33 	TCalendar& operator=(const TCalendar& aTCal);
       
    34 	TInt JulianDay();
       
    35 
       
    36 protected:
       
    37 	void Round(TInt& aRes, TReal& aNum) const;
       
    38 	void Mod(TReal& aRes, const TReal& aAbscissa, const TReal& aDenominator) const;
       
    39 	void Amod(TReal& aRes, const TReal& aAbscissa, const TReal& aDenominator) const;
       
    40 	void Floor(TInt& aRes, const TReal& aNum) const;
       
    41 	void Ceiling(TInt& aRes, const TReal& aNum) const;
       
    42 
       
    43 protected:
       
    44 	TReal iStartEpoch;
       
    45 	TInt iDaysInNormYear;
       
    46 	TReal iJulianDay;
       
    47 	TInt iCycle;
       
    48 	TInt iLeaps;
       
    49 	TInt iOffset;
       
    50 	TInt iStdYearMonth;
       
    51 	};
       
    52 #endif