udatpg.h

Go to the documentation of this file.
00001 /*
00002 *******************************************************************************
00003 *
00004 *   Copyright (C) 2007-2008, International Business Machines
00005 *   Corporation and others.  All Rights Reserved.
00006 *
00007 *******************************************************************************
00008 *   file name:  udatpg.h
00009 *   encoding:   US-ASCII
00010 *   tab size:   8 (not used)
00011 *   indentation:4
00012 *
00013 *   created on: 2007jul30
00014 *   created by: Markus W. Scherer
00015 */
00016 
00017 #ifndef __UDATPG_H__
00018 #define __UDATPG_H__
00019 
00020 #include "unicode/utypes.h"
00021 #include "unicode/uenum.h"
00022 
00044 typedef void *UDateTimePatternGenerator;
00045 
00046 #ifndef U_HIDE_DRAFT_API
00047 
00054 typedef enum UDateTimePatternField {
00056     UDATPG_ERA_FIELD,
00058     UDATPG_YEAR_FIELD,
00060     UDATPG_QUARTER_FIELD,
00062     UDATPG_MONTH_FIELD,
00064     UDATPG_WEEK_OF_YEAR_FIELD,
00066     UDATPG_WEEK_OF_MONTH_FIELD,
00068     UDATPG_WEEKDAY_FIELD,
00070     UDATPG_DAY_OF_YEAR_FIELD,
00072     UDATPG_DAY_OF_WEEK_IN_MONTH_FIELD,
00074     UDATPG_DAY_FIELD,
00076     UDATPG_DAYPERIOD_FIELD,
00078     UDATPG_HOUR_FIELD,
00080     UDATPG_MINUTE_FIELD,
00082     UDATPG_SECOND_FIELD,
00084     UDATPG_FRACTIONAL_SECOND_FIELD,
00086     UDATPG_ZONE_FIELD,
00088     UDATPG_FIELD_COUNT
00089 } UDateTimePatternField;
00090 
00095 typedef enum UDateTimePatternConflict {
00097     UDATPG_NO_CONFLICT,
00099     UDATPG_BASE_CONFLICT,
00101     UDATPG_CONFLICT,
00103     UDATPG_CONFLICT_COUNT
00104 } UDateTimePatternConflict;
00105 
00106 #endif
00107 
00116 U_DRAFT UDateTimePatternGenerator * U_EXPORT2
00117 udatpg_open(const char *locale, UErrorCode *pErrorCode);
00118 
00126 U_DRAFT UDateTimePatternGenerator * U_EXPORT2
00127 udatpg_openEmpty(UErrorCode *pErrorCode);
00128 
00134 U_DRAFT void U_EXPORT2
00135 udatpg_close(UDateTimePatternGenerator *dtpg);
00136 
00145 U_DRAFT UDateTimePatternGenerator * U_EXPORT2
00146 udatpg_clone(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode);
00147 
00171 U_DRAFT int32_t U_EXPORT2
00172 udatpg_getBestPattern(UDateTimePatternGenerator *dtpg,
00173                       const UChar *skeleton, int32_t length,
00174                       UChar *bestPattern, int32_t capacity,
00175                       UErrorCode *pErrorCode);
00176 
00197 U_DRAFT int32_t U_EXPORT2
00198 udatpg_getSkeleton(UDateTimePatternGenerator *dtpg,
00199                    const UChar *pattern, int32_t length,
00200                    UChar *skeleton, int32_t capacity,
00201                    UErrorCode *pErrorCode);
00202 
00226 U_DRAFT int32_t U_EXPORT2
00227 udatpg_getBaseSkeleton(UDateTimePatternGenerator *dtpg,
00228                        const UChar *pattern, int32_t length,
00229                        UChar *baseSkeleton, int32_t capacity,
00230                        UErrorCode *pErrorCode);
00231 
00256 U_DRAFT UDateTimePatternConflict U_EXPORT2
00257 udatpg_addPattern(UDateTimePatternGenerator *dtpg,
00258                   const UChar *pattern, int32_t patternLength,
00259                   UBool override,
00260                   UChar *conflictingPattern, int32_t capacity, int32_t *pLength,
00261                   UErrorCode *pErrorCode);
00262 
00283 U_DRAFT void U_EXPORT2
00284 udatpg_setAppendItemFormat(UDateTimePatternGenerator *dtpg,
00285                            UDateTimePatternField field,
00286                            const UChar *value, int32_t length);
00287 
00298 U_DRAFT const UChar * U_EXPORT2
00299 udatpg_getAppendItemFormat(const UDateTimePatternGenerator *dtpg,
00300                            UDateTimePatternField field,
00301                            int32_t *pLength);
00302 
00316 U_DRAFT void U_EXPORT2
00317 udatpg_setAppendItemName(UDateTimePatternGenerator *dtpg,
00318                          UDateTimePatternField field,
00319                          const UChar *value, int32_t length);
00320 
00331 U_DRAFT const UChar * U_EXPORT2
00332 udatpg_getAppendItemName(const UDateTimePatternGenerator *dtpg,
00333                          UDateTimePatternField field,
00334                          int32_t *pLength);
00335 
00357 U_DRAFT void U_EXPORT2
00358 udatpg_setDateTimeFormat(const UDateTimePatternGenerator *dtpg,
00359                          const UChar *dtFormat, int32_t length);
00360 
00368 U_DRAFT const UChar * U_EXPORT2
00369 udatpg_getDateTimeFormat(const UDateTimePatternGenerator *dtpg,
00370                          int32_t *pLength);
00371 
00385 U_DRAFT void U_EXPORT2
00386 udatpg_setDecimal(UDateTimePatternGenerator *dtpg,
00387                   const UChar *decimal, int32_t length);
00388 
00397 U_DRAFT const UChar * U_EXPORT2
00398 udatpg_getDecimal(const UDateTimePatternGenerator *dtpg,
00399                   int32_t *pLength);
00400 
00426 U_DRAFT int32_t U_EXPORT2
00427 udatpg_replaceFieldTypes(UDateTimePatternGenerator *dtpg,
00428                          const UChar *pattern, int32_t patternLength,
00429                          const UChar *skeleton, int32_t skeletonLength,
00430                          UChar *dest, int32_t destCapacity,
00431                          UErrorCode *pErrorCode);
00432 
00444 U_DRAFT UEnumeration * U_EXPORT2
00445 udatpg_openSkeletons(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode);
00446 
00457 U_DRAFT UEnumeration * U_EXPORT2
00458 udatpg_openBaseSkeletons(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode);
00459 
00470 U_DRAFT const UChar * U_EXPORT2
00471 udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg,
00472                              const UChar *skeleton, int32_t skeletonLength,
00473                              int32_t *pLength);
00474 
00475 #endif

Generated on 17 Sep 2013 for ICU 4.0.1 by  doxygen 1.4.7