calendarui/regionalplugins/inc/calenlunarlocalizer.h
changeset 45 b6db4fd4947b
parent 23 fd30d51f876b
child 46 ecd7b9840282
equal deleted inserted replaced
23:fd30d51f876b 45:b6db4fd4947b
     1 /*
       
     2 * Copyright (c) 2008 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:   Calendar Lunar Plugin 
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19  
       
    20 #ifndef __CALENLUNARLOCALIZER_H__
       
    21 #define __CALENLUNARLOCALIZER_H__
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <badesca.h>
       
    25 #include "CalenLunarLocalizedInfo.h"
       
    26 #include "CalendarVariant.hrh"
       
    27 #include "calendarui_debug.h"
       
    28 
       
    29 class CEikonEnv;
       
    30 class TCalenLunarInfo;
       
    31 class TChineseDate;
       
    32 class CFont;
       
    33 class CCalenExtraRowFormatter;
       
    34 
       
    35 class CCalenLunarLocalizer : public CBase
       
    36     {
       
    37 public: // public API 
       
    38     IMPORT_C static CCalenLunarLocalizer* NewL();
       
    39 
       
    40     IMPORT_C virtual ~CCalenLunarLocalizer();
       
    41     
       
    42     IMPORT_C virtual CCalenLunarLocalizedInfo* LocalizeL( TCalenLunarInfo& aInfo );
       
    43     
       
    44     IMPORT_C virtual TPtrC GetExtraRowTextL( CCalenLunarLocalizedInfo& aLocInfo );
       
    45     
       
    46 
       
    47 protected:
       
    48     IMPORT_C CCalenLunarLocalizer();
       
    49 
       
    50     IMPORT_C void ConstructL();
       
    51 
       
    52     TBool TryToFitL( const TDesC& aStr );
       
    53     virtual void LocalizeMonthAndDayL(CCalenLunarLocalizedInfo* aLocInfo,
       
    54                                       TCalenLunarInfo& aInfo);
       
    55 private:
       
    56     void GetChineseDigits(TInt aNum, TDes& aDes);
       
    57     void GetChineseDay(const TChineseDate& aChineseDate, TDes& aDes);
       
    58     void GetChineseMonth(const TChineseDate& aChineseDate, TDes& aDes);
       
    59 
       
    60 protected: // data
       
    61     CEikonEnv* iEikEnv;
       
    62 
       
    63     /**
       
    64      * Localized names of lunar festivals
       
    65      * Own.
       
    66      */
       
    67     CDesCArray* iFestivalNames;
       
    68     
       
    69     /**
       
    70      * Localized names of solar terms 
       
    71      * Own.
       
    72      */
       
    73     CDesCArray* iSolarTermNames;
       
    74 
       
    75     /**
       
    76      * Localized names of animal years
       
    77      * Own.
       
    78      */
       
    79     CDesCArray* iAnimalYearNames;
       
    80 
       
    81     /**
       
    82      * Localized names of heavenly stems
       
    83      * Own.
       
    84      */
       
    85     CDesCArray* iHeavenlyStemNames;
       
    86 
       
    87     /**
       
    88      * Localized names of terrestial branches
       
    89      * Own.
       
    90      */
       
    91     CDesCArray* iTerrestialBranchNames;
       
    92 
       
    93 
       
    94     /**
       
    95      * Format string for western date.
       
    96      * Own.
       
    97      */
       
    98     HBufC* iGregorianDateFormat;
       
    99 
       
   100     TBuf<1000> iLunarExtraRowText;
       
   101 
       
   102 
       
   103     /**
       
   104      * Language independent formatter of extra row information.
       
   105      */
       
   106     CCalenExtraRowFormatter* iRowFormatter;
       
   107     
       
   108     TInt  iResourceFileOffset;
       
   109 
       
   110     };
       
   111 
       
   112 #endif // __CALENLUNARLOCALIZER_H__