Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: core/include/fxcrt/fx_arb.h

Issue 1197643002: Cleanup IFX_BidiChar (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/include/fxcrt/fx_ucd.h » ('j') | core/src/fxcrt/fx_arabic.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « no previous file | core/include/fxcrt/fx_ucd.h » ('j') | core/src/fxcrt/fx_arabic.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698