blob: 3ce02c0bfeab935f1f4612a1ae179eb5196d154e [file] [log] [blame]
Kurt Catti-Schmidtf738bce2019-05-08 01:06:561// 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 Paisios70b6a5e52021-08-03 05:32:365#ifndef UI_ACCESSIBILITY_AX_TEXT_ATTRIBUTES_H_
6#define UI_ACCESSIBILITY_AX_TEXT_ATTRIBUTES_H_
Kurt Catti-Schmidtf738bce2019-05-08 01:06:567
8#include <string>
9
Dominic Mazzonif9182792020-04-01 22:52:3110#include "ui/accessibility/ax_base_export.h"
Kurt Catti-Schmidtf738bce2019-05-08 01:06:5611
12namespace 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 Paisios70b6a5e52021-08-03 05:32:3618struct AX_BASE_EXPORT AXTextAttributes {
19 AXTextAttributes();
Kurt Catti-Schmidtf738bce2019-05-08 01:06:5620
21 // Move-only class, explicitly delete copy-construction and assignment
Nektarios Paisios70b6a5e52021-08-03 05:32:3622 AXTextAttributes(const AXTextAttributes& other) = delete;
23 AXTextAttributes& operator=(const AXTextAttributes&) = delete;
Kurt Catti-Schmidtf738bce2019-05-08 01:06:5624
25 // Move constructor and assignment
Nektarios Paisios70b6a5e52021-08-03 05:32:3626 AXTextAttributes(AXTextAttributes&& other);
27 AXTextAttributes& operator=(AXTextAttributes&& other);
Kurt Catti-Schmidtf738bce2019-05-08 01:06:5628
Nektarios Paisios70b6a5e52021-08-03 05:32:3629 bool operator==(const AXTextAttributes& other) const;
Kurt Catti-Schmidtf738bce2019-05-08 01:06:5630
Nektarios Paisios70b6a5e52021-08-03 05:32:3631 bool operator!=(const AXTextAttributes& other) const;
Kurt Catti-Schmidtf738bce2019-05-08 01:06:5632
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 Paisios70b6a5e52021-08-03 05:32:3651#endif // UI_ACCESSIBILITY_AX_TEXT_ATTRIBUTES_H_