Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_RTL_H_ | 5 #ifndef BASE_I18N_RTL_H_ |
| 6 #define BASE_I18N_RTL_H_ | 6 #define BASE_I18N_RTL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 | 66 |
| 67 // Given the string in |text|, returns the directionality of the first | 67 // Given the string in |text|, returns the directionality of the first |
| 68 // character with strong directionality in the string. If no character in the | 68 // character with strong directionality in the string. If no character in the |
| 69 // text has strong directionality, LEFT_TO_RIGHT is returned. The Bidi | 69 // text has strong directionality, LEFT_TO_RIGHT is returned. The Bidi |
| 70 // character types L, LRE, LRO, R, AL, RLE, and RLO are considered as strong | 70 // character types L, LRE, LRO, R, AL, RLE, and RLO are considered as strong |
| 71 // directionality characters. Please refer to http://unicode.org/reports/tr9/ | 71 // directionality characters. Please refer to http://unicode.org/reports/tr9/ |
| 72 // for more information. | 72 // for more information. |
| 73 BASE_I18N_EXPORT TextDirection GetFirstStrongCharacterDirection( | 73 BASE_I18N_EXPORT TextDirection GetFirstStrongCharacterDirection( |
| 74 const string16& text); | 74 const string16& text); |
| 75 | 75 |
| 76 // Given the string in |text|, returns the directionality of the last | |
|
msw
2013/12/11 08:10:14
nit: combine this with the comment above, via "of
Anuj
2013/12/12 08:08:41
Done.
| |
| 77 // character with strong directionality in the string. If no character in the | |
| 78 // text has strong directionality, LEFT_TO_RIGHT is returned. See | |
| 79 // GetFirstStrongCharacterDirection for more info. | |
| 80 BASE_I18N_EXPORT TextDirection GetLastStrongCharacterDirection( | |
| 81 const string16& text); | |
| 82 | |
| 76 // Given the string in |text|, returns LEFT_TO_RIGHT or RIGHT_TO_LEFT if all the | 83 // Given the string in |text|, returns LEFT_TO_RIGHT or RIGHT_TO_LEFT if all the |
| 77 // strong directionality characters in the string are of the same | 84 // strong directionality characters in the string are of the same |
| 78 // directionality. It returns UNKNOWN_DIRECTION if the string contains a mix of | 85 // directionality. It returns UNKNOWN_DIRECTION if the string contains a mix of |
| 79 // LTR and RTL strong directionality characters. Defaults to LEFT_TO_RIGHT if | 86 // LTR and RTL strong directionality characters. Defaults to LEFT_TO_RIGHT if |
| 80 // the string does not contain directionality characters. Please refer to | 87 // the string does not contain directionality characters. Please refer to |
| 81 // http://unicode.org/reports/tr9/ for more information. | 88 // http://unicode.org/reports/tr9/ for more information. |
| 82 BASE_I18N_EXPORT TextDirection GetStringDirection(const string16& text); | 89 BASE_I18N_EXPORT TextDirection GetStringDirection(const string16& text); |
| 83 | 90 |
| 84 // Given the string in |text|, this function modifies the string in place with | 91 // Given the string in |text|, this function modifies the string in place with |
| 85 // the appropriate Unicode formatting marks that mark the string direction | 92 // the appropriate Unicode formatting marks that mark the string direction |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 // return the text itself. Explicit bidi control characters display and have | 145 // return the text itself. Explicit bidi control characters display and have |
| 139 // semantic effect. They can be deleted so they might not always appear in a | 146 // semantic effect. They can be deleted so they might not always appear in a |
| 140 // pair. | 147 // pair. |
| 141 BASE_I18N_EXPORT string16 StripWrappingBidiControlCharacters( | 148 BASE_I18N_EXPORT string16 StripWrappingBidiControlCharacters( |
| 142 const string16& text) WARN_UNUSED_RESULT; | 149 const string16& text) WARN_UNUSED_RESULT; |
| 143 | 150 |
| 144 } // namespace i18n | 151 } // namespace i18n |
| 145 } // namespace base | 152 } // namespace base |
| 146 | 153 |
| 147 #endif // BASE_I18N_RTL_H_ | 154 #endif // BASE_I18N_RTL_H_ |
| OLD | NEW |