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