OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file defines utility functions for eliding and formatting UI text. | 5 // This file defines utility functions for eliding and formatting UI text. |
6 | 6 |
7 #ifndef UI_GFX_TEXT_ELIDER_H_ | 7 #ifndef UI_GFX_TEXT_ELIDER_H_ |
8 #define UI_GFX_TEXT_ELIDER_H_ | 8 #define UI_GFX_TEXT_ELIDER_H_ |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
17 #include "ui/gfx/gfx_export.h" | 17 #include "ui/gfx/gfx_export.h" |
18 #include "ui/gfx/text_constants.h" | 18 #include "ui/gfx/text_constants.h" |
19 | 19 |
20 class GURL; | |
21 | |
22 namespace base { | 20 namespace base { |
23 class FilePath; | 21 class FilePath; |
24 } | 22 } |
25 | 23 |
26 namespace gfx { | 24 namespace gfx { |
27 class FontList; | 25 class FontList; |
28 | 26 |
29 GFX_EXPORT extern const char kEllipsis[]; | 27 GFX_EXPORT extern const char kEllipsis[]; |
30 GFX_EXPORT extern const base::char16 kEllipsisUTF16[]; | 28 GFX_EXPORT extern const base::char16 kEllipsisUTF16[]; |
31 GFX_EXPORT extern const base::char16 kForwardSlash; | 29 GFX_EXPORT extern const base::char16 kForwardSlash; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // CHARACTER_BREAK, and adds the horizontal ellipsis character (unicode | 140 // CHARACTER_BREAK, and adds the horizontal ellipsis character (unicode |
143 // character 0x2026) to render "...". The supplied string is returned if the | 141 // character 0x2026) to render "...". The supplied string is returned if the |
144 // string has |length| characters or less. | 142 // string has |length| characters or less. |
145 GFX_EXPORT base::string16 TruncateString(const base::string16& string, | 143 GFX_EXPORT base::string16 TruncateString(const base::string16& string, |
146 size_t length, | 144 size_t length, |
147 BreakType break_type); | 145 BreakType break_type); |
148 | 146 |
149 } // namespace gfx | 147 } // namespace gfx |
150 | 148 |
151 #endif // UI_GFX_TEXT_ELIDER_H_ | 149 #endif // UI_GFX_TEXT_ELIDER_H_ |
OLD | NEW |