1 // Copyright (c) 2002-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __CALENDARCONVERTER_H__
17 #define __CALENDARCONVERTER_H__
26 Its public member data is the year cycle, the year (1-60), the month (1-12), whether or
27 not the month is a leap month, and the day in the month (1-29 or 30).
32 IMPORT_C TChineseDate();
33 IMPORT_C TBool operator==(const TChineseDate& aDate) const;
35 /** The year cycle. */
37 /** The year (1-60). */
39 /** The month (1-12). */
41 /** Whether or not the month is a leap month. */
43 /** The day in the month (1-29 or 30). */
48 class CChineseCalendarConverter : public CBase
49 /** Converts between TDateTime and TChineseDate formats in both directions. Chinese dates
50 are calculated using the -2636 epoch. This is equivalent to 2637 BCE (Before Common Era).
55 IMPORT_C static CChineseCalendarConverter* NewL();
56 /** Creates a Chinese date from a TDateTime value.
58 @param aDateTime The date/time value to convert.
59 @param aChineseDate On return, contains the Chinese date. If the supplied date
60 is invalid, this contains KErrArgument. */
61 virtual void DateTimeToChineseL(const TDateTime& aDateTime, TChineseDate& aChineseDate)=0;
63 /** Creates a TDateTime value from a Chinese date.
65 @param aChineseDate A date in Chinese format.
66 @param aDateTime On return, contains a date value. If the supplied date is
67 invalid, this contains KErrArgument. */
68 virtual void ChineseToDateTimeL(const TChineseDate& aChineseDate, TDateTime& aDateTime)=0;
70 /** Returns the range of dates, in standard date format, acceptable to the Chinese
73 @param aLower On return, contains the lower limit of the converter.
74 @param aUpper On return, contains the upper limit of the converter. */
75 virtual void DateRange(TDateTime& aLower, TDateTime& aUpper)=0;
77 /** Returns the range of dates, in Chinese date format, acceptable to the Chinese
80 @param aLower On return, contains the lower limit of the converter.
81 @param aUpper On return, contains the upper limit of the converter. */
82 virtual void DateRange(TChineseDate& aLower, TChineseDate& aUpper)=0;
83 /** Returns the result of the last calendar conversion as a Julian date.
85 @return The Julian date. */
86 virtual TReal JulianDate() __SOFTFP =0;