calendarui/regionalplugins/calenregionalutil/inc/calenlunarlocalizer.h
changeset 0 f979ecb2b13e
child 18 c198609911f9
child 65 12af337248b1
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     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                                     TInt aMaxWidth, 
       
    46                                     const CFont& aFont,
       
    47 									TBool aTwoLines
       
    48                                   );
       
    49     
       
    50 
       
    51 protected:
       
    52     IMPORT_C CCalenLunarLocalizer();
       
    53 
       
    54     IMPORT_C void ConstructL();
       
    55 
       
    56     TBool TryToFitL( const TDesC& aStr );
       
    57     virtual void LocalizeMonthAndDayL(CCalenLunarLocalizedInfo* aLocInfo,
       
    58                                       TCalenLunarInfo& aInfo);
       
    59 private:
       
    60     void GetChineseDigits(TInt aNum, TDes& aDes);
       
    61     void GetChineseDay(const TChineseDate& aChineseDate, TDes& aDes);
       
    62     void GetChineseMonth(const TChineseDate& aChineseDate, TDes& aDes);
       
    63 
       
    64 protected: // data
       
    65     CEikonEnv* iEikEnv;
       
    66 
       
    67     /**
       
    68      * Localized names of lunar festivals
       
    69      * Own.
       
    70      */
       
    71     CDesCArray* iFestivalNames;
       
    72     
       
    73     /**
       
    74      * Localized names of solar terms 
       
    75      * Own.
       
    76      */
       
    77     CDesCArray* iSolarTermNames;
       
    78 
       
    79     /**
       
    80      * Localized names of animal years
       
    81      * Own.
       
    82      */
       
    83     CDesCArray* iAnimalYearNames;
       
    84 
       
    85     /**
       
    86      * Localized names of heavenly stems
       
    87      * Own.
       
    88      */
       
    89     CDesCArray* iHeavenlyStemNames;
       
    90 
       
    91     /**
       
    92      * Localized names of terrestial branches
       
    93      * Own.
       
    94      */
       
    95     CDesCArray* iTerrestialBranchNames;
       
    96 
       
    97 
       
    98     /**
       
    99      * Format string for western date.
       
   100      * Own.
       
   101      */
       
   102     HBufC* iGregorianDateFormat;
       
   103 
       
   104     TBuf<1000> iLunarExtraRowText;
       
   105 
       
   106 
       
   107     /**
       
   108      * Language independent formatter of extra row information.
       
   109      */
       
   110     CCalenExtraRowFormatter* iRowFormatter;
       
   111     
       
   112     TInt  iResourceFileOffset;
       
   113 
       
   114     };
       
   115 
       
   116 #endif // __CALENLUNARLOCALIZER_H__