32 #if U_SHOW_CPLUSPLUS_API
38 #if !UCONFIG_NO_FORMATTING
48 class ICUServiceFactory;
191 #ifndef U_FORCE_HIDE_DEPRECATED_API
199 #ifndef U_HIDE_DEPRECATED_API
214 DAY_OF_WEEK_IN_MONTH,
234 #endif // U_FORCE_HIDE_DEPRECATED_API
236 #ifndef U_HIDE_DEPRECATED_API
295 virtual Calendar* clone()
const = 0;
387 static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
416 static UDate U_EXPORT2 getNow(
void);
526 #ifndef U_FORCE_HIDE_DEPRECATED_API
547 virtual void add(EDateFields field, int32_t amount,
UErrorCode& status);
548 #endif // U_FORCE_HIDE_DEPRECATED_API
572 #ifndef U_HIDE_DEPRECATED_API
642 #ifndef U_FORCE_HIDE_DEPRECATED_API
674 virtual void roll(EDateFields field, int32_t amount,
UErrorCode& status);
675 #endif // U_FORCE_HIDE_DEPRECATED_API
710 #ifndef U_FORCE_HIDE_DEPRECATED_API
766 virtual int32_t fieldDifference(
UDate when, EDateFields field,
UErrorCode& status);
767 #endif // U_FORCE_HIDE_DEPRECATED_API
834 void adoptTimeZone(
TimeZone* value);
843 void setTimeZone(
const TimeZone& zone);
853 const TimeZone& getTimeZone(
void)
const;
887 void setLenient(
UBool lenient);
895 UBool isLenient(
void)
const;
965 #ifndef U_HIDE_DEPRECATED_API
972 void setFirstDayOfWeek(EDaysOfWeek value);
983 #ifndef U_HIDE_DEPRECATED_API
990 EDaysOfWeek getFirstDayOfWeek(
void)
const;
1011 void setMinimalDaysInFirstWeek(uint8_t value);
1022 uint8_t getMinimalDaysInFirstWeek(
void)
const;
1024 #ifndef U_FORCE_HIDE_DEPRECATED_API
1033 virtual int32_t getMinimum(EDateFields field)
const;
1034 #endif // U_FORCE_HIDE_DEPRECATED_API
1046 #ifndef U_FORCE_HIDE_DEPRECATED_API
1055 virtual int32_t getMaximum(EDateFields field)
const;
1056 #endif // U_FORCE_HIDE_DEPRECATED_API
1068 #ifndef U_FORCE_HIDE_DEPRECATED_API
1077 virtual int32_t getGreatestMinimum(EDateFields field)
const;
1078 #endif // U_FORCE_HIDE_DEPRECATED_API
1090 #ifndef U_FORCE_HIDE_DEPRECATED_API
1099 virtual int32_t getLeastMaximum(EDateFields field)
const;
1100 #endif // U_FORCE_HIDE_DEPRECATED_API
1112 #ifndef U_HIDE_DEPRECATED_API
1127 int32_t getActualMinimum(EDateFields field,
UErrorCode& status)
const;
1146 #ifndef U_HIDE_DEPRECATED_API
1163 int32_t getActualMaximum(EDateFields field,
UErrorCode& status)
const;
1184 #ifndef U_HIDE_DEPRECATED_API
1198 int32_t get(EDateFields field,
UErrorCode& status)
const;
1216 #ifndef U_HIDE_DEPRECATED_API
1225 UBool isSet(EDateFields field)
const;
1238 #ifndef U_HIDE_DEPRECATED_API
1246 void set(EDateFields field, int32_t value);
1268 void set(int32_t year, int32_t month, int32_t date);
1282 void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute);
1297 void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second);
1307 #ifndef U_HIDE_DEPRECATED_API
1316 void clear(EDateFields field);
1378 virtual const char * getType()
const = 0;
1432 virtual UBool isWeekend(
void)
const;
1493 virtual void computeTime(
UErrorCode& status);
1506 virtual void computeFields(
UErrorCode& status);
1517 double getTimeInMillis(
UErrorCode& status)
const;
1527 void setTimeInMillis(
double millis,
UErrorCode& status );
1540 #ifndef U_HIDE_DEPRECATED_API
1552 #ifndef U_HIDE_INTERNAL_API
1576 #ifndef U_HIDE_DEPRECATED_API
1586 void internalSet(EDateFields field, int32_t value);
1613 #ifndef U_HIDE_INTERNAL_API
1614 UCAL_LIMIT_MINIMUM = 0,
1615 UCAL_LIMIT_GREATEST_MINIMUM,
1616 UCAL_LIMIT_LEAST_MAXIMUM,
1643 virtual int32_t handleGetLimit(
UCalendarDateFields field, ELimitType limitType)
const = 0;
1668 virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month,
1669 UBool useMonth)
const = 0;
1678 virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month)
const ;
1687 virtual int32_t handleGetYearLength(int32_t eyear)
const;
1698 virtual int32_t handleGetExtendedYear() = 0;
1718 virtual int32_t handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy);
1728 #ifndef U_HIDE_INTERNAL_API
1735 int32_t computeJulianDay();
1744 double computeMillisInDay();
1755 int32_t computeZoneOffset(
double millis,
double millisInDay,
UErrorCode &ec);
1837 #ifndef U_HIDE_INTERNAL_API
1917 #ifndef U_FORCE_HIDE_DEPRECATED_API
1923 #endif // U_FORCE_HIDE_DEPRECATED_API
1966 virtual void handleComputeFields(int32_t julianDay,
UErrorCode &status);
1968 #ifndef U_HIDE_INTERNAL_API
1975 return fGregorianYear;
1984 return fGregorianMonth;
1993 return fGregorianDayOfYear;
2002 return fGregorianDayOfMonth;
2012 virtual int32_t getDefaultMonthInYear(int32_t eyear) ;
2022 virtual int32_t getDefaultDayInMonth(int32_t eyear, int32_t month);
2103 int32_t weekNumber(int32_t desiredDay, int32_t dayOfPeriod, int32_t dayOfWeek);
2106 #ifndef U_HIDE_INTERNAL_API
2137 inline int32_t weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek);
2143 int32_t getLocalDOW();
2157 void recalculateStamp();
2196 uint8_t fMinimalDaysInFirstWeek;
2198 int32_t fWeekendOnsetMillis;
2200 int32_t fWeekendCeaseMillis;
2212 void setWeekData(
const Locale& desiredLocale,
const char *type,
UErrorCode& success);
2230 int32_t fGregorianYear;
2237 int32_t fGregorianMonth;
2244 int32_t fGregorianDayOfYear;
2251 int32_t fGregorianDayOfMonth;
2261 void computeGregorianAndDOWFields(int32_t julianDay,
UErrorCode &ec);
2272 void computeGregorianFields(int32_t julianDay,
UErrorCode &ec);
2318 #ifndef U_HIDE_INTERNAL_API
2328 static uint8_t julianDayToDayOfWeek(
double julian);
2336 #if !UCONFIG_NO_SERVICE
2341 #ifndef U_HIDE_INTERNAL_API
2387 friend class CalendarFactory;
2393 friend class CalendarService;
2399 friend class DefaultCalendarFactory;
2406 virtual UBool haveDefaultCentury()
const = 0;
2412 virtual UDate defaultCenturyStart()
const = 0;
2417 virtual int32_t defaultCenturyStartYear()
const = 0;
2432 virtual int32_t getRelatedYear(
UErrorCode &status)
const;
2439 virtual void setRelatedYear(int32_t year);
2441 #ifndef U_HIDE_INTERNAL_API
2468 #ifndef U_HIDE_INTERNAL_API
2477 static Calendar * U_EXPORT2 makeInstance(
2490 static void U_EXPORT2 getCalendarTypeFromLocale(
2493 int32_t typeBufferSize,
2504 return createInstance(zone, Locale::getDefault(), errorCode);
2512 roll(field, (int32_t)(up ? +1 : -1), status);
2515 #ifndef U_HIDE_DEPRECATED_API
2534 fFields[field] = value;
2535 fStamp[field] = kInternallySet;
2536 fIsSet[field] =
true;
2540 #ifndef U_HIDE_INTERNAL_API
2541 inline int32_t Calendar::weekNumber(int32_t dayOfPeriod, int32_t dayOfWeek)
2543 return weekNumber(dayOfPeriod, dayOfPeriod, dayOfWeek);