calendarui/editors/inc/KoreanLunarDateUtil.h
branchRCL_3
changeset 31 97232defd20e
equal deleted inserted replaced
30:bd7edf625bdd 31:97232defd20e
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 #if !defined(__KOREANLUNARDATEUTIL_H_)
       
    19 #define __KOREANLUNARDATEUTIL_H_
       
    20 
       
    21 class MCalenServices;
       
    22 
       
    23 // SYSTEM INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <calencustomisationmanager.h>
       
    26 #include <KoreanCalConv.h>
       
    27 #include <caltime.h>
       
    28 #include <CalendarConverter.h>
       
    29 typedef class TChineseDate TKoreanDate;
       
    30 
       
    31 
       
    32 NONSHARABLE_CLASS( CKoreanLunarDateUtil ) : public CBase
       
    33     {
       
    34     public: // public constructors
       
    35         /**
       
    36         * Two phased constructors.
       
    37         */
       
    38     	static CKoreanLunarDateUtil* NewL(MCalenServices* aServices);
       
    39     	static CKoreanLunarDateUtil* NewLC(MCalenServices* aServices);
       
    40 
       
    41         /**
       
    42         * Destructor.
       
    43         */
       
    44         virtual ~CKoreanLunarDateUtil();
       
    45 	
       
    46     public:
       
    47 
       
    48         /**
       
    49         * Gets nearest possible gregorian date from lunar day and month and gregorian reference.
       
    50         * @param aMonth lunar month
       
    51         * @param aDay lunar day
       
    52         * @param aLeap ETrue if leap month, EFalse otherwise
       
    53         * @param aReference reference gregorian date
       
    54         * @leave KErrArgument Given date is unconvertible.
       
    55         * @return TTime struct including the date.
       
    56         */
       
    57         TDateTime GetNearestGregorianDateL( const TInt aMonth,
       
    58                                             const TInt aDay,
       
    59                                             const TBool aLeap,
       
    60                                             const TDateTime& aReference ) const;
       
    61 
       
    62         /**
       
    63         * Gets lunar yearly repeats in gregorian dates.
       
    64         * @param aRDates repeat date array
       
    65         * @param aEntryDate gregorian entry date
       
    66         * @param aMaxRepeats max repeat dates to get
       
    67         * @param aFloating ETrue if repeat dates should be in floating format, EFalse otherwise
       
    68         */
       
    69         void GetLunarYearlyRepeatsL( RArray<TCalTime>& aRDates,
       
    70                                      const TDateTime& aEntryDate,
       
    71                                      const TBool aFloating ) const;
       
    72 
       
    73     private:
       
    74         /**
       
    75         * C++ default constructor.
       
    76         */
       
    77         CKoreanLunarDateUtil(MCalenServices* aServices);
       
    78         /**
       
    79         * Two phased constructor.
       
    80         */
       
    81         void ConstructL();
       
    82 
       
    83     private:
       
    84         CKoreanCalConv* iConverter;
       
    85         MCalenServices* iServices;
       
    86 	};
       
    87 
       
    88 
       
    89 #endif /* __KOREANLUNARDATEUTIL_H_ */