Home | History | Annotate | Download | only in common
      1 // Copyright 2014 PDFium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
      6 
      7 #ifndef _FXFA_LOCALEMGR_H
      8 #define _FXFA_LOCALEMGR_H
      9 class CXFA_Node;
     10 class IFX_Locale;
     11 class IFX_LocaleMgr;
     12 class CXFA_LocaleMgr;
     13 #define XFA_LANGID_zh_CN 0x0804
     14 #define XFA_LANGID_zh_TW 0x0404
     15 #define XFA_LANGID_zh_HK 0x0c04
     16 #define XFA_LANGID_ja_JP 0x0411
     17 #define XFA_LANGID_ko_KR 0x0412
     18 #define XFA_LANGID_en_US 0x0409
     19 #define XFA_LANGID_en_GB 0x0809
     20 #define XFA_LANGID_es_ES 0x0c0a
     21 #define XFA_LANGID_es_LA 0x080a
     22 #define XFA_LANGID_de_DE 0x0407
     23 #define XFA_LANGID_fr_FR 0x040c
     24 #define XFA_LANGID_it_IT 0x0410
     25 #define XFA_LANGID_pt_BR 0x0416
     26 #define XFA_LANGID_nl_NL 0x0413
     27 #define XFA_LANGID_ru_RU 0x0419
     28 class CXFA_LocaleMgr : public IFX_LocaleMgr {
     29  public:
     30   CXFA_LocaleMgr(CXFA_Node* pLocaleSet, CFX_WideString wsDeflcid);
     31   virtual void Release();
     32   virtual FX_WORD GetDefLocaleID();
     33   virtual IFX_Locale* GetDefLocale();
     34   virtual IFX_Locale* GetLocale(FX_WORD lcid);
     35   virtual IFX_Locale* GetLocaleByName(const CFX_WideStringC& wsLocaleName);
     36   ~CXFA_LocaleMgr();
     37   void SetDefLocale(IFX_Locale* pLocale);
     38   CFX_WideStringC GetConfigLocaleName(CXFA_Node* pConfig);
     39 
     40  protected:
     41   CFX_PtrArray m_LocaleArray;
     42   CFX_PtrArray m_XMLLocaleArray;
     43   IFX_Locale* m_pDefLocale;
     44   CFX_WideString m_wsConfigLocale;
     45   FX_WORD m_dwDeflcid;
     46   FX_WORD m_dwLocaleFlags;
     47 };
     48 class IXFA_TimeZoneProvider {
     49  public:
     50   static IXFA_TimeZoneProvider* Create();
     51   static IXFA_TimeZoneProvider* Get();
     52   static void Destroy();
     53 
     54   virtual ~IXFA_TimeZoneProvider() {}
     55 
     56   virtual void SetTimeZone(FX_TIMEZONE& tz) = 0;
     57 
     58   virtual void GetTimeZone(FX_TIMEZONE& tz) = 0;
     59 };
     60 class CXFA_TimeZoneProvider : public IXFA_TimeZoneProvider {
     61  public:
     62   CXFA_TimeZoneProvider();
     63   virtual ~CXFA_TimeZoneProvider();
     64   virtual void SetTimeZone(FX_TIMEZONE& tz);
     65   virtual void GetTimeZone(FX_TIMEZONE& tz);
     66 
     67  private:
     68   FX_TIMEZONE m_tz;
     69 };
     70 #endif
     71