| 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 UI_BASE_TEXT_TEXT_ELIDER_H_ | 5 #ifndef UI_BASE_TEXT_TEXT_ELIDER_H_ |
| 6 #define UI_BASE_TEXT_TEXT_ELIDER_H_ | 6 #define UI_BASE_TEXT_TEXT_ELIDER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <unicode/coll.h> | 9 #include <unicode/coll.h> |
| 10 #include <unicode/uchar.h> | 10 #include <unicode/uchar.h> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 #include "gfx/font.h" | 14 #include "ui/gfx/font.h" |
| 15 | 15 |
| 16 class FilePath; | 16 class FilePath; |
| 17 class GURL; | 17 class GURL; |
| 18 | 18 |
| 19 // TODO(port): this file should deal in string16s rather than wstrings. | 19 // TODO(port): this file should deal in string16s rather than wstrings. |
| 20 namespace ui { | 20 namespace ui { |
| 21 | 21 |
| 22 // This function takes a GURL object and elides it. It returns a string | 22 // This function takes a GURL object and elides it. It returns a string |
| 23 // which composed of parts from subdomain, domain, path, filename and query. | 23 // which composed of parts from subdomain, domain, path, filename and query. |
| 24 // A "..." is added automatically at the end if the elided string is bigger | 24 // A "..." is added automatically at the end if the elided string is bigger |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // surrogate pairs) as necssary. Truncation (indicated by an added 3 dots) | 110 // surrogate pairs) as necssary. Truncation (indicated by an added 3 dots) |
| 111 // occurs if the result is still too long. Returns true if the input had | 111 // occurs if the result is still too long. Returns true if the input had |
| 112 // to be truncated (and not just reformatted). | 112 // to be truncated (and not just reformatted). |
| 113 bool ElideRectangleString(const string16& input, size_t max_rows, | 113 bool ElideRectangleString(const string16& input, size_t max_rows, |
| 114 size_t max_cols, string16* output); | 114 size_t max_cols, string16* output); |
| 115 | 115 |
| 116 | 116 |
| 117 } // namespace ui | 117 } // namespace ui |
| 118 | 118 |
| 119 #endif // UI_BASE_TEXT_TEXT_ELIDER_H_ | 119 #endif // UI_BASE_TEXT_TEXT_ELIDER_H_ |
| OLD | NEW |