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

Side by Side Diff: ui/gfx/text_constants.h

Issue 312233003: Add fade eliding for Views Labels; related cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refine alignment check; minor additional cleanup. Created 6 years, 6 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 | « ui/gfx/render_text_unittest.cc ('k') | ui/gfx/text_elider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef UI_GFX_TEXT_CONSTANTS_H_ 5 #ifndef UI_GFX_TEXT_CONSTANTS_H_
6 #define UI_GFX_TEXT_CONSTANTS_H_ 6 #define UI_GFX_TEXT_CONSTANTS_H_
7 7
8 namespace gfx { 8 namespace gfx {
9 9
10 // TODO(msw): Distinguish between logical character stops and glyph stops? 10 // TODO(msw): Distinguish between logical character stops and glyph stops?
11 // TODO(msw): Merge with base::i18n::BreakIterator::BreakType. 11 // TODO(msw): Merge with base::i18n::BreakIterator::BreakType.
12 enum BreakType { 12 enum BreakType {
13 // Stop cursor movement on neighboring characters. 13 CHARACTER_BREAK = 0, // Stop cursor movement on neighboring characters.
14 CHARACTER_BREAK = 0, 14 WORD_BREAK, // Stop cursor movement on nearest word boundaries.
15 // Stop cursor movement on nearest word boundaries. 15 LINE_BREAK, // Stop cursor movement on line ends as shown on screen.
16 WORD_BREAK,
17 // Stop cursor movement on line ends as shown on screen.
18 LINE_BREAK,
19 }; 16 };
20 17
21 // Horizontal text alignment modes. 18 // Horizontal text alignment modes.
22 enum HorizontalAlignment { 19 enum HorizontalAlignment {
23 // Align the text's left edge with that of its display area. 20 ALIGN_LEFT = 0, // Align the text's left edge with that of its display area.
24 ALIGN_LEFT = 0, 21 ALIGN_CENTER, // Align the text's center with that of its display area.
25 // Align the text's center with that of its display area. 22 ALIGN_RIGHT, // Align the text's right edge with that of its display area.
26 ALIGN_CENTER,
27 // Align the text's right edge with that of its display area.
28 ALIGN_RIGHT,
29 }; 23 };
30 24
31 // The directionality modes used to determine the base text direction. 25 // The directionality modes used to determine the base text direction.
32 enum DirectionalityMode { 26 enum DirectionalityMode {
33 // Use the first strong character's direction. 27 DIRECTIONALITY_FROM_TEXT = 0, // Use the first strong character's direction.
34 DIRECTIONALITY_FROM_TEXT = 0, 28 DIRECTIONALITY_FROM_UI, // Use the UI locale's text reading direction.
35 // Use the UI locale's text reading direction. 29 DIRECTIONALITY_FORCE_LTR, // Use LTR regardless of content or UI locale.
36 DIRECTIONALITY_FROM_UI, 30 DIRECTIONALITY_FORCE_RTL, // Use RTL regardless of content or UI locale.
37 // Use LTR regardless of content or UI locale.
38 DIRECTIONALITY_FORCE_LTR,
39 // Use RTL regardless of content or UI locale.
40 DIRECTIONALITY_FORCE_RTL,
41 }; 31 };
42 32
43 // Text styles and adornments. 33 // Text styles and adornments.
44 // TODO(msw): Merge with gfx::Font::FontStyle. 34 // TODO(msw): Merge with gfx::Font::FontStyle.
45 enum TextStyle { 35 enum TextStyle {
46 BOLD = 0, 36 BOLD = 0,
47 ITALIC, 37 ITALIC,
48 STRIKE, 38 STRIKE,
49 DIAGONAL_STRIKE, 39 DIAGONAL_STRIKE,
50 UNDERLINE, 40 UNDERLINE,
51 NUM_TEXT_STYLES, 41 NUM_TEXT_STYLES,
52 }; 42 };
53 43
44 // Elision behaviors of text that exceeds constrained dimensions.
45 enum ElideBehavior {
46 TRUNCATE = 0, // Do not elide or fade; the text may be truncated at the end.
47 ELIDE_HEAD, // Add an ellipsis at the start of the string.
48 ELIDE_MIDDLE, // Add an ellipsis in the middle of the string.
49 ELIDE_TAIL, // Add an ellipsis at the end of the string.
50 ELIDE_EMAIL, // Add ellipses to username and domain substrings.
51 FADE_TAIL, // Fade the string's end opposite of its horizontal alignment.
52 };
53
54 } // namespace gfx 54 } // namespace gfx
55 55
56 #endif // UI_GFX_TEXT_CONSTANTS_H_ 56 #endif // UI_GFX_TEXT_CONSTANTS_H_
OLDNEW
« no previous file with comments | « ui/gfx/render_text_unittest.cc ('k') | ui/gfx/text_elider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698