OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_VIEWS_STYLE_TYPOGRAPHY_H_ | 5 #ifndef UI_VIEWS_STYLE_TYPOGRAPHY_H_ |
6 #define UI_VIEWS_STYLE_TYPOGRAPHY_H_ | 6 #define UI_VIEWS_STYLE_TYPOGRAPHY_H_ |
7 | 7 |
8 #include "third_party/skia/include/core/SkColor.h" | 8 #include "third_party/skia/include/core/SkColor.h" |
9 #include "ui/views/views_export.h" | 9 #include "ui/views/views_export.h" |
10 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 class FontList; | 12 class FontList; |
13 } | 13 } |
14 | 14 |
| 15 namespace ui { |
| 16 class NativeTheme; |
| 17 } |
| 18 |
15 namespace views { | 19 namespace views { |
16 namespace style { | 20 namespace style { |
17 | 21 |
18 // Where a piece of text appears in the UI. This influences size and weight, but | 22 // Where a piece of text appears in the UI. This influences size and weight, but |
19 // typically not style or color. | 23 // typically not style or color. |
20 enum TextContext { | 24 enum TextContext { |
21 // Embedders can extend this enum with additional values that are understood | 25 // Embedders can extend this enum with additional values that are understood |
22 // by the TypographyProvider offered by their ViewsDelegate. Embedders define | 26 // by the TypographyProvider offered by their ViewsDelegate. Embedders define |
23 // enum values from VIEWS_TEXT_CONTEXT_END. Values named beginning with | 27 // enum values from VIEWS_TEXT_CONTEXT_END. Values named beginning with |
24 // "CONTEXT_" represent the actual TextContexts: the rest are markers. | 28 // "CONTEXT_" represent the actual TextContexts: the rest are markers. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // Hovered tab in a tabbed pane. | 81 // Hovered tab in a tabbed pane. |
78 STYLE_TAB_HOVERED, | 82 STYLE_TAB_HOVERED, |
79 | 83 |
80 // Inactive tab in a tabbed pane. | 84 // Inactive tab in a tabbed pane. |
81 STYLE_TAB_INACTIVE, | 85 STYLE_TAB_INACTIVE, |
82 | 86 |
83 // Embedders must start TextStyle enum values from here. | 87 // Embedders must start TextStyle enum values from here. |
84 VIEWS_TEXT_STYLE_END | 88 VIEWS_TEXT_STYLE_END |
85 }; | 89 }; |
86 | 90 |
87 // Helpers to obtain font properties from the TypographyProvider given by the | 91 // Helpers to obtain text properties from the TypographyProvider given by the |
88 // current ViewsDelegate. |context| can be an enum value from TextContext, or a | 92 // current ViewsDelegate. |text_context| can be an enum value from TextContext, |
89 // value understood by the embedder's TypographyProvider. Similarly, | 93 // or a value understood by the embedder's TypographyProvider. Similarly, |
90 // |text_style| corresponds to TextStyle. | 94 // |text_style| corresponds to TextStyle. |
91 VIEWS_EXPORT const gfx::FontList& GetFont(int text_context, int text_style); | 95 VIEWS_EXPORT const gfx::FontList& GetFont(int text_context, int text_style); |
92 VIEWS_EXPORT SkColor GetColor(int text_context, int text_style); | 96 VIEWS_EXPORT SkColor GetColor(int text_context, |
| 97 int text_style, |
| 98 const ui::NativeTheme* theme); |
93 VIEWS_EXPORT int GetLineHeight(int text_context, int text_style); | 99 VIEWS_EXPORT int GetLineHeight(int text_context, int text_style); |
94 | 100 |
95 } // namespace style | 101 } // namespace style |
96 } // namespace views | 102 } // namespace views |
97 | 103 |
98 #endif // UI_VIEWS_STYLE_TYPOGRAPHY_H_ | 104 #endif // UI_VIEWS_STYLE_TYPOGRAPHY_H_ |
OLD | NEW |