intl/icu/source/i18n/cecal.h

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

     1 /*
     2 *******************************************************************************
     3 * Copyright (C) 2003 - 2008, International Business Machines Corporation and  *
     4 * others. All Rights Reserved.                                                *
     5 *******************************************************************************
     6 */
     8 #ifndef CECAL_H
     9 #define CECAL_H
    11 #include "unicode/utypes.h"
    13 #if !UCONFIG_NO_FORMATTING
    15 #include "unicode/calendar.h"
    17 U_NAMESPACE_BEGIN
    19 /**
    20  * Base class for EthiopicCalendar and CopticCalendar.
    21  * @internal
    22  */
    23 class U_I18N_API CECalendar : public Calendar {
    25 protected:
    26     //-------------------------------------------------------------------------
    27     // Constructors...
    28     //-------------------------------------------------------------------------
    30     /**
    31      * Constructs a CECalendar based on the current time in the default time zone
    32      * with the given locale with the Julian epoch offiset
    33      *
    34      * @param aLocale  The given locale.
    35      * @param success  Indicates the status of CECalendar object construction.
    36      *                 Returns U_ZERO_ERROR if constructed successfully.
    37      * @internal
    38      */
    39     CECalendar(const Locale& aLocale, UErrorCode& success);
    41     /**
    42      * Copy Constructor
    43      * @internal
    44      */
    45     CECalendar (const CECalendar& other);
    47     /**
    48      * Destructor.
    49      * @internal
    50      */
    51     virtual ~CECalendar();
    53     /**
    54      * Default assignment operator
    55      * @param right    Calendar object to be copied
    56      * @internal
    57      */
    58     CECalendar& operator=(const CECalendar& right);
    60 protected:
    61     //-------------------------------------------------------------------------
    62     // Calendar framework
    63     //-------------------------------------------------------------------------
    65     /**
    66      * Return JD of start of given month/extended year
    67      * @internal
    68      */
    69     virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const;
    71     /**
    72      * Calculate the limit for a specified type of limit and field
    73      * @internal
    74      */
    75     virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const;
    77     /**
    78      * (Overrides Calendar) Return true if the current date for this Calendar is in
    79      * Daylight Savings Time. Recognizes DST_OFFSET, if it is set.
    80      *
    81      * @param status Fill-in parameter which receives the status of this operation.
    82      * @return   True if the current date for this Calendar is in Daylight Savings Time,
    83      *           false, otherwise.
    84      * @internal
    85      */
    86     virtual UBool inDaylightTime(UErrorCode&) const;
    88     /**
    89      * Returns TRUE because Coptic/Ethiopic Calendar does have a default century
    90      * @internal
    91      */
    92     virtual UBool haveDefaultCentury() const;
    94 protected:
    95     /**
    96      * The Coptic and Ethiopic calendars differ only in their epochs.
    97      * This method must be implemented by CECalendar subclasses to
    98      * return the date offset from Julian
    99      * @internal
   100      */
   101     virtual int32_t getJDEpochOffset() const = 0;
   103     /**
   104      * Convert an Coptic/Ethiopic year, month, and day to a Julian day.
   105      *
   106      * @param year the extended year
   107      * @param month the month
   108      * @param day the day
   109      * @param jdEpochOffset the epoch offset from Julian epoch
   110      * @return Julian day
   111      * @internal
   112      */
   113     static int32_t ceToJD(int32_t year, int32_t month, int32_t date,
   114         int32_t jdEpochOffset);
   116     /**
   117      * Convert a Julian day to an Coptic/Ethiopic year, month and day
   118      *
   119      * @param julianDay the Julian day
   120      * @param jdEpochOffset the epoch offset from Julian epoch
   121      * @param year receives the extended year
   122      * @param month receives the month
   123      * @param date receives the day
   124      * @internal
   125      */
   126     static void jdToCE(int32_t julianDay, int32_t jdEpochOffset,
   127         int32_t& year, int32_t& month, int32_t& day);
   128 };
   130 U_NAMESPACE_END
   132 #endif /* #if !UCONFIG_NO_FORMATTING */
   133 #endif
   134 //eof

mercurial