// © 2016 and later: Unicode, Inc. and others.1// License & terms of use: http://www.unicode.org/copyright.html2/*3*******************************************************************************4* Copyright (C) 2003 - 2008, International Business Machines Corporation and *5* others. All Rights Reserved. *6*******************************************************************************7*/89#ifndef CECAL_H10#define CECAL_H1112#include "unicode/utypes.h"1314#if !UCONFIG_NO_FORMATTING1516#include "unicode/calendar.h"1718U_NAMESPACE_BEGIN1920/**21* Base class for EthiopicCalendar and CopticCalendar.22* @internal23*/24class U_I18N_API CECalendar : public Calendar {2526protected:27//-------------------------------------------------------------------------28// Constructors...29//-------------------------------------------------------------------------3031/**32* Constructs a CECalendar based on the current time in the default time zone33* with the given locale with the Julian epoch offiset34*35* @param aLocale The given locale.36* @param success Indicates the status of CECalendar object construction.37* Returns U_ZERO_ERROR if constructed successfully.38* @internal39*/40CECalendar(const Locale& aLocale, UErrorCode& success);4142/**43* Copy Constructor44* @internal45*/46CECalendar (const CECalendar& other);4748/**49* Destructor.50* @internal51*/52virtual ~CECalendar();5354/**55* Default assignment operator56* @param right Calendar object to be copied57* @internal58*/59CECalendar& operator=(const CECalendar& right);6061protected:62//-------------------------------------------------------------------------63// Calendar framework64//-------------------------------------------------------------------------6566/**67* Return JD of start of given month/extended year68* @internal69*/70virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const override;7172/**73* Calculate the limit for a specified type of limit and field74* @internal75*/76virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const override;7778/**79* (Overrides Calendar) Return true if the current date for this Calendar is in80* Daylight Savings Time. Recognizes DST_OFFSET, if it is set.81*82* @param status Fill-in parameter which receives the status of this operation.83* @return True if the current date for this Calendar is in Daylight Savings Time,84* false, otherwise.85* @internal86*/87virtual UBool inDaylightTime(UErrorCode&) const override;8889/**90* Returns true because Coptic/Ethiopic Calendar does have a default century91* @internal92*/93virtual UBool haveDefaultCentury() const override;9495protected:96/**97* The Coptic and Ethiopic calendars differ only in their epochs.98* This method must be implemented by CECalendar subclasses to99* return the date offset from Julian100* @internal101*/102virtual int32_t getJDEpochOffset() const = 0;103104/**105* Convert an Coptic/Ethiopic year, month, and day to a Julian day.106*107* @param year the extended year108* @param month the month109* @param day the day110* @param jdEpochOffset the epoch offset from Julian epoch111* @return Julian day112* @internal113*/114static int32_t ceToJD(int32_t year, int32_t month, int32_t date,115int32_t jdEpochOffset);116117/**118* Convert a Julian day to an Coptic/Ethiopic year, month and day119*120* @param julianDay the Julian day121* @param jdEpochOffset the epoch offset from Julian epoch122* @param year receives the extended year123* @param month receives the month124* @param date receives the day125* @internal126*/127static void jdToCE(int32_t julianDay, int32_t jdEpochOffset,128int32_t& year, int32_t& month, int32_t& day);129};130131U_NAMESPACE_END132133#endif /* #if !UCONFIG_NO_FORMATTING */134#endif135//eof136137138