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
00101 UFIELD_CATEGORY_NUMBER_RANGE_SPAN = 0x1000 + UFIELD_CATEGORY_NUMBER,
00102
00103 } UFieldCategory;
00104
00105
00106 struct UConstrainedFieldPosition;
00118 typedef struct UConstrainedFieldPosition UConstrainedFieldPosition;
00119
00120
00130 U_CAPI UConstrainedFieldPosition* U_EXPORT2
00131 ucfpos_open(UErrorCode* ec);
00132
00133
00143 U_CAPI void U_EXPORT2
00144 ucfpos_reset(
00145 UConstrainedFieldPosition* ucfpos,
00146 UErrorCode* ec);
00147
00148
00155 U_CAPI void U_EXPORT2
00156 ucfpos_close(UConstrainedFieldPosition* ucfpos);
00157
00158
00184 U_CAPI void U_EXPORT2
00185 ucfpos_constrainCategory(
00186 UConstrainedFieldPosition* ucfpos,
00187 int32_t category,
00188 UErrorCode* ec);
00189
00190
00217 U_CAPI void U_EXPORT2
00218 ucfpos_constrainField(
00219 UConstrainedFieldPosition* ucfpos,
00220 int32_t category,
00221 int32_t field,
00222 UErrorCode* ec);
00223
00224
00237 U_CAPI int32_t U_EXPORT2
00238 ucfpos_getCategory(
00239 const UConstrainedFieldPosition* ucfpos,
00240 UErrorCode* ec);
00241
00242
00255 U_CAPI int32_t U_EXPORT2
00256 ucfpos_getField(
00257 const UConstrainedFieldPosition* ucfpos,
00258 UErrorCode* ec);
00259
00260
00272 U_CAPI void U_EXPORT2
00273 ucfpos_getIndexes(
00274 const UConstrainedFieldPosition* ucfpos,
00275 int32_t* pStart,
00276 int32_t* pLimit,
00277 UErrorCode* ec);
00278
00279
00292 U_CAPI int64_t U_EXPORT2
00293 ucfpos_getInt64IterationContext(
00294 const UConstrainedFieldPosition* ucfpos,
00295 UErrorCode* ec);
00296
00297
00308 U_CAPI void U_EXPORT2
00309 ucfpos_setInt64IterationContext(
00310 UConstrainedFieldPosition* ucfpos,
00311 int64_t context,
00312 UErrorCode* ec);
00313
00314
00327 U_CAPI UBool U_EXPORT2
00328 ucfpos_matchesField(
00329 const UConstrainedFieldPosition* ucfpos,
00330 int32_t category,
00331 int32_t field,
00332 UErrorCode* ec);
00333
00334
00351 U_CAPI void U_EXPORT2
00352 ucfpos_setState(
00353 UConstrainedFieldPosition* ucfpos,
00354 int32_t category,
00355 int32_t field,
00356 int32_t start,
00357 int32_t limit,
00358 UErrorCode* ec);
00359
00360
00361 struct UFormattedValue;
00368 typedef struct UFormattedValue UFormattedValue;
00369
00370
00384 U_CAPI const UChar* U_EXPORT2
00385 ufmtval_getString(
00386 const UFormattedValue* ufmtval,
00387 int32_t* pLength,
00388 UErrorCode* ec);
00389
00390
00414 U_CAPI UBool U_EXPORT2
00415 ufmtval_nextPosition(
00416 const UFormattedValue* ufmtval,
00417 UConstrainedFieldPosition* ucfpos,
00418 UErrorCode* ec);
00419
00420
00421 #if U_SHOW_CPLUSPLUS_API
00422 U_NAMESPACE_BEGIN
00423
00436 U_DEFINE_LOCAL_OPEN_POINTER(LocalUConstrainedFieldPositionPointer,
00437 UConstrainedFieldPosition,
00438 ucfpos_close);
00439
00440 U_NAMESPACE_END
00441 #endif // U_SHOW_CPLUSPLUS_API
00442
00443
00444 #endif
00445 #endif // __UFORMATTEDVALUE_H__