OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_SRC_FXCRT_FX_ARABIC_H_ | 7 #ifndef CORE_SRC_FXCRT_FX_ARABIC_H_ |
8 #define CORE_SRC_FXCRT_FX_ARABIC_H_ | 8 #define CORE_SRC_FXCRT_FX_ARABIC_H_ |
9 | 9 |
10 #include "../../include/fxcrt/fx_arb.h" | 10 #include "../../include/fxcrt/fx_arb.h" |
11 | 11 |
12 class CFX_ArabicChar : public IFX_ArabicChar { | 12 class CFX_ArabicChar : public IFX_ArabicChar { |
13 public: | 13 public: |
14 virtual void Release() { delete this; } | 14 virtual void Release() { delete this; } |
15 virtual FX_BOOL IsArabicChar(FX_WCHAR wch) const; | 15 virtual FX_BOOL IsArabicChar(FX_WCHAR wch) const; |
16 virtual FX_BOOL IsArabicFormChar(FX_WCHAR wch) const; | 16 virtual FX_BOOL IsArabicFormChar(FX_WCHAR wch) const; |
17 | 17 |
18 virtual FX_WCHAR GetFormChar(FX_WCHAR wch, | 18 virtual FX_WCHAR GetFormChar(FX_WCHAR wch, |
19 FX_WCHAR prev = 0, | 19 FX_WCHAR prev = 0, |
20 FX_WCHAR next = 0) const; | 20 FX_WCHAR next = 0) const; |
21 virtual FX_WCHAR GetFormChar(const CFX_Char* cur, | 21 virtual FX_WCHAR GetFormChar(const CFX_Char* cur, |
22 const CFX_Char* prev, | 22 const CFX_Char* prev, |
23 const CFX_Char* next) const; | 23 const CFX_Char* next) const; |
24 | 24 |
25 protected: | 25 protected: |
26 FX_LPCARBFORMTABLE ParseChar(const CFX_Char* pTC, | 26 const FX_ARBFORMTABLE* ParseChar(const CFX_Char* pTC, |
27 FX_WCHAR& wChar, | 27 FX_WCHAR& wChar, |
28 FX_CHARTYPE& eType) const; | 28 FX_CHARTYPE& eType) const; |
29 }; | 29 }; |
30 void FX_BidiReverseString(CFX_WideString& wsText, | 30 void FX_BidiReverseString(CFX_WideString& wsText, |
31 int32_t iStart, | 31 int32_t iStart, |
32 int32_t iCount); | 32 int32_t iCount); |
33 void FX_BidiSetDeferredRun(CFX_Int32Array& values, | 33 void FX_BidiSetDeferredRun(CFX_Int32Array& values, |
34 int32_t iStart, | 34 int32_t iStart, |
35 int32_t iCount, | 35 int32_t iCount, |
36 int32_t iValue); | 36 int32_t iValue); |
37 #define FX_BCON FX_BIDICLASS_ON | 37 #define FX_BCON FX_BIDICLASS_ON |
38 #define FX_BCL FX_BIDICLASS_L | 38 #define FX_BCL FX_BIDICLASS_L |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 const CFX_Int32Array& classes, | 200 const CFX_Int32Array& classes, |
201 CFX_Int32Array& levels); | 201 CFX_Int32Array& levels); |
202 int32_t FX_BidiReorderLevel(int32_t iBaseLevel, | 202 int32_t FX_BidiReorderLevel(int32_t iBaseLevel, |
203 CFX_WideString& wsText, | 203 CFX_WideString& wsText, |
204 const CFX_Int32Array& levels, | 204 const CFX_Int32Array& levels, |
205 int32_t iStart, | 205 int32_t iStart, |
206 FX_BOOL bReverse = FALSE); | 206 FX_BOOL bReverse = FALSE); |
207 void FX_BidiReorder(int32_t iBaseLevel, | 207 void FX_BidiReorder(int32_t iBaseLevel, |
208 CFX_WideString& wsText, | 208 CFX_WideString& wsText, |
209 const CFX_Int32Array& levels); | 209 const CFX_Int32Array& levels); |
210 class CFX_BidiChar final : public IFX_BidiChar { | |
211 public: | |
212 CFX_BidiChar(); | |
213 ~CFX_BidiChar() override {} | |
214 | |
215 void SetPolicy(FX_BOOL bSeparateNeutral = TRUE) override; | |
216 FX_BOOL AppendChar(FX_WCHAR wch) override; | |
217 FX_BOOL EndChar() override; | |
218 int32_t GetBidiInfo(int32_t& iStart, int32_t& iCount) override; | |
219 void Reset() override; | |
220 | |
221 private: | |
222 FX_BOOL m_bSeparateNeutral; | |
223 int32_t m_iCurStart; | |
224 int32_t m_iCurCount; | |
225 int32_t m_iCurBidi; | |
226 int32_t m_iLastBidi; | |
227 int32_t m_iLastStart; | |
228 int32_t m_iLastCount; | |
229 }; | |
230 | 210 |
231 #endif // CORE_SRC_FXCRT_FX_ARABIC_H_ | 211 #endif // CORE_SRC_FXCRT_FX_ARABIC_H_ |
OLD | NEW |