00001
00002
00003
00004
00005
00006
00007
00008 #ifndef URELDATEFMT_H
00009 #define URELDATEFMT_H
00010
00011 #include "unicode/utypes.h"
00012
00013 #if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
00014
00015 #include "unicode/unum.h"
00016 #include "unicode/udisplaycontext.h"
00017 #include "unicode/localpointer.h"
00018
00042 typedef enum UDateRelativeDateTimeFormatterStyle {
00047 UDAT_STYLE_LONG,
00048
00053 UDAT_STYLE_SHORT,
00054
00059 UDAT_STYLE_NARROW,
00060
00065 UDAT_STYLE_COUNT
00066 } UDateRelativeDateTimeFormatterStyle;
00067
00068 #ifndef U_HIDE_DRAFT_API
00069
00074 typedef enum URelativeDateTimeUnit {
00080 UDAT_REL_UNIT_YEAR,
00086 UDAT_REL_UNIT_QUARTER,
00092 UDAT_REL_UNIT_MONTH,
00098 UDAT_REL_UNIT_WEEK,
00104 UDAT_REL_UNIT_DAY,
00110 UDAT_REL_UNIT_HOUR,
00116 UDAT_REL_UNIT_MINUTE,
00122 UDAT_REL_UNIT_SECOND,
00128 UDAT_REL_UNIT_SUNDAY,
00134 UDAT_REL_UNIT_MONDAY,
00140 UDAT_REL_UNIT_TUESDAY,
00146 UDAT_REL_UNIT_WEDNESDAY,
00152 UDAT_REL_UNIT_THURSDAY,
00158 UDAT_REL_UNIT_FRIDAY,
00164 UDAT_REL_UNIT_SATURDAY,
00169 UDAT_REL_UNIT_COUNT
00170 } URelativeDateTimeUnit;
00171 #endif
00172
00173 #ifndef U_HIDE_DRAFT_API
00174
00179 struct URelativeDateTimeFormatter;
00180 typedef struct URelativeDateTimeFormatter URelativeDateTimeFormatter;
00215 U_DRAFT URelativeDateTimeFormatter* U_EXPORT2
00216 ureldatefmt_open( const char* locale,
00217 UNumberFormat* nfToAdopt,
00218 UDateRelativeDateTimeFormatterStyle width,
00219 UDisplayContext capitalizationContext,
00220 UErrorCode* status );
00221
00228 U_DRAFT void U_EXPORT2
00229 ureldatefmt_close(URelativeDateTimeFormatter *reldatefmt);
00230
00231 #if U_SHOW_CPLUSPLUS_API
00232
00233 U_NAMESPACE_BEGIN
00234
00244 U_DEFINE_LOCAL_OPEN_POINTER(LocalURelativeDateTimeFormatterPointer, URelativeDateTimeFormatter, ureldatefmt_close);
00245
00246 U_NAMESPACE_END
00247
00248 #endif
00249
00278 U_DRAFT int32_t U_EXPORT2
00279 ureldatefmt_formatNumeric( const URelativeDateTimeFormatter* reldatefmt,
00280 double offset,
00281 URelativeDateTimeUnit unit,
00282 UChar* result,
00283 int32_t resultCapacity,
00284 UErrorCode* status);
00285
00314 U_DRAFT int32_t U_EXPORT2
00315 ureldatefmt_format( const URelativeDateTimeFormatter* reldatefmt,
00316 double offset,
00317 URelativeDateTimeUnit unit,
00318 UChar* result,
00319 int32_t resultCapacity,
00320 UErrorCode* status);
00321
00351 U_DRAFT int32_t U_EXPORT2
00352 ureldatefmt_combineDateAndTime( const URelativeDateTimeFormatter* reldatefmt,
00353 const UChar * relativeDateString,
00354 int32_t relativeDateStringLen,
00355 const UChar * timeString,
00356 int32_t timeStringLen,
00357 UChar* result,
00358 int32_t resultCapacity,
00359 UErrorCode* status );
00360
00361 #endif
00362
00363 #endif
00364
00365 #endif