intl/icu/source/i18n/cecal.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/icu/source/i18n/cecal.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,134 @@
     1.4 +/*
     1.5 +*******************************************************************************
     1.6 +* Copyright (C) 2003 - 2008, International Business Machines Corporation and  *
     1.7 +* others. All Rights Reserved.                                                *
     1.8 +*******************************************************************************
     1.9 +*/
    1.10 +
    1.11 +#ifndef CECAL_H
    1.12 +#define CECAL_H
    1.13 +
    1.14 +#include "unicode/utypes.h"
    1.15 +
    1.16 +#if !UCONFIG_NO_FORMATTING
    1.17 +
    1.18 +#include "unicode/calendar.h"
    1.19 +
    1.20 +U_NAMESPACE_BEGIN
    1.21 +
    1.22 +/**
    1.23 + * Base class for EthiopicCalendar and CopticCalendar.
    1.24 + * @internal
    1.25 + */
    1.26 +class U_I18N_API CECalendar : public Calendar {
    1.27 +
    1.28 +protected:
    1.29 +    //-------------------------------------------------------------------------
    1.30 +    // Constructors...
    1.31 +    //-------------------------------------------------------------------------
    1.32 +
    1.33 +    /**
    1.34 +     * Constructs a CECalendar based on the current time in the default time zone
    1.35 +     * with the given locale with the Julian epoch offiset
    1.36 +     *
    1.37 +     * @param aLocale  The given locale.
    1.38 +     * @param success  Indicates the status of CECalendar object construction.
    1.39 +     *                 Returns U_ZERO_ERROR if constructed successfully.
    1.40 +     * @internal
    1.41 +     */
    1.42 +    CECalendar(const Locale& aLocale, UErrorCode& success);
    1.43 +
    1.44 +    /**
    1.45 +     * Copy Constructor
    1.46 +     * @internal
    1.47 +     */
    1.48 +    CECalendar (const CECalendar& other);
    1.49 +
    1.50 +    /**
    1.51 +     * Destructor.
    1.52 +     * @internal
    1.53 +     */
    1.54 +    virtual ~CECalendar();
    1.55 +
    1.56 +    /**
    1.57 +     * Default assignment operator
    1.58 +     * @param right    Calendar object to be copied
    1.59 +     * @internal
    1.60 +     */
    1.61 +    CECalendar& operator=(const CECalendar& right);
    1.62 +
    1.63 +protected:
    1.64 +    //-------------------------------------------------------------------------
    1.65 +    // Calendar framework
    1.66 +    //-------------------------------------------------------------------------
    1.67 +
    1.68 +    /**
    1.69 +     * Return JD of start of given month/extended year
    1.70 +     * @internal
    1.71 +     */
    1.72 +    virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const;
    1.73 +
    1.74 +    /**
    1.75 +     * Calculate the limit for a specified type of limit and field
    1.76 +     * @internal
    1.77 +     */
    1.78 +    virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const;
    1.79 +
    1.80 +    /**
    1.81 +     * (Overrides Calendar) Return true if the current date for this Calendar is in
    1.82 +     * Daylight Savings Time. Recognizes DST_OFFSET, if it is set.
    1.83 +     *
    1.84 +     * @param status Fill-in parameter which receives the status of this operation.
    1.85 +     * @return   True if the current date for this Calendar is in Daylight Savings Time,
    1.86 +     *           false, otherwise.
    1.87 +     * @internal
    1.88 +     */
    1.89 +    virtual UBool inDaylightTime(UErrorCode&) const;
    1.90 +
    1.91 +    /**
    1.92 +     * Returns TRUE because Coptic/Ethiopic Calendar does have a default century
    1.93 +     * @internal
    1.94 +     */
    1.95 +    virtual UBool haveDefaultCentury() const;
    1.96 +
    1.97 +protected:
    1.98 +    /**
    1.99 +     * The Coptic and Ethiopic calendars differ only in their epochs.
   1.100 +     * This method must be implemented by CECalendar subclasses to
   1.101 +     * return the date offset from Julian
   1.102 +     * @internal
   1.103 +     */
   1.104 +    virtual int32_t getJDEpochOffset() const = 0;
   1.105 +
   1.106 +    /**
   1.107 +     * Convert an Coptic/Ethiopic year, month, and day to a Julian day.
   1.108 +     *
   1.109 +     * @param year the extended year
   1.110 +     * @param month the month
   1.111 +     * @param day the day
   1.112 +     * @param jdEpochOffset the epoch offset from Julian epoch
   1.113 +     * @return Julian day
   1.114 +     * @internal
   1.115 +     */
   1.116 +    static int32_t ceToJD(int32_t year, int32_t month, int32_t date,
   1.117 +        int32_t jdEpochOffset);
   1.118 +
   1.119 +    /**
   1.120 +     * Convert a Julian day to an Coptic/Ethiopic year, month and day
   1.121 +     *
   1.122 +     * @param julianDay the Julian day
   1.123 +     * @param jdEpochOffset the epoch offset from Julian epoch
   1.124 +     * @param year receives the extended year
   1.125 +     * @param month receives the month
   1.126 +     * @param date receives the day
   1.127 +     * @internal
   1.128 +     */
   1.129 +    static void jdToCE(int32_t julianDay, int32_t jdEpochOffset,
   1.130 +        int32_t& year, int32_t& month, int32_t& day);
   1.131 +};
   1.132 +
   1.133 +U_NAMESPACE_END
   1.134 +
   1.135 +#endif /* #if !UCONFIG_NO_FORMATTING */
   1.136 +#endif
   1.137 +//eof

mercurial