]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/unicode/ureldatefmt.h
ICU-59180.0.1.tar.gz
[apple/icu.git] / icuSources / i18n / unicode / ureldatefmt.h
index e3849d6e445ef8a280c88de719efbf7baebd8132..5c85e9e1ef4e800ccca2f334afc6e803544cbe62 100644 (file)
@@ -1,3 +1,5 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 *****************************************************************************************
 * Copyright (C) 2016, International Business Machines
@@ -32,7 +34,7 @@
  * for determining which unit to use, such as deciding between "in 7 days"
  * and "in 1 week".
  *
- * @draft ICU 57
+ * @stable ICU 57
  */
 
 /**
@@ -58,126 +60,126 @@ typedef enum UDateRelativeDateTimeFormatterStyle {
    */
   UDAT_STYLE_NARROW,
 
-  /**
-   * The number of styles.
-   * @stable ICU 54
-   */
-  UDAT_STYLE_COUNT
+#ifndef U_HIDE_DEPRECATED_API
+    /**
+     * One more than the highest normal UDateRelativeDateTimeFormatterStyle value.
+     * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
+     */
+    UDAT_STYLE_COUNT
+#endif  /* U_HIDE_DEPRECATED_API */
 } UDateRelativeDateTimeFormatterStyle;
 
-#ifndef U_HIDE_DRAFT_API
 /**
  * Represents the unit for formatting a relative date. e.g "in 5 days"
  * or "next year"
- * @draft ICU 57
+ * @stable ICU 57
  */
 typedef enum URelativeDateTimeUnit {
     /**
      * Specifies that relative unit is year, e.g. "last year",
      * "in 5 years". 
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_YEAR,
     /**
      * Specifies that relative unit is quarter, e.g. "last quarter",
      * "in 5 quarters".
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_QUARTER,
     /**
      * Specifies that relative unit is month, e.g. "last month",
      * "in 5 months".
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_MONTH,
     /**
      * Specifies that relative unit is week, e.g. "last week",
      * "in 5 weeks".
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_WEEK,
     /**
      * Specifies that relative unit is day, e.g. "yesterday",
      * "in 5 days".
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_DAY,
     /**
      * Specifies that relative unit is hour, e.g. "1 hour ago",
      * "in 5 hours".
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_HOUR,
     /**
      * Specifies that relative unit is minute, e.g. "1 minute ago",
      * "in 5 minutes".
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_MINUTE,
     /**
      * Specifies that relative unit is second, e.g. "1 second ago",
      * "in 5 seconds".
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_SECOND,
     /**
      * Specifies that relative unit is Sunday, e.g. "last Sunday",
      * "this Sunday", "next Sunday", "in 5 Sundays".
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_SUNDAY,
     /**
      * Specifies that relative unit is Monday, e.g. "last Monday",
      * "this Monday", "next Monday", "in 5 Mondays".
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_MONDAY,
     /**
      * Specifies that relative unit is Tuesday, e.g. "last Tuesday",
      * "this Tuesday", "next Tuesday", "in 5 Tuesdays".
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_TUESDAY,
     /**
      * Specifies that relative unit is Wednesday, e.g. "last Wednesday",
      * "this Wednesday", "next Wednesday", "in 5 Wednesdays".
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_WEDNESDAY,
     /**
      * Specifies that relative unit is Thursday, e.g. "last Thursday",
      * "this Thursday", "next Thursday", "in 5 Thursdays". 
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_THURSDAY,
     /**
      * Specifies that relative unit is Friday, e.g. "last Friday",
      * "this Friday", "next Friday", "in 5 Fridays".
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_FRIDAY,
     /**
      * Specifies that relative unit is Saturday, e.g. "last Saturday",
      * "this Saturday", "next Saturday", "in 5 Saturdays".
-     * @draft ICU 57
+     * @stable ICU 57
      */
     UDAT_REL_UNIT_SATURDAY,
+#ifndef U_HIDE_DEPRECATED_API
     /**
-     * Count of URelativeDateTimeUnit values    
-     * @draft ICU 57
+     * One more than the highest normal URelativeDateTimeUnit value.
+     * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
      */
     UDAT_REL_UNIT_COUNT
+#endif  /* U_HIDE_DEPRECATED_API */
 } URelativeDateTimeUnit;
-#endif  /* U_HIDE_DRAFT_API */
-
-#ifndef U_HIDE_DRAFT_API
 
 /**
  * Opaque URelativeDateTimeFormatter object for use in C programs.
- * @draft ICU 57
+ * @stable ICU 57
  */
 struct URelativeDateTimeFormatter;
-typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter;  /**< C typedef for struct URelativeDateTimeFormatter. @draft ICU 57 */
+typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter;  /**< C typedef for struct URelativeDateTimeFormatter. @stable ICU 57 */
 
 
 /**
@@ -210,9 +212,9 @@ typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter;  /**< C ty
  * @return
  *          A pointer to a URelativeDateTimeFormatter object for the specified locale,
  *          or NULL if an error occurred.
- * @draft ICU 57
+ * @stable ICU 57
  */
-U_DRAFT URelativeDateTimeFormatter* U_EXPORT2
+U_STABLE URelativeDateTimeFormatter* U_EXPORT2
 ureldatefmt_open( const char*          locale,
                   UNumberFormat*       nfToAdopt,
                   UDateRelativeDateTimeFormatterStyle width,
@@ -223,9 +225,9 @@ ureldatefmt_open( const char*          locale,
  * Close a URelativeDateTimeFormatter object. Once closed it may no longer be used.
  * @param reldatefmt
  *            The URelativeDateTimeFormatter object to close.
- * @draft ICU 57
+ * @stable ICU 57
  */
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
 ureldatefmt_close(URelativeDateTimeFormatter *reldatefmt);
 
 #if U_SHOW_CPLUSPLUS_API
@@ -239,13 +241,13 @@ U_NAMESPACE_BEGIN
  *
  * @see LocalPointerBase
  * @see LocalPointer
- * @draft ICU 57
+ * @stable ICU 57
  */
 U_DEFINE_LOCAL_OPEN_POINTER(LocalURelativeDateTimeFormatterPointer, URelativeDateTimeFormatter, ureldatefmt_close);
 
 U_NAMESPACE_END
 
-#endif
+#endif // U_SHOW_CPLUSPLUS_API
 
 /**
  * Format a combination of URelativeDateTimeUnit and numeric
@@ -273,9 +275,9 @@ U_NAMESPACE_END
  * @return
  *          The length of the formatted result; may be greater
  *          than resultCapacity, in which case an error is returned.
- * @draft ICU 57
+ * @stable ICU 57
  */
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
 ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt,
                     double                offset,
                     URelativeDateTimeUnit unit,
@@ -309,9 +311,9 @@ ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt,
  * @return
  *          The length of the formatted result; may be greater
  *          than resultCapacity, in which case an error is returned.
- * @draft ICU 57
+ * @stable ICU 57
  */
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
 ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt,
                     double                offset,
                     URelativeDateTimeUnit unit,
@@ -346,9 +348,9 @@ ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt,
  * @return
  *          The length of the formatted result; may be greater than resultCapacity,
  *          in which case an error is returned.
- * @draft ICU 57
+ * @stable ICU 57
  */
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
 ureldatefmt_combineDateAndTime( const URelativeDateTimeFormatter* reldatefmt,
                     const UChar *     relativeDateString,
                     int32_t           relativeDateStringLen,
@@ -358,8 +360,6 @@ ureldatefmt_combineDateAndTime( const URelativeDateTimeFormatter* reldatefmt,
                     int32_t           resultCapacity,
                     UErrorCode*       status );
 
-#endif  /* U_HIDE_DRAFT_API */
-
 #endif /* !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION */
 
 #endif