ICU 4.8.1.1  4.8.1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ubidi.h
Go to the documentation of this file.
1 /*
2 ******************************************************************************
3 *
4 * Copyright (C) 1999-2011, International Business Machines
5 * Corporation and others. All Rights Reserved.
6 *
7 ******************************************************************************
8 * file name: ubidi.h
9 * encoding: US-ASCII
10 * tab size: 8 (not used)
11 * indentation:4
12 *
13 * created on: 1999jul27
14 * created by: Markus W. Scherer, updated by Matitiahu Allouche
15 */
16 
17 #ifndef UBIDI_H
18 #define UBIDI_H
19 
20 #include "unicode/utypes.h"
21 #include "unicode/uchar.h"
22 #include "unicode/localpointer.h"
23 
287 /*DOCXX_TAG*/
330 typedef uint8_t UBiDiLevel;
331 
356 #define UBIDI_DEFAULT_LTR 0xfe
357 
383 #define UBIDI_DEFAULT_RTL 0xff
384 
390 #define UBIDI_MAX_EXPLICIT_LEVEL 61
391 
396 #define UBIDI_LEVEL_OVERRIDE 0x80
397 
411 #define UBIDI_MAP_NOWHERE (-1)
412 
456 };
457 
460 
471 struct UBiDi;
472 
474 typedef struct UBiDi UBiDi;
475 
492 ubidi_open(void);
493 
529 ubidi_openSized(int32_t maxLength, int32_t maxRunCount, UErrorCode *pErrorCode);
530 
551 U_STABLE void U_EXPORT2
552 ubidi_close(UBiDi *pBiDi);
553 
554 #if U_SHOW_CPLUSPLUS_API
555 
557 
567 U_DEFINE_LOCAL_OPEN_POINTER(LocalUBiDiPointer, UBiDi, ubidi_close);
568 
570 
571 #endif
572 
621 U_STABLE void U_EXPORT2
622 ubidi_setInverse(UBiDi *pBiDi, UBool isInverse);
623 
641 ubidi_isInverse(UBiDi *pBiDi);
642 
663 U_STABLE void U_EXPORT2
664 ubidi_orderParagraphsLTR(UBiDi *pBiDi, UBool orderParagraphsLTR);
665 
679 
687 typedef enum UBiDiReorderingMode {
725 
877 U_STABLE void U_EXPORT2
878 ubidi_setReorderingMode(UBiDi *pBiDi, UBiDiReorderingMode reorderingMode);
879 
890 
898 typedef enum UBiDiReorderingOption {
906 
952 
970 
1019 
1033 U_STABLE void U_EXPORT2
1034 ubidi_setReorderingOptions(UBiDi *pBiDi, uint32_t reorderingOptions);
1035 
1044 U_STABLE uint32_t U_EXPORT2
1046 
1131 U_DRAFT void U_EXPORT2
1132 ubidi_setContext(UBiDi *pBiDi,
1133  const UChar *prologue, int32_t proLength,
1134  const UChar *epilogue, int32_t epiLength,
1135  UErrorCode *pErrorCode);
1136 
1216 U_STABLE void U_EXPORT2
1217 ubidi_setPara(UBiDi *pBiDi, const UChar *text, int32_t length,
1218  UBiDiLevel paraLevel, UBiDiLevel *embeddingLevels,
1219  UErrorCode *pErrorCode);
1220 
1267 U_STABLE void U_EXPORT2
1268 ubidi_setLine(const UBiDi *pParaBiDi,
1269  int32_t start, int32_t limit,
1270  UBiDi *pLineBiDi,
1271  UErrorCode *pErrorCode);
1272 
1289 ubidi_getDirection(const UBiDi *pBiDi);
1290 
1319 ubidi_getBaseDirection(const UChar *text, int32_t length );
1320 
1332 U_STABLE const UChar * U_EXPORT2
1333 ubidi_getText(const UBiDi *pBiDi);
1334 
1343 U_STABLE int32_t U_EXPORT2
1344 ubidi_getLength(const UBiDi *pBiDi);
1345 
1362 ubidi_getParaLevel(const UBiDi *pBiDi);
1363 
1372 U_STABLE int32_t U_EXPORT2
1374 
1409 U_STABLE int32_t U_EXPORT2
1410 ubidi_getParagraph(const UBiDi *pBiDi, int32_t charIndex, int32_t *pParaStart,
1411  int32_t *pParaLimit, UBiDiLevel *pParaLevel,
1412  UErrorCode *pErrorCode);
1413 
1441 U_STABLE void U_EXPORT2
1442 ubidi_getParagraphByIndex(const UBiDi *pBiDi, int32_t paraIndex,
1443  int32_t *pParaStart, int32_t *pParaLimit,
1444  UBiDiLevel *pParaLevel, UErrorCode *pErrorCode);
1445 
1462 ubidi_getLevelAt(const UBiDi *pBiDi, int32_t charIndex);
1463 
1483 ubidi_getLevels(UBiDi *pBiDi, UErrorCode *pErrorCode);
1484 
1509 U_STABLE void U_EXPORT2
1510 ubidi_getLogicalRun(const UBiDi *pBiDi, int32_t logicalPosition,
1511  int32_t *pLogicalLimit, UBiDiLevel *pLevel);
1512 
1528 U_STABLE int32_t U_EXPORT2
1529 ubidi_countRuns(UBiDi *pBiDi, UErrorCode *pErrorCode);
1530 
1588 ubidi_getVisualRun(UBiDi *pBiDi, int32_t runIndex,
1589  int32_t *pLogicalStart, int32_t *pLength);
1590 
1628 U_STABLE int32_t U_EXPORT2
1629 ubidi_getVisualIndex(UBiDi *pBiDi, int32_t logicalIndex, UErrorCode *pErrorCode);
1630 
1663 U_STABLE int32_t U_EXPORT2
1664 ubidi_getLogicalIndex(UBiDi *pBiDi, int32_t visualIndex, UErrorCode *pErrorCode);
1665 
1706 U_STABLE void U_EXPORT2
1707 ubidi_getLogicalMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode);
1708 
1742 U_STABLE void U_EXPORT2
1743 ubidi_getVisualMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode);
1744 
1765 U_STABLE void U_EXPORT2
1766 ubidi_reorderLogical(const UBiDiLevel *levels, int32_t length, int32_t *indexMap);
1767 
1788 U_STABLE void U_EXPORT2
1789 ubidi_reorderVisual(const UBiDiLevel *levels, int32_t length, int32_t *indexMap);
1790 
1823 U_STABLE void U_EXPORT2
1824 ubidi_invertMap(const int32_t *srcMap, int32_t *destMap, int32_t length);
1825 
1835 #define UBIDI_KEEP_BASE_COMBINING 1
1836 
1845 #define UBIDI_DO_MIRRORING 2
1846 
1859 #define UBIDI_INSERT_LRM_FOR_NUMERIC 4
1860 
1872 #define UBIDI_REMOVE_BIDI_CONTROLS 8
1873 
1888 #define UBIDI_OUTPUT_REVERSE 16
1889 
1928 U_STABLE int32_t U_EXPORT2
1929 ubidi_getProcessedLength(const UBiDi *pBiDi);
1930 
1958 U_STABLE int32_t U_EXPORT2
1959 ubidi_getResultLength(const UBiDi *pBiDi);
1960 
1968 #define U_BIDI_CLASS_DEFAULT U_CHAR_DIRECTION_COUNT
1969 
1990 typedef UCharDirection U_CALLCONV
1991 UBiDiClassCallback(const void *context, UChar32 c);
1992 
1994 
2012 
2040 U_STABLE void U_EXPORT2
2042  const void *newContext, UBiDiClassCallback **oldFn,
2043  const void **oldContext, UErrorCode *pErrorCode);
2044 
2057 U_STABLE void U_EXPORT2
2058 ubidi_getClassCallback(UBiDi *pBiDi, UBiDiClassCallback **fn, const void **context);
2059 
2125 U_STABLE int32_t U_EXPORT2
2127  UChar *dest, int32_t destSize,
2128  uint16_t options,
2129  UErrorCode *pErrorCode);
2130 
2177 U_STABLE int32_t U_EXPORT2
2178 ubidi_writeReverse(const UChar *src, int32_t srcLength,
2179  UChar *dest, int32_t destSize,
2180  uint16_t options,
2181  UErrorCode *pErrorCode);
2182 
2183 /*#define BIDI_SAMPLE_CODE*/
2186 #endif