| 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_INCLUDE_FXCRT_FX_ARB_H_ | 7 #ifndef CORE_INCLUDE_FXCRT_FX_ARB_H_ |
| 8 #define CORE_INCLUDE_FXCRT_FX_ARB_H_ | 8 #define CORE_INCLUDE_FXCRT_FX_ARB_H_ |
| 9 | 9 |
| 10 #include "fx_system.h" | 10 #include "fx_system.h" |
| 11 #include "fx_ucd.h" | 11 #include "fx_ucd.h" |
| 12 | 12 |
| 13 class IFX_ArabicChar; | 13 class IFX_ArabicChar; |
| 14 class IFX_BidiChar; | 14 |
| 15 #ifdef __cplusplus | 15 struct FX_ARBFORMTABLE { |
| 16 extern "C" { | |
| 17 #endif | |
| 18 typedef struct _FX_ARBFORMTABLE { | |
| 19 FX_WCHAR wIsolated; | 16 FX_WCHAR wIsolated; |
| 20 FX_WCHAR wFinal; | 17 FX_WCHAR wFinal; |
| 21 FX_WCHAR wInitial; | 18 FX_WCHAR wInitial; |
| 22 FX_WCHAR wMedial; | 19 FX_WCHAR wMedial; |
| 23 } FX_ARBFORMTABLE, *FX_LPARBFORMTABLE; | 20 }; |
| 24 typedef FX_ARBFORMTABLE const* FX_LPCARBFORMTABLE; | 21 |
| 25 typedef struct _FX_ARAALEF { | 22 struct FX_ARAALEF { |
| 26 FX_WCHAR wAlef; | 23 FX_WCHAR wAlef; |
| 27 FX_WCHAR wIsolated; | 24 FX_WCHAR wIsolated; |
| 28 } FX_ARAALEF, *FX_LPARAALEF; | 25 }; |
| 29 typedef FX_ARAALEF const* FX_LPCARAALEF; | 26 |
| 30 typedef struct _FX_ARASHADDA { | 27 struct FX_ARASHADDA { |
| 31 FX_WCHAR wShadda; | 28 FX_WCHAR wShadda; |
| 32 FX_WCHAR wIsolated; | 29 FX_WCHAR wIsolated; |
| 33 } FX_ARASHADDA, *FX_LPARASHADDA; | 30 }; |
| 34 typedef FX_ARASHADDA const* FX_LPCARASHADDA; | 31 |
| 35 FX_LPCARBFORMTABLE FX_GetArabicFormTable(FX_WCHAR unicode); | 32 const FX_ARBFORMTABLE* FX_GetArabicFormTable(FX_WCHAR unicode); |
| 36 FX_WCHAR FX_GetArabicFromAlefTable(FX_WCHAR alef); | 33 FX_WCHAR FX_GetArabicFromAlefTable(FX_WCHAR alef); |
| 37 FX_WCHAR FX_GetArabicFromShaddaTable(FX_WCHAR shadda); | 34 FX_WCHAR FX_GetArabicFromShaddaTable(FX_WCHAR shadda); |
| 38 #ifdef __cplusplus | 35 |
| 39 }; | |
| 40 #endif | |
| 41 enum FX_ARBPOSITION { | 36 enum FX_ARBPOSITION { |
| 42 FX_ARBPOSITION_Isolated = 0, | 37 FX_ARBPOSITION_Isolated = 0, |
| 43 FX_ARBPOSITION_Final, | 38 FX_ARBPOSITION_Final, |
| 44 FX_ARBPOSITION_Initial, | 39 FX_ARBPOSITION_Initial, |
| 45 FX_ARBPOSITION_Medial, | 40 FX_ARBPOSITION_Medial, |
| 46 }; | 41 }; |
| 42 |
| 47 class IFX_ArabicChar { | 43 class IFX_ArabicChar { |
| 48 public: | 44 public: |
| 49 static IFX_ArabicChar* Create(); | 45 static IFX_ArabicChar* Create(); |
| 50 virtual ~IFX_ArabicChar() {} | 46 virtual ~IFX_ArabicChar() {} |
| 51 virtual void Release() = 0; | 47 virtual void Release() = 0; |
| 52 virtual FX_BOOL IsArabicChar(FX_WCHAR wch) const = 0; | 48 virtual FX_BOOL IsArabicChar(FX_WCHAR wch) const = 0; |
| 53 virtual FX_BOOL IsArabicFormChar(FX_WCHAR wch) const = 0; | 49 virtual FX_BOOL IsArabicFormChar(FX_WCHAR wch) const = 0; |
| 54 virtual FX_WCHAR GetFormChar(FX_WCHAR wch, | 50 virtual FX_WCHAR GetFormChar(FX_WCHAR wch, |
| 55 FX_WCHAR prev = 0, | 51 FX_WCHAR prev = 0, |
| 56 FX_WCHAR next = 0) const = 0; | 52 FX_WCHAR next = 0) const = 0; |
| 57 virtual FX_WCHAR GetFormChar(const CFX_Char* cur, | 53 virtual FX_WCHAR GetFormChar(const CFX_Char* cur, |
| 58 const CFX_Char* prev, | 54 const CFX_Char* prev, |
| 59 const CFX_Char* next) const = 0; | 55 const CFX_Char* next) const = 0; |
| 60 }; | 56 }; |
| 57 |
| 61 void FX_BidiLine(CFX_WideString& wsText, int32_t iBaseLevel = 0); | 58 void FX_BidiLine(CFX_WideString& wsText, int32_t iBaseLevel = 0); |
| 62 void FX_BidiLine(CFX_TxtCharArray& chars, | 59 void FX_BidiLine(CFX_TxtCharArray& chars, |
| 63 int32_t iCount, | 60 int32_t iCount, |
| 64 int32_t iBaseLevel = 0); | 61 int32_t iBaseLevel = 0); |
| 65 void FX_BidiLine(CFX_RTFCharArray& chars, | 62 void FX_BidiLine(CFX_RTFCharArray& chars, |
| 66 int32_t iCount, | 63 int32_t iCount, |
| 67 int32_t iBaseLevel = 0); | 64 int32_t iBaseLevel = 0); |
| 68 class IFX_BidiChar { | |
| 69 public: | |
| 70 static IFX_BidiChar* Create(); | |
| 71 virtual ~IFX_BidiChar() {} | |
| 72 | |
| 73 virtual void SetPolicy(FX_BOOL bSeparateNeutral = TRUE) = 0; | |
| 74 virtual FX_BOOL AppendChar(FX_WCHAR wch) = 0; | |
| 75 virtual FX_BOOL EndChar() = 0; | |
| 76 virtual int32_t GetBidiInfo(int32_t& iStart, int32_t& iCount) = 0; | |
| 77 virtual void Reset() = 0; | |
| 78 }; | |
| 79 | 65 |
| 80 #endif // CORE_INCLUDE_FXCRT_FX_ARB_H_ | 66 #endif // CORE_INCLUDE_FXCRT_FX_ARB_H_ |
| OLD | NEW |