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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | core/include/fxcrt/fx_ucd.h » ('j') | core/src/fxcrt/fx_arabic.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 11
12 // Processes characters and group them into segments based on text direction.
12 class IFX_BidiChar 13 class IFX_BidiChar
13 { 14 {
14 public: 15 public:
16 enum Direction {
17 NEUTRAL,
18 LEFT,
19 RIGHT
20 };
21
15 static IFX_BidiChar* Create(); 22 static IFX_BidiChar* Create();
16 virtual ~IFX_BidiChar() {} 23 virtual ~IFX_BidiChar() {}
17 24
18 virtual void SetPolicy(FX_BOOL bSeparateNeutral = TRUE) = 0; 25 // Append a character and classify it as left, right, or neutral.
19 virtual FX_BOOL AppendChar(FX_WCHAR wch) = 0; 26 // Returns true if the character has a different direction than the
20 virtual FX_BOOL EndChar() = 0; 27 // existing direction to indicate there is a segment to process.
21 virtual int32_t GetBidiInfo(int32_t &iStart, int32_t &iCount) = 0; 28 virtual bool AppendChar(FX_WCHAR wch) = 0;
22 virtual void Reset() = 0; 29
30 // Call this after the last character has been appended. AppendChar()
31 // 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.
32 // Returns if there is still a segment to process.
33 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.
34
35 // Get information about the segment to process.
36 // 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.
37 // |iCount|, respectively. Pass in null pointers if the information is not
38 // needed.
39 // Returns the segment direction.
40 virtual Direction GetBidiInfo(int32_t* iStart, int32_t* iCount) = 0;
23 }; 41 };
24 42
25 #endif // CORE_INCLUDE_FXCRT_FX_ARB_H_ 43 #endif // CORE_INCLUDE_FXCRT_FX_ARB_H_
OLDNEW
« 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