intl/icu/source/i18n/coptccal.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 - 2013, International Business Machines Corporation and  *
     4 * others. All Rights Reserved.                                                *
     5 *******************************************************************************
     6 */
     8 #ifndef COPTCCAL_H
     9 #define COPTCCAL_H
    11 #include "unicode/utypes.h"
    13 #if !UCONFIG_NO_FORMATTING
    15 #include "unicode/calendar.h"
    16 #include "cecal.h"
    18 U_NAMESPACE_BEGIN
    20 /**
    21  * Implement the Coptic calendar system.
    22  * @internal
    23  */
    24 class CopticCalendar : public CECalendar {
    26 public:
    27     /**
    28      * Useful constants for CopticCalendar.
    29      * @internal
    30      */
    31     enum EMonths {
    32         /** 
    33          * Constant for &#x03c9;&#x03bf;&#x03b3;&#x03c4;/&#x062a;&#xfeee;&#xfe97;,
    34          * the 1st month of the Coptic year. 
    35          */
    36         TOUT,
    38         /** 
    39          * Constant for &#x03a0;&#x03b1;&#x03bf;&#x03c0;&#x03b9;/&#xfeea;&#xfe91;&#xfe8e;&#xfe91;,
    40          * the 2nd month of the Coptic year. 
    41          */
    42         BABA,
    44         /** 
    45          * Constant for &#x0391;&#x03b8;&#x03bf;&#x03c1;/&#x0631;&#xfeee;&#xfe97;&#xfe8e;&#xfeeb;,
    46          * the 3rd month of the Coptic year. 
    47          */
    48         HATOR,
    50         /** 
    51          * Constant for &#x03a7;&#x03bf;&#x03b9;&#x03b1;&#x03ba;/&#xfeda;&#xfeec;&#xfef4;&#xfedb;,
    52          * the 4th month of the Coptic year. 
    53          */
    54         KIAHK,
    56         /** 
    57          * Constant for &#x03a4;&#x03c9;&#x03b2;&#x03b9;/&#x0637;&#xfeee;&#xfe92;&#xfeeb;,
    58          * the 5th month of the Coptic year. 
    59          */
    60         TOBA,
    62         /** 
    63          * Constant for &#x039c;&#x03b5;&#x03e3;&#x03b9;&#x03c1;/&#xfeae;&#xfef4;&#xfeb8;&#xfee3;&#x0623;,
    64          * the 6th month of the Coptic year. 
    65          */
    66         AMSHIR,
    68         /** 
    69          * Constant for &#x03a0;&#x03b1;&#x03c1;&#x03b5;&#x03bc;&#x03e9;&#x03b1;&#x03c4;/&#x062a;&#xfe8e;&#xfeec;&#xfee3;&#xfeae;&#xfe91;,
    70          * the 7th month of the Coptic year. 
    71          */
    72         BARAMHAT,
    74         /** 
    75          * Constant for &#x03a6;&#x03b1;&#x03c1;&#x03bc;&#x03bf;&#x03b8;&#x03b9;/&#x0647;&#x062f;&#xfeee;&#xfee3;&#xfeae;&#xfe91;, 
    76          * the 8th month of the Coptic year. 
    77          */
    78         BARAMOUDA,
    80         /** 
    81          * Constant for &#x03a0;&#x03b1;&#x03e3;&#x03b1;&#x03bd;/&#xfeb2;&#xfee8;&#xfeb8;&#xfe91;,
    82          * the 9th month of the Coptic year. 
    83          */
    84         BASHANS,
    86         /** 
    87          * Constant for &#x03a0;&#x03b1;&#x03c9;&#x03bd;&#x03b9;/&#xfeea;&#xfee7;&#x0624;&#xfeee;&#xfe91;,
    88          * the 10th month of the Coptic year. 
    89          */
    90         PAONA,
    92         /** 
    93          * Constant for &#x0395;&#x03c0;&#x03b7;&#x03c0;/&#xfe90;&#xfef4;&#xfe91;&#x0623;,
    94          * the 11th month of the Coptic year. 
    95          */
    96         EPEP,
    98         /** 
    99          * Constant for &#x039c;&#x03b5;&#x03f2;&#x03c9;&#x03c1;&#x03b7;/&#x0649;&#xfeae;&#xfeb4;&#xfee3;,
   100          * the 12th month of the Coptic year. 
   101          */
   102         MESRA,
   104         /** 
   105          * Constant for &#x03a0;&#x03b9;&#x03ba;&#x03bf;&#x03b3;&#x03eb;&#x03b9;
   106          * &#x03bc;&#x03b1;&#x03b2;&#x03bf;&#x03c4;/&#xfeae;&#xfef4;&#xfed0;&#xfebc;&#xfedf;&#x0627;
   107          * &#xfeae;&#xfeec;&#xfeb8;&#xfedf;&#x0627;,
   108          * the 13th month of the Coptic year. 
   109          */
   110         NASIE
   111     };
   113     enum EEras {
   114         BCE,    // Before the epoch
   115         CE      // After the epoch
   116     };
   118     /**
   119      * Constructs a CopticCalendar based on the current time in the default time zone
   120      * with the given locale.
   121      *
   122      * @param aLocale  The given locale.
   123      * @param success  Indicates the status of CopticCalendar object construction.
   124      *                 Returns U_ZERO_ERROR if constructed successfully.
   125      * @internal
   126      */
   127     CopticCalendar(const Locale& aLocale, UErrorCode& success);
   129     /**
   130      * Copy Constructor
   131      * @internal
   132      */
   133     CopticCalendar (const CopticCalendar& other);
   135     /**
   136      * Destructor.
   137      * @internal
   138      */
   139     virtual ~CopticCalendar();
   141     /**
   142      * Create and return a polymorphic copy of this calendar.
   143      * @return    return a polymorphic copy of this calendar.
   144      * @internal
   145      */
   146     virtual Calendar* clone(void) const;
   148     /**
   149      * return the calendar type, "coptic"
   150      * @return calendar type
   151      * @internal
   152      */
   153     const char * getType() const;
   155 protected:
   156     //-------------------------------------------------------------------------
   157     // Calendar framework
   158     //-------------------------------------------------------------------------
   160     /**
   161      * Return the extended year defined by the current fields.
   162      * @internal
   163      */
   164     virtual int32_t handleGetExtendedYear();
   166     /**
   167      * Compute fields from the JD
   168      * @internal
   169      */
   170     virtual void handleComputeFields(int32_t julianDay, UErrorCode &status);
   172     /**
   173      * Returns the date of the start of the default century
   174      * @return start of century - in milliseconds since epoch, 1970
   175      * @internal
   176      */
   177     virtual UDate defaultCenturyStart() const;
   179     /**
   180      * Returns the year in which the default century begins
   181      * @internal
   182      */
   183     virtual int32_t defaultCenturyStartYear() const;
   185     /**
   186      * Return the date offset from Julian
   187      * @internal
   188      */
   189     virtual int32_t getJDEpochOffset() const;
   192 public:
   193     /**
   194      * Override Calendar Returns a unique class ID POLYMORPHICALLY. Pure virtual
   195      * override. This method is to implement a simple version of RTTI, since not all C++
   196      * compilers support genuine RTTI. Polymorphic operator==() and clone() methods call
   197      * this method.
   198      *
   199      * @return   The class ID for this object. All objects of a given class have the
   200      *           same class ID. Objects of other classes have different class IDs.
   201      * @internal
   202      */
   203     virtual UClassID getDynamicClassID(void) const;
   205     /**
   206      * Return the class ID for this class. This is useful only for comparing to a return
   207      * value from getDynamicClassID(). For example:
   208      *
   209      *      Base* polymorphic_pointer = createPolymorphicObject();
   210      *      if (polymorphic_pointer->getDynamicClassID() ==
   211      *          Derived::getStaticClassID()) ...
   212      *
   213      * @return   The class ID for all objects of this class.
   214      * @internal
   215      */
   216     U_I18N_API static UClassID U_EXPORT2 getStaticClassID(void);  
   218 #if 0
   219     // We do not want to introduce this API in ICU4C.
   220     // It was accidentally introduced in ICU4J as a public API.
   221 public:
   222     //-------------------------------------------------------------------------
   223     // Calendar system Conversion methods...
   224     //-------------------------------------------------------------------------
   225     /**
   226      * Convert an Coptic year, month, and day to a Julian day.
   227      *
   228      * @param year the extended year
   229      * @param month the month
   230      * @param day the day
   231      * @return Julian day
   232      * @internal
   233      */
   234     static int32_t copticToJD(int32_t year, int32_t month, int32_t day);
   235 #endif
   236 };
   238 U_NAMESPACE_END
   240 #endif /* #if !UCONFIG_NO_FORMATTING */
   241 #endif /* COPTCCAL_H */
   242 //eof

mercurial