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

Side by Side Diff: base/i18n/bidi_line_iterator.h

Issue 7812009: Base: Switch base_i18n to be a separate dll (component build) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « base/i18n/base_i18n_export.h ('k') | base/i18n/break_iterator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium 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 #ifndef BASE_I18N_BIDI_LINE_ITERATOR_H_ 5 #ifndef BASE_I18N_BIDI_LINE_ITERATOR_H_
6 #define BASE_I18N_BIDI_LINE_ITERATOR_H_ 6 #define BASE_I18N_BIDI_LINE_ITERATOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include "unicode/ubidi.h" 9 #include "unicode/ubidi.h"
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/i18n/base_i18n_export.h"
12 #include "base/string16.h" 13 #include "base/string16.h"
13 14
14 namespace base { 15 namespace base {
15 namespace i18n { 16 namespace i18n {
16 17
17 // A simple wrapper class for the bidirectional iterator of ICU. 18 // A simple wrapper class for the bidirectional iterator of ICU.
18 // This class uses the bidirectional iterator of ICU to split a line of 19 // This class uses the bidirectional iterator of ICU to split a line of
19 // bidirectional texts into visual runs in its display order. 20 // bidirectional texts into visual runs in its display order.
20 class BiDiLineIterator { 21 class BASE_I18N_EXPORT BiDiLineIterator {
21 public: 22 public:
22 BiDiLineIterator(); 23 BiDiLineIterator();
23 ~BiDiLineIterator(); 24 ~BiDiLineIterator();
24 25
25 // Initializes the bidirectional iterator with the specified text. Returns 26 // Initializes the bidirectional iterator with the specified text. Returns
26 // whether initialization succeeded. 27 // whether initialization succeeded.
27 bool Open(const string16& text, bool right_to_left, bool url); 28 bool Open(const string16& text, bool right_to_left, bool url);
28 29
29 // Returns the number of visual runs in the text, or zero on error. 30 // Returns the number of visual runs in the text, or zero on error.
30 int CountRuns(); 31 int CountRuns();
31 32
32 // Gets the logical offset, length, and direction of the specified visual run. 33 // Gets the logical offset, length, and direction of the specified visual run.
33 UBiDiDirection GetVisualRun(int index, int* start, int* length); 34 UBiDiDirection GetVisualRun(int index, int* start, int* length);
34 35
35 // Given a start position, figure out where the run ends (and the BiDiLevel). 36 // Given a start position, figure out where the run ends (and the BiDiLevel).
36 void GetLogicalRun(int start, int* end, UBiDiLevel* level); 37 void GetLogicalRun(int start, int* end, UBiDiLevel* level);
37 38
38 private: 39 private:
39 UBiDi* bidi_; 40 UBiDi* bidi_;
40 41
41 DISALLOW_COPY_AND_ASSIGN(BiDiLineIterator); 42 DISALLOW_COPY_AND_ASSIGN(BiDiLineIterator);
42 }; 43 };
43 44
44 } // namespace i18n 45 } // namespace i18n
45 } // namespace base 46 } // namespace base
46 47
47 #endif // BASE_I18N_BIDI_LINE_ITERATOR_H_ 48 #endif // BASE_I18N_BIDI_LINE_ITERATOR_H_
OLDNEW
« no previous file with comments | « base/i18n/base_i18n_export.h ('k') | base/i18n/break_iterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698