diff -r 42814f902fe6 -r 38571fd2a704 pimappsupport/chinesecalendaralg/pluginsrc/calendar.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pimappsupport/chinesecalendaralg/pluginsrc/calendar.h Fri Mar 12 15:42:35 2010 +0200 @@ -0,0 +1,52 @@ +// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef __CALENDAR_H__ +#define __CALENDAR_H__ + +// System includes +#include +#include + +// Constants +const TInt KCalConvDayOffsetByOne = 1; +const TInt KCalConvMonthOffsetByOne = 1; +const TInt KCalConvYearOffsetByOne = 1; +const TReal KCalConvPointFive = 0.5; + +class TCalendar + { +public: + TCalendar(); + TCalendar& operator=(const TCalendar& aTCal); + TInt JulianDay(); + +protected: + void Round(TInt& aRes, TReal& aNum) const; + void Mod(TReal& aRes, const TReal& aAbscissa, const TReal& aDenominator) const; + void Amod(TReal& aRes, const TReal& aAbscissa, const TReal& aDenominator) const; + void Floor(TInt& aRes, const TReal& aNum) const; + void Ceiling(TInt& aRes, const TReal& aNum) const; + +protected: + TReal iStartEpoch; + TInt iDaysInNormYear; + TReal iJulianDay; + TInt iCycle; + TInt iLeaps; + TInt iOffset; + TInt iStdYearMonth; + }; +#endif