pimappsupport/chinesecalendaralg/pluginsrc/chinesecalendar.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 __CHINESECALENDAR_H__
       
    17 #define __CHINESECALENDAR_H__
       
    18 
       
    19 #include "calcondata.h"
       
    20 #include <calendarconverter.h>
       
    21 
       
    22 class TCalconData
       
    23 	{
       
    24 public:
       
    25 	TUint GetData(TInt aCycle, TInt aYear, TInt aMonth) const;
       
    26 	TUint GetNewYear(TInt aCycle, TInt aYear) const;
       
    27 
       
    28 private:
       
    29 	static const TUint16 iCalConDataMonth[KNumberOfYears];
       
    30 	static const TUint32 iCalConDataYear[KNumberOfYears+1];	//marker on end of table
       
    31 	};
       
    32 
       
    33 class TChineseCalendar
       
    34 	{
       
    35 public:
       
    36 	void DateTimeToChinese(const TDateTime& aDT);
       
    37 	void ChineseToDateTime(TDateTime& aDT);
       
    38 	TInt SetDate(const TChineseDate& aDate);
       
    39 	TInt GetDate(TChineseDate& aDate);
       
    40 	TInt ChineseFromFixed(TChineseDate& aDate,const TReal& aJulianDay) const;
       
    41 	TReal JulianDate() __SOFTFP;
       
    42 
       
    43 private:
       
    44 	TBool ValidDate(const TChineseDate &aDate) const;
       
    45 	TBool ChineseToFixed(const TChineseDate& aDate, TReal& aJulianDay) const;
       
    46 	TReal iJulianDay;
       
    47 	TCalconData iData;
       
    48 	};
       
    49 
       
    50 #endif