Chromium Code Reviews| Index: core/include/fxcrt/fx_arb.h |
| diff --git a/core/include/fxcrt/fx_arb.h b/core/include/fxcrt/fx_arb.h |
| index 7ce21e50861328a0935082bb286c1e96080ec724..8744c28a95af7ba2b3800a250d5f46f4e57608e9 100644 |
| --- a/core/include/fxcrt/fx_arb.h |
| +++ b/core/include/fxcrt/fx_arb.h |
| @@ -9,17 +9,35 @@ |
| #include "fx_system.h" |
| +// Processes characters and group them into segments based on text direction. |
| class IFX_BidiChar |
| { |
| public: |
| + enum Direction { |
| + NEUTRAL, |
| + LEFT, |
| + RIGHT |
| + }; |
| + |
| static IFX_BidiChar* Create(); |
| virtual ~IFX_BidiChar() {} |
| - virtual void SetPolicy(FX_BOOL bSeparateNeutral = TRUE) = 0; |
| - virtual FX_BOOL AppendChar(FX_WCHAR wch) = 0; |
| - virtual FX_BOOL EndChar() = 0; |
| - virtual int32_t GetBidiInfo(int32_t &iStart, int32_t &iCount) = 0; |
| - virtual void Reset() = 0; |
| + // Append a character and classify it as left, right, or neutral. |
| + // Returns true if the character has a different direction than the |
| + // existing direction to indicate there is a segment to process. |
| + virtual bool AppendChar(FX_WCHAR wch) = 0; |
| + |
| + // Call this after the last character has been appended. AppendChar() |
| + // should not be called after this. |
|
Tom Sepez
2015/06/19 20:30:32
nit: "may not" or "must not".
Lei Zhang
2015/08/17 17:41:35
Done.
|
| + // Returns if there is still a segment to process. |
| + virtual bool EndChar() = 0; |
|
Tom Sepez
2015/06/19 20:30:32
nit: it's still a mystery -- returns what?
Lei Zhang
2015/08/17 17:41:35
Done.
|
| + |
| + // Get information about the segment to process. |
| + // The segment's start position and character count goes in |iStart| and |
|
Tom Sepez
2015/06/19 20:30:32
nit: s/goes in/is returned in/
Lei Zhang
2015/08/17 17:41:35
Done.
|
| + // |iCount|, respectively. Pass in null pointers if the information is not |
| + // needed. |
| + // Returns the segment direction. |
| + virtual Direction GetBidiInfo(int32_t* iStart, int32_t* iCount) = 0; |
| }; |
| #endif // CORE_INCLUDE_FXCRT_FX_ARB_H_ |