Kurt Catti-Schmidt | f738bce | 2019-05-08 01:06:56 | [diff] [blame] | 1 | // Copyright 2019 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 | |
Nektarios Paisios | 70b6a5e5 | 2021-08-03 05:32:36 | [diff] [blame^] | 5 | #ifndef UI_ACCESSIBILITY_AX_TEXT_ATTRIBUTES_H_ |
| 6 | #define UI_ACCESSIBILITY_AX_TEXT_ATTRIBUTES_H_ |
Kurt Catti-Schmidt | f738bce | 2019-05-08 01:06:56 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | |
Dominic Mazzoni | f918279 | 2020-04-01 22:52:31 | [diff] [blame] | 10 | #include "ui/accessibility/ax_base_export.h" |
Kurt Catti-Schmidt | f738bce | 2019-05-08 01:06:56 | [diff] [blame] | 11 | |
| 12 | namespace ui { |
| 13 | |
| 14 | // A compact representation of text styles on an AXNode. This data represents |
| 15 | // a snapshot at a given time and is not intended to be held for periods of |
| 16 | // time. For this reason, it is a move-only class, to encourage deliberate |
| 17 | // short-term usage. |
Nektarios Paisios | 70b6a5e5 | 2021-08-03 05:32:36 | [diff] [blame^] | 18 | struct AX_BASE_EXPORT AXTextAttributes { |
| 19 | AXTextAttributes(); |
Kurt Catti-Schmidt | f738bce | 2019-05-08 01:06:56 | [diff] [blame] | 20 | |
| 21 | // Move-only class, explicitly delete copy-construction and assignment |
Nektarios Paisios | 70b6a5e5 | 2021-08-03 05:32:36 | [diff] [blame^] | 22 | AXTextAttributes(const AXTextAttributes& other) = delete; |
| 23 | AXTextAttributes& operator=(const AXTextAttributes&) = delete; |
Kurt Catti-Schmidt | f738bce | 2019-05-08 01:06:56 | [diff] [blame] | 24 | |
| 25 | // Move constructor and assignment |
Nektarios Paisios | 70b6a5e5 | 2021-08-03 05:32:36 | [diff] [blame^] | 26 | AXTextAttributes(AXTextAttributes&& other); |
| 27 | AXTextAttributes& operator=(AXTextAttributes&& other); |
Kurt Catti-Schmidt | f738bce | 2019-05-08 01:06:56 | [diff] [blame] | 28 | |
Nektarios Paisios | 70b6a5e5 | 2021-08-03 05:32:36 | [diff] [blame^] | 29 | bool operator==(const AXTextAttributes& other) const; |
Kurt Catti-Schmidt | f738bce | 2019-05-08 01:06:56 | [diff] [blame] | 30 | |
Nektarios Paisios | 70b6a5e5 | 2021-08-03 05:32:36 | [diff] [blame^] | 31 | bool operator!=(const AXTextAttributes& other) const; |
Kurt Catti-Schmidt | f738bce | 2019-05-08 01:06:56 | [diff] [blame] | 32 | |
| 33 | bool IsUnset() const; |
| 34 | |
| 35 | int32_t background_color; |
| 36 | int32_t color; |
| 37 | int32_t invalid_state; |
| 38 | int32_t overline_style; |
| 39 | int32_t strikethrough_style; |
| 40 | int32_t text_direction; |
| 41 | int32_t text_position; |
| 42 | int32_t text_style; |
| 43 | int32_t underline_style; |
| 44 | float font_size; |
| 45 | float font_weight; |
| 46 | std::string font_family; |
| 47 | }; |
| 48 | |
| 49 | } // namespace ui |
| 50 | |
Nektarios Paisios | 70b6a5e5 | 2021-08-03 05:32:36 | [diff] [blame^] | 51 | #endif // UI_ACCESSIBILITY_AX_TEXT_ATTRIBUTES_H_ |