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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 // Returns whether the text direction for the default ICU locale is RTL. This | 57 // Returns whether the text direction for the default ICU locale is RTL. This |
| 58 // assumes that SetICUDefaultLocale has been called to set the default locale to | 58 // assumes that SetICUDefaultLocale has been called to set the default locale to |
| 59 // the UI locale of Chrome. | 59 // the UI locale of Chrome. |
| 60 // NOTE: Generally, you should call IsRTL() instead of this. | 60 // NOTE: Generally, you should call IsRTL() instead of this. |
| 61 BASE_I18N_EXPORT bool ICUIsRTL(); | 61 BASE_I18N_EXPORT bool ICUIsRTL(); |
| 62 | 62 |
| 63 // Returns the text direction for |locale_name|. | 63 // Returns the text direction for |locale_name|. |
| 64 BASE_I18N_EXPORT TextDirection GetTextDirectionForLocale( | 64 BASE_I18N_EXPORT TextDirection GetTextDirectionForLocale( |
| 65 const char* locale_name); | 65 const char* locale_name); |
| 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 or last |
| 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 |
|
msw
2013/12/12 19:28:29
nit: remove blank line
Anuj
2013/12/13 01:23:50
Done.
| |
| 76 BASE_I18N_EXPORT TextDirection GetLastStrongCharacterDirection( | |
| 77 const string16& text); | |
| 78 | |
| 76 // Given the string in |text|, returns LEFT_TO_RIGHT or RIGHT_TO_LEFT if all the | 79 // 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 | 80 // strong directionality characters in the string are of the same |
| 78 // directionality. It returns UNKNOWN_DIRECTION if the string contains a mix of | 81 // 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 | 82 // LTR and RTL strong directionality characters. Defaults to LEFT_TO_RIGHT if |
| 80 // the string does not contain directionality characters. Please refer to | 83 // the string does not contain directionality characters. Please refer to |
| 81 // http://unicode.org/reports/tr9/ for more information. | 84 // http://unicode.org/reports/tr9/ for more information. |
| 82 BASE_I18N_EXPORT TextDirection GetStringDirection(const string16& text); | 85 BASE_I18N_EXPORT TextDirection GetStringDirection(const string16& text); |
| 83 | 86 |
| 84 // Given the string in |text|, this function modifies the string in place with | 87 // Given the string in |text|, this function modifies the string in place with |
| 85 // the appropriate Unicode formatting marks that mark the string direction | 88 // 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 | 141 // 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 | 142 // semantic effect. They can be deleted so they might not always appear in a |
| 140 // pair. | 143 // pair. |
| 141 BASE_I18N_EXPORT string16 StripWrappingBidiControlCharacters( | 144 BASE_I18N_EXPORT string16 StripWrappingBidiControlCharacters( |
| 142 const string16& text) WARN_UNUSED_RESULT; | 145 const string16& text) WARN_UNUSED_RESULT; |
| 143 | 146 |
| 144 } // namespace i18n | 147 } // namespace i18n |
| 145 } // namespace base | 148 } // namespace base |
| 146 | 149 |
| 147 #endif // BASE_I18N_RTL_H_ | 150 #endif // BASE_I18N_RTL_H_ |
| OLD | NEW |