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 
5 #ifndef UI_ACCESSIBILITY_AX_NODE_TEXT_STYLES_H_
6 #define UI_ACCESSIBILITY_AX_NODE_TEXT_STYLES_H_
7 
8 #include <string>
9 
10 #include "ui/accessibility/ax_base_export.h"
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.
18 struct AX_BASE_EXPORT AXNodeTextStyles {
19   AXNodeTextStyles();
20 
21   // Move-only class, explicitly delete copy-construction and assignment
22   AXNodeTextStyles(const AXNodeTextStyles& other) = delete;
23   AXNodeTextStyles& operator=(const AXNodeTextStyles&) = delete;
24 
25   // Move constructor and assignment
26   AXNodeTextStyles(AXNodeTextStyles&& other);
27   AXNodeTextStyles& operator=(AXNodeTextStyles&& other);
28 
29   bool operator==(const AXNodeTextStyles& other) const;
30 
31   bool operator!=(const AXNodeTextStyles& other) const;
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 
51 #endif  // UI_ACCESSIBILITY_AX_NODE_TEXT_STYLES_H_
52