00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef UBIDI_H
00018
#define UBIDI_H
00019
00020
#include "unicode/utypes.h"
00021
#include "unicode/uchar.h"
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00301
00344
typedef uint8_t UBiDiLevel;
00345
00350
#define UBIDI_DEFAULT_LTR 0xfe
00351
00356
#define UBIDI_DEFAULT_RTL 0xff
00357
00363
#define UBIDI_MAX_EXPLICIT_LEVEL 61
00364
00369
#define UBIDI_LEVEL_OVERRIDE 0x80
00370
00375
enum UBiDiDirection {
00377
UBIDI_LTR,
00379
UBIDI_RTL,
00381
UBIDI_MIXED
00382 };
00383
00385
typedef enum UBiDiDirection UBiDiDirection;
00386
00397
struct UBiDi;
00398
00400
typedef struct UBiDi UBiDi;
00401
00416 U_STABLE UBiDi *
U_EXPORT2
00417
ubidi_open(
void);
00418
00454
U_STABLE UBiDi *
U_EXPORT2
00455
ubidi_openSized(int32_t maxLength, int32_t maxRunCount, UErrorCode *pErrorCode);
00456
00477
U_STABLE void U_EXPORT2
00478
ubidi_close(UBiDi *pBiDi);
00479
00516
U_STABLE void U_EXPORT2
00517
ubidi_setInverse(UBiDi *pBiDi, UBool isInverse);
00518
00528
U_STABLE UBool U_EXPORT2
00529
ubidi_isInverse(UBiDi *pBiDi);
00530
00602
U_STABLE void U_EXPORT2
00603
ubidi_setPara(UBiDi *pBiDi,
const UChar *text, int32_t length,
00604 UBiDiLevel paraLevel, UBiDiLevel *embeddingLevels,
00605 UErrorCode *pErrorCode);
00606
00650
U_STABLE void U_EXPORT2
00651
ubidi_setLine(
const UBiDi *pParaBiDi,
00652 int32_t start, int32_t limit,
00653 UBiDi *pLineBiDi,
00654 UErrorCode *pErrorCode);
00655
00668
U_STABLE UBiDiDirection U_EXPORT2
00669
ubidi_getDirection(
const UBiDi *pBiDi);
00670
00682
U_STABLE const UChar *
U_EXPORT2
00683
ubidi_getText(
const UBiDi *pBiDi);
00684
00693
U_STABLE int32_t U_EXPORT2
00694
ubidi_getLength(
const UBiDi *pBiDi);
00695
00706
U_STABLE UBiDiLevel U_EXPORT2
00707
ubidi_getParaLevel(
const UBiDi *pBiDi);
00708
00721
U_STABLE UBiDiLevel U_EXPORT2
00722
ubidi_getLevelAt(
const UBiDi *pBiDi, int32_t charIndex);
00723
00741
U_STABLE const UBiDiLevel *
U_EXPORT2
00742
ubidi_getLevels(UBiDi *pBiDi, UErrorCode *pErrorCode);
00743
00766
U_STABLE void U_EXPORT2
00767
ubidi_getLogicalRun(
const UBiDi *pBiDi, int32_t logicalStart,
00768 int32_t *pLogicalLimit, UBiDiLevel *pLevel);
00769
00786
U_STABLE int32_t U_EXPORT2
00787
ubidi_countRuns(UBiDi *pBiDi, UErrorCode *pErrorCode);
00788
00840
U_STABLE UBiDiDirection U_EXPORT2
00841
ubidi_getVisualRun(UBiDi *pBiDi, int32_t runIndex,
00842 int32_t *pLogicalStart, int32_t *pLength);
00843
00867
U_STABLE int32_t U_EXPORT2
00868
ubidi_getVisualIndex(UBiDi *pBiDi, int32_t logicalIndex, UErrorCode *pErrorCode);
00869
00891
U_STABLE int32_t U_EXPORT2
00892
ubidi_getLogicalIndex(UBiDi *pBiDi, int32_t visualIndex, UErrorCode *pErrorCode);
00893
00912
U_STABLE void U_EXPORT2
00913
ubidi_getLogicalMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode);
00914
00933
U_STABLE void U_EXPORT2
00934
ubidi_getVisualMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode);
00935
00956
U_STABLE void U_EXPORT2
00957
ubidi_reorderLogical(
const UBiDiLevel *levels, int32_t length, int32_t *indexMap);
00958
00979
U_STABLE void U_EXPORT2
00980
ubidi_reorderVisual(
const UBiDiLevel *levels, int32_t length, int32_t *indexMap);
00981
00996
U_STABLE void U_EXPORT2
00997
ubidi_invertMap(
const int32_t *srcMap, int32_t *destMap, int32_t length);
00998
01008
#define UBIDI_KEEP_BASE_COMBINING 1
01009
01018
#define UBIDI_DO_MIRRORING 2
01019
01029
#define UBIDI_INSERT_LRM_FOR_NUMERIC 4
01030
01039
#define UBIDI_REMOVE_BIDI_CONTROLS 8
01040
01055
#define UBIDI_OUTPUT_REVERSE 16
01056
01126
U_STABLE int32_t U_EXPORT2
01127
ubidi_writeReordered(UBiDi *pBiDi,
01128 UChar *dest, int32_t destSize,
01129 uint16_t options,
01130 UErrorCode *pErrorCode);
01131
01179
U_STABLE int32_t U_EXPORT2
01180
ubidi_writeReverse(
const UChar *src, int32_t srcLength,
01181 UChar *dest, int32_t destSize,
01182 uint16_t options,
01183 UErrorCode *pErrorCode);
01184
01185
01188
#endif