blob: ce95eeca82a967e14e874f6cf2aa28767bc7dc61 [file] [log] [blame]
Avi Drissman3e1a26c2022-09-15 20:26:031// Copyright 2019 The Chromium Authors
Kurt Catti-Schmidtf738bce2019-05-08 01:06:562// 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#include "ui/accessibility/ax_text_attributes.h"
Kurt Catti-Schmidtf738bce2019-05-08 01:06:566
Kurt Catti-Schmidtf738bce2019-05-08 01:06:567namespace ui {
Nektarios Paisiosc78cd722021-08-03 14:35:528
9AXTextAttributes::AXTextAttributes() = default;
10
11AXTextAttributes::~AXTextAttributes() = default;
Kurt Catti-Schmidtf738bce2019-05-08 01:06:5612
Nektarios Paisios70b6a5e52021-08-03 05:32:3613AXTextAttributes::AXTextAttributes(AXTextAttributes&& other)
Kurt Catti-Schmidtf738bce2019-05-08 01:06:5614 : background_color(other.background_color),
15 color(other.color),
16 invalid_state(other.invalid_state),
17 overline_style(other.overline_style),
18 strikethrough_style(other.strikethrough_style),
19 text_direction(other.text_direction),
20 text_position(other.text_position),
21 text_style(other.text_style),
22 underline_style(other.underline_style),
23 font_size(other.font_size),
24 font_weight(other.font_weight),
Benjamin Beaudry6d656d362022-02-24 21:21:5525 font_family(std::move(other.font_family)),
26 marker_types(std::move(other.marker_types)),
27 highlight_types(std::move(other.highlight_types)) {}
Kurt Catti-Schmidtf738bce2019-05-08 01:06:5628
Nektarios Paisios70b6a5e52021-08-03 05:32:3629AXTextAttributes& AXTextAttributes::operator=(AXTextAttributes&& other) {
Nektarios Paisiosc78cd722021-08-03 14:35:5230 if (this == &other)
31 return *this;
32
Kurt Catti-Schmidtf738bce2019-05-08 01:06:5633 background_color = other.background_color;
34 color = other.color;
35 invalid_state = other.invalid_state;
36 overline_style = other.overline_style;
37 strikethrough_style = other.strikethrough_style;
38 text_direction = other.text_direction;
39 text_position = other.text_position;
40 text_style = other.text_style;
41 underline_style = other.underline_style;
42 font_size = other.font_size;
43 font_weight = other.font_weight;
44 font_family = other.font_family;
Benjamin Beaudry6d656d362022-02-24 21:21:5545 marker_types = other.marker_types;
46 highlight_types = other.highlight_types;
Kurt Catti-Schmidtf738bce2019-05-08 01:06:5647
48 return *this;
49}
50
Nektarios Paisios70b6a5e52021-08-03 05:32:3651bool AXTextAttributes::operator==(const AXTextAttributes& other) const {
Benjamin Beaudry6d656d362022-02-24 21:21:5552 return background_color == other.background_color && color == other.color &&
53 invalid_state == other.invalid_state &&
54 overline_style == other.overline_style &&
55 strikethrough_style == other.strikethrough_style &&
56 text_direction == other.text_direction &&
57 text_position == other.text_position && font_size == other.font_size &&
58 font_weight == other.font_weight && text_style == other.text_style &&
59 underline_style == other.underline_style &&
60 font_family == other.font_family &&
61 marker_types == other.marker_types &&
62 highlight_types == other.highlight_types;
Kurt Catti-Schmidtf738bce2019-05-08 01:06:5663}
64
Nektarios Paisios70b6a5e52021-08-03 05:32:3665bool AXTextAttributes::operator!=(const AXTextAttributes& other) const {
Kurt Catti-Schmidtf738bce2019-05-08 01:06:5666 return !operator==(other);
67}
68
Nektarios Paisios70b6a5e52021-08-03 05:32:3669bool AXTextAttributes::IsUnset() const {
Benjamin Beaudry6d656d362022-02-24 21:21:5570 return background_color == kUnsetValue && invalid_state == kUnsetValue &&
71 overline_style == kUnsetValue && strikethrough_style == kUnsetValue &&
72 text_position == kUnsetValue && font_size == kUnsetValue &&
73 font_weight == kUnsetValue && text_style == kUnsetValue &&
74 underline_style == kUnsetValue && font_family.length() == 0 &&
75 marker_types.size() == 0 && highlight_types.size() == 0;
Kurt Catti-Schmidtf738bce2019-05-08 01:06:5676}
77
78} // namespace ui