epoc32/include/app/calendarconverter.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/app/calendarconverter.h	Wed Mar 31 12:27:01 2010 +0100
     1.3 @@ -0,0 +1,89 @@
     1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __CALENDARCONVERTER_H__
    1.20 +#define __CALENDARCONVERTER_H__
    1.21 +
    1.22 +#include <e32std.h>
    1.23 +#include <e32base.h>
    1.24 +
    1.25 +class TChineseDate  
    1.26 +/** Chinese date.
    1.27 +
    1.28 +Its public member data is the year cycle, the year (1-60), the month (1-12), whether or 
    1.29 +not the month is a leap month, and the day in the month (1-29 or 30). 
    1.30 +@publishedAll
    1.31 +@released */
    1.32 +	{
    1.33 +public:
    1.34 +	IMPORT_C TChineseDate();
    1.35 +	IMPORT_C TBool operator==(const TChineseDate& aDate) const;
    1.36 +public:
    1.37 +	/** The year cycle. */
    1.38 +	TInt iCycle;
    1.39 +	/** The year (1-60). */
    1.40 +	TInt iYear;
    1.41 +	/** The month (1-12). */
    1.42 +	TInt iMonth;
    1.43 +	/** Whether or not the month is a leap month. */
    1.44 +	TBool iLeapMonth;
    1.45 +	/** The day in the month (1-29 or 30). */
    1.46 +	TInt iDay;
    1.47 +	};
    1.48 +
    1.49 +
    1.50 +class CChineseCalendarConverter : public CBase
    1.51 +/** Converts between TDateTime and TChineseDate formats in both directions. Chinese dates 
    1.52 +are calculated using the -2636 epoch. This is equivalent to 2637 BCE (Before Common Era). 
    1.53 +@publishedAll
    1.54 +@released */
    1.55 +	{
    1.56 +public:
    1.57 +	IMPORT_C static CChineseCalendarConverter* NewL();
    1.58 +
    1.59 +	/** Creates a Chinese date from a TDateTime value.
    1.60 +	
    1.61 +	@param aDateTime The date/time value to convert.
    1.62 +	@param aChineseDate On return, contains the Chinese date. If the supplied date 
    1.63 +	is invalid, this contains KErrArgument. */
    1.64 +	virtual void DateTimeToChineseL(const TDateTime& aDateTime, TChineseDate& aChineseDate)=0;
    1.65 +
    1.66 +	/** Creates a TDateTime value from a Chinese date.
    1.67 +	
    1.68 +	@param aChineseDate A date in Chinese format.
    1.69 +	@param aDateTime On return, contains a date value. If the supplied date is 
    1.70 +	invalid, this contains KErrArgument. */
    1.71 +	virtual void ChineseToDateTimeL(const TChineseDate& aChineseDate, TDateTime& aDateTime)=0;
    1.72 +
    1.73 +	/** Returns the range of dates, in standard date format, acceptable to the Chinese 
    1.74 +	calendar converter. 
    1.75 +	
    1.76 +	@param aLower On return, contains the lower limit of the converter.
    1.77 +	@param aUpper On return, contains the upper limit of the converter. */
    1.78 +	virtual void DateRange(TDateTime& aLower, TDateTime& aUpper)=0;
    1.79 +
    1.80 +	/** Returns the range of dates, in Chinese date format, acceptable to the Chinese 
    1.81 +	calendar converter.
    1.82 +	
    1.83 +	@param aLower On return, contains the lower limit of the converter.
    1.84 +	@param aUpper On return, contains the upper limit of the converter. */
    1.85 +	virtual void DateRange(TChineseDate& aLower, TChineseDate& aUpper)=0;
    1.86 +	/** Returns the result of the last calendar conversion as a Julian date. 
    1.87 +	
    1.88 +	@return The Julian date. */
    1.89 +	virtual TReal JulianDate() __SOFTFP =0;
    1.90 +	};
    1.91 +
    1.92 +#endif