udatpg.h

Go to the documentation of this file.
00001 /*
00002 *******************************************************************************
00003 *
00004 *   Copyright (C) 2007-2009, 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 
00052 typedef enum UDateTimePatternField {
00054     UDATPG_ERA_FIELD,
00056     UDATPG_YEAR_FIELD,
00058     UDATPG_QUARTER_FIELD,
00060     UDATPG_MONTH_FIELD,
00062     UDATPG_WEEK_OF_YEAR_FIELD,
00064     UDATPG_WEEK_OF_MONTH_FIELD,
00066     UDATPG_WEEKDAY_FIELD,
00068     UDATPG_DAY_OF_YEAR_FIELD,
00070     UDATPG_DAY_OF_WEEK_IN_MONTH_FIELD,
00072     UDATPG_DAY_FIELD,
00074     UDATPG_DAYPERIOD_FIELD,
00076     UDATPG_HOUR_FIELD,
00078     UDATPG_MINUTE_FIELD,
00080     UDATPG_SECOND_FIELD,
00082     UDATPG_FRACTIONAL_SECOND_FIELD,
00084     UDATPG_ZONE_FIELD,
00086     UDATPG_FIELD_COUNT
00087 } UDateTimePatternField;
00088 
00093 typedef enum UDateTimePatternConflict {
00095     UDATPG_NO_CONFLICT,
00097     UDATPG_BASE_CONFLICT,
00099     UDATPG_CONFLICT,
00101     UDATPG_CONFLICT_COUNT
00102 } UDateTimePatternConflict;
00103 
00112 U_DRAFT UDateTimePatternGenerator * U_EXPORT2
00113 udatpg_open(const char *locale, UErrorCode *pErrorCode);
00114 
00122 U_DRAFT UDateTimePatternGenerator * U_EXPORT2
00123 udatpg_openEmpty(UErrorCode *pErrorCode);
00124 
00130 U_DRAFT void U_EXPORT2
00131 udatpg_close(UDateTimePatternGenerator *dtpg);
00132 
00141 U_DRAFT UDateTimePatternGenerator * U_EXPORT2
00142 udatpg_clone(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode);
00143 
00167 U_DRAFT int32_t U_EXPORT2
00168 udatpg_getBestPattern(UDateTimePatternGenerator *dtpg,
00169                       const UChar *skeleton, int32_t length,
00170                       UChar *bestPattern, int32_t capacity,
00171                       UErrorCode *pErrorCode);
00172 
00193 U_DRAFT int32_t U_EXPORT2
00194 udatpg_getSkeleton(UDateTimePatternGenerator *dtpg,
00195                    const UChar *pattern, int32_t length,
00196                    UChar *skeleton, int32_t capacity,
00197                    UErrorCode *pErrorCode);
00198 
00222 U_DRAFT int32_t U_EXPORT2
00223 udatpg_getBaseSkeleton(UDateTimePatternGenerator *dtpg,
00224                        const UChar *pattern, int32_t length,
00225                        UChar *baseSkeleton, int32_t capacity,
00226                        UErrorCode *pErrorCode);
00227 
00252 U_DRAFT UDateTimePatternConflict U_EXPORT2
00253 udatpg_addPattern(UDateTimePatternGenerator *dtpg,
00254                   const UChar *pattern, int32_t patternLength,
00255                   UBool override,
00256                   UChar *conflictingPattern, int32_t capacity, int32_t *pLength,
00257                   UErrorCode *pErrorCode);
00258 
00279 U_DRAFT void U_EXPORT2
00280 udatpg_setAppendItemFormat(UDateTimePatternGenerator *dtpg,
00281                            UDateTimePatternField field,
00282                            const UChar *value, int32_t length);
00283 
00294 U_DRAFT const UChar * U_EXPORT2
00295 udatpg_getAppendItemFormat(const UDateTimePatternGenerator *dtpg,
00296                            UDateTimePatternField field,
00297                            int32_t *pLength);
00298 
00312 U_DRAFT void U_EXPORT2
00313 udatpg_setAppendItemName(UDateTimePatternGenerator *dtpg,
00314                          UDateTimePatternField field,
00315                          const UChar *value, int32_t length);
00316 
00327 U_DRAFT const UChar * U_EXPORT2
00328 udatpg_getAppendItemName(const UDateTimePatternGenerator *dtpg,
00329                          UDateTimePatternField field,
00330                          int32_t *pLength);
00331 
00353 U_DRAFT void U_EXPORT2
00354 udatpg_setDateTimeFormat(const UDateTimePatternGenerator *dtpg,
00355                          const UChar *dtFormat, int32_t length);
00356 
00364 U_DRAFT const UChar * U_EXPORT2
00365 udatpg_getDateTimeFormat(const UDateTimePatternGenerator *dtpg,
00366                          int32_t *pLength);
00367 
00381 U_DRAFT void U_EXPORT2
00382 udatpg_setDecimal(UDateTimePatternGenerator *dtpg,
00383                   const UChar *decimal, int32_t length);
00384 
00393 U_DRAFT const UChar * U_EXPORT2
00394 udatpg_getDecimal(const UDateTimePatternGenerator *dtpg,
00395                   int32_t *pLength);
00396 
00422 U_DRAFT int32_t U_EXPORT2
00423 udatpg_replaceFieldTypes(UDateTimePatternGenerator *dtpg,
00424                          const UChar *pattern, int32_t patternLength,
00425                          const UChar *skeleton, int32_t skeletonLength,
00426                          UChar *dest, int32_t destCapacity,
00427                          UErrorCode *pErrorCode);
00428 
00440 U_DRAFT UEnumeration * U_EXPORT2
00441 udatpg_openSkeletons(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode);
00442 
00453 U_DRAFT UEnumeration * U_EXPORT2
00454 udatpg_openBaseSkeletons(const UDateTimePatternGenerator *dtpg, UErrorCode *pErrorCode);
00455 
00466 U_DRAFT const UChar * U_EXPORT2
00467 udatpg_getPatternForSkeleton(const UDateTimePatternGenerator *dtpg,
00468                              const UChar *skeleton, int32_t skeletonLength,
00469                              int32_t *pLength);
00470 
00471 #endif

Generated on 20 Mar 2013 for ICU 4.2.1 by  doxygen 1.4.7