Home | History | Annotate | Download | only in i18n
      1 /*
      2  *****************************************************************************
      3  * Copyright (C) 2013, International Business Machines Corporation
      4  * and others. All Rights Reserved.
      5  *****************************************************************************
      6  *
      7  * File DANGICAL.H
      8  *****************************************************************************
      9  */
     10 
     11 #ifndef DANGICAL_H
     12 #define DANGICAL_H
     13 
     14 #include "unicode/utypes.h"
     15 
     16 #if !UCONFIG_NO_FORMATTING
     17 
     18 #include "unicode/calendar.h"
     19 #include "unicode/timezone.h"
     20 #include "chnsecal.h"
     21 
     22 U_NAMESPACE_BEGIN
     23 
     24 /**
     25  * <p><code>DangiCalendar</code> is a concrete subclass of {@link Calendar}
     26  * that implements a traditional Korean lunisolar calendar.</p>
     27  *
     28  * <p>DangiCalendar usually should be instantiated using
     29  * {@link com.ibm.icu.util.Calendar#getInstance(ULocale)} passing in a <code>ULocale</code>
     30  * with the tag <code>"@calendar=dangi"</code>.</p>
     31  *
     32  * @internal
     33  */
     34 class DangiCalendar : public ChineseCalendar {
     35  public:
     36   //-------------------------------------------------------------------------
     37   // Constructors...
     38   //-------------------------------------------------------------------------
     39 
     40   /**
     41    * Constructs a DangiCalendar based on the current time in the default time zone
     42    * with the given locale.
     43    *
     44    * @param aLocale  The given locale.
     45    * @param success  Indicates the status of DangiCalendar object construction.
     46    *                 Returns U_ZERO_ERROR if constructed successfully.
     47    * @internal
     48    */
     49   DangiCalendar(const Locale& aLocale, UErrorCode &success);
     50 
     51   /**
     52    * Copy Constructor
     53    * @internal
     54    */
     55   DangiCalendar(const DangiCalendar& other);
     56 
     57   /**
     58    * Destructor.
     59    * @internal
     60    */
     61   virtual ~DangiCalendar();
     62 
     63   /**
     64    * Clone.
     65    * @internal
     66    */
     67   virtual Calendar* clone() const;
     68 
     69   //----------------------------------------------------------------------
     70   // Internal methods & astronomical calculations
     71   //----------------------------------------------------------------------
     72 
     73  private:
     74 
     75   const TimeZone* getDangiCalZoneAstroCalc(void) const;
     76 
     77   // UObject stuff
     78  public:
     79   /**
     80    * @return   The class ID for this object. All objects of a given class have the
     81    *           same class ID. Objects of other classes have different class IDs.
     82    * @internal
     83    */
     84   virtual UClassID getDynamicClassID(void) const;
     85 
     86   /**
     87    * Return the class ID for this class. This is useful only for comparing to a return
     88    * value from getDynamicClassID(). For example:
     89    *
     90    *      Base* polymorphic_pointer = createPolymorphicObject();
     91    *      if (polymorphic_pointer->getDynamicClassID() ==
     92    *          Derived::getStaticClassID()) ...
     93    *
     94    * @return   The class ID for all objects of this class.
     95    * @internal
     96    */
     97   U_I18N_API static UClassID U_EXPORT2 getStaticClassID(void);
     98 
     99   /**
    100    * return the calendar type, "dangi".
    101    *
    102    * @return calendar type
    103    * @internal
    104    */
    105   const char * getType() const;
    106 
    107 
    108  private:
    109 
    110   DangiCalendar(); // default constructor not implemented
    111 };
    112 
    113 U_NAMESPACE_END
    114 
    115 #endif
    116 #endif
    117 
    118 
    119 
    120