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

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

Issue 10910128: Check string and UI direction in GetDisplayStringInLTRDirectionality, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: USE ARRAYSIZE_UNSAFE for unnamed struct arrays. Created 8 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 | « no previous file | base/i18n/rtl.cc » ('j') | base/i18n/rtl.cc » ('J')
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_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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // Wraps a string with an RLE-PDF pair which essentialy marks the string as a 110 // Wraps a string with an RLE-PDF pair which essentialy marks the string as a
111 // Right-To-Left string. Doing this is useful in order to make sure RTL 111 // Right-To-Left string. Doing this is useful in order to make sure RTL
112 // strings are rendered properly in an LTR context. 112 // strings are rendered properly in an LTR context.
113 BASE_I18N_EXPORT void WrapStringWithRTLFormatting(string16* text); 113 BASE_I18N_EXPORT void WrapStringWithRTLFormatting(string16* text);
114 114
115 // Wraps file path to get it to display correctly in RTL UI. All filepaths 115 // Wraps file path to get it to display correctly in RTL UI. All filepaths
116 // should be passed through this function before display in UI for RTL locales. 116 // should be passed through this function before display in UI for RTL locales.
117 BASE_I18N_EXPORT void WrapPathWithLTRFormatting(const FilePath& path, 117 BASE_I18N_EXPORT void WrapPathWithLTRFormatting(const FilePath& path,
118 string16* rtl_safe_path); 118 string16* rtl_safe_path);
119 119
120 // Given the string in |text|, this function returns the adjusted string having 120 // Return the string in |text| wrapped with LRE (Left-To-Right Embedding) and
121 // LTR directionality for display purpose. Which means that in RTL locale the 121 // PDF (Pop Directional Formatting) marks, if needed for UI display purposes.
122 // string is wrapped with LRE (Left-To-Right Embedding) and PDF (Pop
123 // Directional Formatting) marks and returned. In LTR locale, the string itself
124 // is returned.
125 BASE_I18N_EXPORT string16 GetDisplayStringInLTRDirectionality( 122 BASE_I18N_EXPORT string16 GetDisplayStringInLTRDirectionality(
126 const string16& text) WARN_UNUSED_RESULT; 123 const string16& text) WARN_UNUSED_RESULT;
127 124
128 // Strip the beginning (U+202A..U+202B, U+202D..U+202E) and/or ending (U+202C) 125 // Strip the beginning (U+202A..U+202B, U+202D..U+202E) and/or ending (U+202C)
129 // explicit bidi control characters from |text|, if there are any. Otherwise, 126 // explicit bidi control characters from |text|, if there are any. Otherwise,
130 // return the text itself. Explicit bidi control characters display and have 127 // return the text itself. Explicit bidi control characters display and have
131 // semantic effect. They can be deleted so they might not always appear in a 128 // semantic effect. They can be deleted so they might not always appear in a
132 // pair. 129 // pair.
133 BASE_I18N_EXPORT string16 StripWrappingBidiControlCharacters( 130 BASE_I18N_EXPORT string16 StripWrappingBidiControlCharacters(
134 const string16& text) WARN_UNUSED_RESULT; 131 const string16& text) WARN_UNUSED_RESULT;
135 132
136 } // namespace i18n 133 } // namespace i18n
137 } // namespace base 134 } // namespace base
138 135
139 #endif // BASE_I18N_RTL_H_ 136 #endif // BASE_I18N_RTL_H_
OLDNEW
« no previous file with comments | « no previous file | base/i18n/rtl.cc » ('j') | base/i18n/rtl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698