blob: e8678403cdb40cc5618a513a9300865ac57835bc [file] [log] [blame]
[email protected]46cb5382012-08-01 21:57:311// 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
3// found in the LICENSE file.
4
5#ifndef UI_GFX_TEXT_CONSTANTS_H_
6#define UI_GFX_TEXT_CONSTANTS_H_
7
8namespace gfx {
9
10// TODO(msw): Distinguish between logical character stops and glyph stops?
11// TODO(msw): Merge with base::i18n::BreakIterator::BreakType.
12enum BreakType {
[email protected]f3ce6212014-06-05 22:42:0813 CHARACTER_BREAK = 0, // Stop cursor movement on neighboring characters.
14 WORD_BREAK, // Stop cursor movement on nearest word boundaries.
15 LINE_BREAK, // Stop cursor movement on line ends as shown on screen.
[email protected]46cb5382012-08-01 21:57:3116};
17
18// Horizontal text alignment modes.
19enum HorizontalAlignment {
[email protected]f3ce6212014-06-05 22:42:0820 ALIGN_LEFT = 0, // Align the text's left edge with that of its display area.
21 ALIGN_CENTER, // 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.
[email protected]46cb5382012-08-01 21:57:3123};
24
[email protected]46cb5382012-08-01 21:57:3125// The directionality modes used to determine the base text direction.
26enum DirectionalityMode {
[email protected]f3ce6212014-06-05 22:42:0827 DIRECTIONALITY_FROM_TEXT = 0, // Use the first strong character's direction.
28 DIRECTIONALITY_FROM_UI, // Use the UI locale's text reading direction.
29 DIRECTIONALITY_FORCE_LTR, // Use LTR regardless of content or UI locale.
30 DIRECTIONALITY_FORCE_RTL, // Use RTL regardless of content or UI locale.
[email protected]46cb5382012-08-01 21:57:3131};
32
[email protected]ccfa43f02013-02-01 04:42:1733// Text styles and adornments.
34// TODO(msw): Merge with gfx::Font::FontStyle.
35enum TextStyle {
36 BOLD = 0,
37 ITALIC,
38 STRIKE,
39 DIAGONAL_STRIKE,
40 UNDERLINE,
41 NUM_TEXT_STYLES,
42};
43
[email protected]f3ce6212014-06-05 22:42:0844// Elision behaviors of text that exceeds constrained dimensions.
45enum 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
[email protected]46cb5382012-08-01 21:57:3154} // namespace gfx
55
56#endif // UI_GFX_TEXT_CONSTANTS_H_