Guiliani  Version 2.6 revision 7293 (documentation build 12)
bidi.h
1// File: Bidi.h
2//
3/*
4Adapted reference implementation of the Bidi Algorithm from ftp://ftp.unicode.org/Public/PROGRAMS/BidiReferenceCpp/v26/
5The reference implementation is distributed under the Terms of Use in http://www.unicode.org/copyright.html.
6
7*/
8
9#ifndef _BIDI_H_
10#define _BIDI_H_
11
12#include <eC_Types.h>
13#include <eC_TList.h>
14#include <eC_String.h>
15
16#define BIDI_MAX_CCH 1024
17
18// For convenience of external callers, the following constitute the interface to the actual algorithm.
19// For usage notes and paramter descriptions see the file bidi.cpp
20
21void BidiLines(
22 int baselevel, eC_UTF16* pszLine, int * pclsLine,
23 int * plevelLine, int cchPara, int fMirror, bool * pbrk = 0);
24
25void GetEmbeddingLevels(const eC_String& kSource, int *levels);
26
27eC_Int BidiResolve(eC_UTF16* paPszInput, eC_Int iCch);
28
29enum bidi_class
30{
31 ON = 0,
32 L,
33 R,
34 AN,
35 EN,
36 AL,
37 // Non-spacing Mark
38 NSM,
39 CS,
40 ES,
41 ET,
42
43 BN,
44 S,
45 WS,
46 B,
47 RLO,
48 RLE,
49 LRO,
50 LRE,
51 PDF,
52 N = ON,
53};
54
55int EmbeddingDirection(int level);
56
57int GetEmbeddingDirection(int level);
58
62{
63 eC_UInt m_uiStartRtL;
64 eC_UInt m_uiEndRtL;
65 RightEmbedding() {};
66
71 RightEmbedding(eC_UInt uiStartRtL, eC_UInt uiEndRtL)
72 {
73 m_uiStartRtL = uiStartRtL;
74 m_uiEndRtL = uiEndRtL;
75 }
76
81 eC_Bool operator==(const RightEmbedding rtl) const
82 {
83 return ((this->m_uiStartRtL == rtl.m_uiStartRtL) &&
84 (this->m_uiEndRtL == rtl.m_uiEndRtL));
85 }
86};
87
91{
92 eC_UInt m_uiStartLtR;
93 eC_UInt m_uiEndLtR;
94 LeftEmbedding() {};
95
100 LeftEmbedding(eC_UInt uiStartLtR, eC_UInt uiEndLtR)
101 {
102 m_uiStartLtR = uiStartLtR;
103 m_uiEndLtR = uiEndLtR;
104 }
105
110 eC_Bool operator==(const LeftEmbedding ltr) const
111 {
112 return ((this->m_uiStartLtR == ltr.m_uiStartLtR) &&
113 (this->m_uiEndLtR == ltr.m_uiEndLtR));
114 }
115
121 {
122 this->m_uiStartLtR = ltrSource.m_uiStartLtR;
123 this->m_uiEndLtR = ltrSource.m_uiEndLtR;
124 return *this;
125 }
126};
127
128#endif //#ifndef _BIDI_H_
Definition: bidi.h:91
LeftEmbedding(eC_UInt uiStartLtR, eC_UInt uiEndLtR)
default-constructor
Definition: bidi.h:100
eC_Bool operator==(const LeftEmbedding ltr) const
Definition: bidi.h:110
LeftEmbedding & operator=(const LeftEmbedding &ltrSource)
Definition: bidi.h:120
eC_UInt m_uiEndLtR
end
Definition: bidi.h:93
eC_UInt m_uiStartLtR
start
Definition: bidi.h:92
Definition: bidi.h:62
RightEmbedding(eC_UInt uiStartRtL, eC_UInt uiEndRtL)
default-constructor
Definition: bidi.h:71
eC_Bool operator==(const RightEmbedding rtl) const
Definition: bidi.h:81
eC_UInt m_uiStartRtL
start
Definition: bidi.h:63
eC_UInt m_uiEndRtL
end
Definition: bidi.h:64