00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef URELDATEFMT_H
00011 #define URELDATEFMT_H
00012
00013 #include "unicode/utypes.h"
00014
00015 #if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
00016
00017 #include "unicode/unum.h"
00018 #include "unicode/udisplaycontext.h"
00019 #include "unicode/localpointer.h"
00020
00044 typedef enum UDateRelativeDateTimeFormatterStyle {
00049 UDAT_STYLE_LONG,
00050
00055 UDAT_STYLE_SHORT,
00056
00061 UDAT_STYLE_NARROW,
00062
00063 #ifndef U_HIDE_DEPRECATED_API
00064
00068 UDAT_STYLE_COUNT
00069 #endif
00070 } UDateRelativeDateTimeFormatterStyle;
00071
00077 typedef enum URelativeDateTimeUnit {
00083 UDAT_REL_UNIT_YEAR,
00089 UDAT_REL_UNIT_QUARTER,
00095 UDAT_REL_UNIT_MONTH,
00101 UDAT_REL_UNIT_WEEK,
00107 UDAT_REL_UNIT_DAY,
00113 UDAT_REL_UNIT_HOUR,
00119 UDAT_REL_UNIT_MINUTE,
00125 UDAT_REL_UNIT_SECOND,
00131 UDAT_REL_UNIT_SUNDAY,
00137 UDAT_REL_UNIT_MONDAY,
00143 UDAT_REL_UNIT_TUESDAY,
00149 UDAT_REL_UNIT_WEDNESDAY,
00155 UDAT_REL_UNIT_THURSDAY,
00161 UDAT_REL_UNIT_FRIDAY,
00167 UDAT_REL_UNIT_SATURDAY,
00168 #ifndef U_HIDE_DEPRECATED_API
00169
00173 UDAT_REL_UNIT_COUNT
00174 #endif
00175 } URelativeDateTimeUnit;
00176
00181 struct URelativeDateTimeFormatter;
00182 typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter;
00217 U_STABLE URelativeDateTimeFormatter* U_EXPORT2
00218 ureldatefmt_open( const char* locale,
00219 UNumberFormat* nfToAdopt,
00220 UDateRelativeDateTimeFormatterStyle width,
00221 UDisplayContext capitalizationContext,
00222 UErrorCode* status );
00223
00230 U_STABLE void U_EXPORT2
00231 ureldatefmt_close(URelativeDateTimeFormatter *reldatefmt);
00232
00233 #if U_SHOW_CPLUSPLUS_API
00234
00235 U_NAMESPACE_BEGIN
00236
00246 U_DEFINE_LOCAL_OPEN_POINTER(LocalURelativeDateTimeFormatterPointer, URelativeDateTimeFormatter, ureldatefmt_close);
00247
00248 U_NAMESPACE_END
00249
00250 #endif
00251
00280 U_STABLE int32_t U_EXPORT2
00281 ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt,
00282 double offset,
00283 URelativeDateTimeUnit unit,
00284 UChar* result,
00285 int32_t resultCapacity,
00286 UErrorCode* status);
00287
00316 U_STABLE int32_t U_EXPORT2
00317 ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt,
00318 double offset,
00319 URelativeDateTimeUnit unit,
00320 UChar* result,
00321 int32_t resultCapacity,
00322 UErrorCode* status);
00323
00353 U_STABLE int32_t U_EXPORT2
00354 ureldatefmt_combineDateAndTime( const URelativeDateTimeFormatter* reldatefmt,
00355 const UChar * relativeDateString,
00356 int32_t relativeDateStringLen,
00357 const UChar * timeString,
00358 int32_t timeStringLen,
00359 UChar* result,
00360 int32_t resultCapacity,
00361 UErrorCode* status );
00362
00363 #endif
00364
00365 #endif