00001
00002
00003
00004 #ifndef __UFORMATTEDVALUE_H__
00005 #define __UFORMATTEDVALUE_H__
00006
00007 #include "unicode/utypes.h"
00008
00009 #if !UCONFIG_NO_FORMATTING
00010
00011 #include "unicode/ufieldpositer.h"
00012
00034 typedef enum UFieldCategory {
00040 UFIELD_CATEGORY_UNDEFINED = 0,
00041
00047 UFIELD_CATEGORY_DATE,
00048
00054 UFIELD_CATEGORY_NUMBER,
00055
00061 UFIELD_CATEGORY_LIST,
00062
00068 UFIELD_CATEGORY_RELATIVE_DATETIME,
00069
00075 UFIELD_CATEGORY_DATE_INTERVAL,
00076
00077 #ifndef U_HIDE_INTERNAL_API
00078
00079 UFIELD_CATEGORY_COUNT,
00080 #endif
00081
00087 UFIELD_CATEGORY_LIST_SPAN = 0x1000 + UFIELD_CATEGORY_LIST,
00088
00094 UFIELD_CATEGORY_DATE_INTERVAL_SPAN = 0x1000 + UFIELD_CATEGORY_DATE_INTERVAL,
00095
00096 #ifndef U_HIDE_DRAFT_API
00097
00102 UFIELD_CATEGORY_NUMBER_RANGE_SPAN = 0x1000 + UFIELD_CATEGORY_NUMBER,
00103 #endif // U_HIDE_DRAFT_API
00104
00105 } UFieldCategory;
00106
00107
00108 struct UConstrainedFieldPosition;
00120 typedef struct UConstrainedFieldPosition UConstrainedFieldPosition;
00121
00122
00132 U_CAPI UConstrainedFieldPosition* U_EXPORT2
00133 ucfpos_open(UErrorCode* ec);
00134
00135
00145 U_CAPI void U_EXPORT2
00146 ucfpos_reset(
00147 UConstrainedFieldPosition* ucfpos,
00148 UErrorCode* ec);
00149
00150
00157 U_CAPI void U_EXPORT2
00158 ucfpos_close(UConstrainedFieldPosition* ucfpos);
00159
00160
00186 U_CAPI void U_EXPORT2
00187 ucfpos_constrainCategory(
00188 UConstrainedFieldPosition* ucfpos,
00189 int32_t category,
00190 UErrorCode* ec);
00191
00192
00219 U_CAPI void U_EXPORT2
00220 ucfpos_constrainField(
00221 UConstrainedFieldPosition* ucfpos,
00222 int32_t category,
00223 int32_t field,
00224 UErrorCode* ec);
00225
00226
00239 U_CAPI int32_t U_EXPORT2
00240 ucfpos_getCategory(
00241 const UConstrainedFieldPosition* ucfpos,
00242 UErrorCode* ec);
00243
00244
00257 U_CAPI int32_t U_EXPORT2
00258 ucfpos_getField(
00259 const UConstrainedFieldPosition* ucfpos,
00260 UErrorCode* ec);
00261
00262
00274 U_CAPI void U_EXPORT2
00275 ucfpos_getIndexes(
00276 const UConstrainedFieldPosition* ucfpos,
00277 int32_t* pStart,
00278 int32_t* pLimit,
00279 UErrorCode* ec);
00280
00281
00294 U_CAPI int64_t U_EXPORT2
00295 ucfpos_getInt64IterationContext(
00296 const UConstrainedFieldPosition* ucfpos,
00297 UErrorCode* ec);
00298
00299
00310 U_CAPI void U_EXPORT2
00311 ucfpos_setInt64IterationContext(
00312 UConstrainedFieldPosition* ucfpos,
00313 int64_t context,
00314 UErrorCode* ec);
00315
00316
00329 U_CAPI UBool U_EXPORT2
00330 ucfpos_matchesField(
00331 const UConstrainedFieldPosition* ucfpos,
00332 int32_t category,
00333 int32_t field,
00334 UErrorCode* ec);
00335
00336
00353 U_CAPI void U_EXPORT2
00354 ucfpos_setState(
00355 UConstrainedFieldPosition* ucfpos,
00356 int32_t category,
00357 int32_t field,
00358 int32_t start,
00359 int32_t limit,
00360 UErrorCode* ec);
00361
00362
00363 struct UFormattedValue;
00370 typedef struct UFormattedValue UFormattedValue;
00371
00372
00386 U_CAPI const UChar* U_EXPORT2
00387 ufmtval_getString(
00388 const UFormattedValue* ufmtval,
00389 int32_t* pLength,
00390 UErrorCode* ec);
00391
00392
00416 U_CAPI UBool U_EXPORT2
00417 ufmtval_nextPosition(
00418 const UFormattedValue* ufmtval,
00419 UConstrainedFieldPosition* ucfpos,
00420 UErrorCode* ec);
00421
00422
00423 #if U_SHOW_CPLUSPLUS_API
00424 U_NAMESPACE_BEGIN
00425
00438 U_DEFINE_LOCAL_OPEN_POINTER(LocalUConstrainedFieldPositionPointer,
00439 UConstrainedFieldPosition,
00440 ucfpos_close);
00441
00442 U_NAMESPACE_END
00443 #endif // U_SHOW_CPLUSPLUS_API
00444
00445
00446 #endif
00447 #endif // __UFORMATTEDVALUE_H__