// ui/accessibility/mojom/ax_assistant_structure.mojom.h is auto generated by mojom_bindings_generator.py, do not edit

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_ACCESSIBILITY_MOJOM_AX_ASSISTANT_STRUCTURE_MOJOM_H_
#define UI_ACCESSIBILITY_MOJOM_AX_ASSISTANT_STRUCTURE_MOJOM_H_

#include <stdint.h>

#include <limits>
#include <optional>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/clone_traits.h"
#include "mojo/public/cpp/bindings/equals_traits.h"
#include "mojo/public/cpp/bindings/struct_ptr.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/cpp/bindings/union_traits.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"

#include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h"

#include "ui/accessibility/mojom/ax_assistant_structure.mojom-features.h"  // IWYU pragma: export
#include "ui/accessibility/mojom/ax_assistant_structure.mojom-shared.h"  // IWYU pragma: export
#include "ui/accessibility/mojom/ax_assistant_structure.mojom-forward.h"  // IWYU pragma: export
#include "mojo/public/mojom/base/string16.mojom.h"
#include "ui/gfx/geometry/mojom/geometry.mojom.h"
#include "ui/gfx/range/mojom/range.mojom.h"
#include "url/mojom/url.mojom.h"
#include <string>
#include <vector>




#include "ui/accessibility/mojom/ax_assistant_structure_mojom_traits.h"




namespace ax::mojom {











class  AssistantTree {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<AssistantTree, T>::value>;
  using DataView = AssistantTreeDataView;
  using Data_ = internal::AssistantTree_Data;

  template <typename... Args>
  static AssistantTreePtr New(Args&&... args) {
    return AssistantTreePtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static AssistantTreePtr From(const U& u) {
    return mojo::TypeConverter<AssistantTreePtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, AssistantTree>::Convert(*this);
  }


  AssistantTree();

  explicit AssistantTree(
      std::vector<::std::unique_ptr<::ui::AssistantNode>> nodes);

AssistantTree(const AssistantTree&) = delete;
AssistantTree& operator=(const AssistantTree&) = delete;

  ~AssistantTree();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = AssistantTreePtr>
  AssistantTreePtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, AssistantTree::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, AssistantTree::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, AssistantTree::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        AssistantTree::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        AssistantTree::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        AssistantTree::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::AssistantTree_UnserializedMessageContext<
            UserType, AssistantTree::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<AssistantTree::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return AssistantTree::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::AssistantTree_UnserializedMessageContext<
            UserType, AssistantTree::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<AssistantTree::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::vector<::std::unique_ptr<::ui::AssistantNode>> nodes;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, AssistantTree::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, AssistantTree::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, AssistantTree::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, AssistantTree::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class  AssistantNode {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<AssistantNode, T>::value>;
  using DataView = AssistantNodeDataView;
  using Data_ = internal::AssistantNode_Data;

  template <typename... Args>
  static AssistantNodePtr New(Args&&... args) {
    return AssistantNodePtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static AssistantNodePtr From(const U& u) {
    return mojo::TypeConverter<AssistantNodePtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, AssistantNode>::Convert(*this);
  }


  AssistantNode();

  AssistantNode(
      std::vector<int32_t> children_indices,
      const ::gfx::Rect& rect,
      const ::std::u16string& text,
      float text_size,
      uint32_t color,
      uint32_t bgcolor,
      bool bold,
      bool italic,
      bool underline,
      bool line_through,
      const std::optional<::gfx::Range>& selection,
      const std::string& class_name,
      const std::optional<std::string>& role);


  ~AssistantNode();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = AssistantNodePtr>
  AssistantNodePtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, AssistantNode::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, AssistantNode::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, AssistantNode::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        AssistantNode::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        AssistantNode::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        AssistantNode::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::AssistantNode_UnserializedMessageContext<
            UserType, AssistantNode::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<AssistantNode::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return AssistantNode::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::AssistantNode_UnserializedMessageContext<
            UserType, AssistantNode::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<AssistantNode::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  std::vector<int32_t> children_indices;
  
  ::gfx::Rect rect;
  
  ::std::u16string text;
  
  float text_size;
  
  uint32_t color;
  
  uint32_t bgcolor;
  
  bool bold;
  
  bool italic;
  
  bool underline;
  
  bool line_through;
  
  std::optional<::gfx::Range> selection;
  
  std::string class_name;
  
  std::optional<std::string> role;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, AssistantNode::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, AssistantNode::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, AssistantNode::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, AssistantNode::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class  AssistantExtra {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<AssistantExtra, T>::value>;
  using DataView = AssistantExtraDataView;
  using Data_ = internal::AssistantExtra_Data;

  template <typename... Args>
  static AssistantExtraPtr New(Args&&... args) {
    return AssistantExtraPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static AssistantExtraPtr From(const U& u) {
    return mojo::TypeConverter<AssistantExtraPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, AssistantExtra>::Convert(*this);
  }


  AssistantExtra();

  AssistantExtra(
      const ::GURL& url,
      const ::gfx::Rect& bounds_pixel,
      const ::std::u16string& title);


  ~AssistantExtra();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = AssistantExtraPtr>
  AssistantExtraPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, AssistantExtra::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, AssistantExtra::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, AssistantExtra::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        AssistantExtra::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        AssistantExtra::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        AssistantExtra::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::AssistantExtra_UnserializedMessageContext<
            UserType, AssistantExtra::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<AssistantExtra::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return AssistantExtra::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::AssistantExtra_UnserializedMessageContext<
            UserType, AssistantExtra::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<AssistantExtra::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::GURL url;
  
  ::gfx::Rect bounds_pixel;
  
  ::std::u16string title;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, AssistantExtra::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, AssistantExtra::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, AssistantExtra::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, AssistantExtra::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class  AssistantStructure {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<AssistantStructure, T>::value>;
  using DataView = AssistantStructureDataView;
  using Data_ = internal::AssistantStructure_Data;

  template <typename... Args>
  static AssistantStructurePtr New(Args&&... args) {
    return AssistantStructurePtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static AssistantStructurePtr From(const U& u) {
    return mojo::TypeConverter<AssistantStructurePtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, AssistantStructure>::Convert(*this);
  }


  AssistantStructure();

  AssistantStructure(
      ::std::unique_ptr<::ui::AssistantTree> assistant_tree,
      AssistantExtraPtr assistant_extra);

AssistantStructure(const AssistantStructure&) = delete;
AssistantStructure& operator=(const AssistantStructure&) = delete;

  ~AssistantStructure();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = AssistantStructurePtr>
  AssistantStructurePtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, AssistantStructure::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, AssistantStructure::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, AssistantStructure::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        AssistantStructure::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        AssistantStructure::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        AssistantStructure::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::AssistantStructure_UnserializedMessageContext<
            UserType, AssistantStructure::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<AssistantStructure::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return AssistantStructure::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::AssistantStructure_UnserializedMessageContext<
            UserType, AssistantStructure::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<AssistantStructure::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ::std::unique_ptr<::ui::AssistantTree> assistant_tree;
  
  AssistantExtraPtr assistant_extra;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, AssistantStructure::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, AssistantStructure::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, AssistantStructure::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, AssistantStructure::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}

template <typename StructPtrType>
AssistantTreePtr AssistantTree::Clone() const {
  return New(
      mojo::Clone(nodes)
  );
}

template <typename T, AssistantTree::EnableIfSame<T>*>
bool AssistantTree::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->nodes, other_struct.nodes))
    return false;
  return true;
}

template <typename T, AssistantTree::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.nodes < rhs.nodes)
    return true;
  if (rhs.nodes < lhs.nodes)
    return false;
  return false;
}
template <typename StructPtrType>
AssistantNodePtr AssistantNode::Clone() const {
  return New(
      mojo::Clone(children_indices),
      mojo::Clone(rect),
      mojo::Clone(text),
      mojo::Clone(text_size),
      mojo::Clone(color),
      mojo::Clone(bgcolor),
      mojo::Clone(bold),
      mojo::Clone(italic),
      mojo::Clone(underline),
      mojo::Clone(line_through),
      mojo::Clone(selection),
      mojo::Clone(class_name),
      mojo::Clone(role)
  );
}

template <typename T, AssistantNode::EnableIfSame<T>*>
bool AssistantNode::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->children_indices, other_struct.children_indices))
    return false;
  if (!mojo::Equals(this->rect, other_struct.rect))
    return false;
  if (!mojo::Equals(this->text, other_struct.text))
    return false;
  if (!mojo::Equals(this->text_size, other_struct.text_size))
    return false;
  if (!mojo::Equals(this->color, other_struct.color))
    return false;
  if (!mojo::Equals(this->bgcolor, other_struct.bgcolor))
    return false;
  if (!mojo::Equals(this->bold, other_struct.bold))
    return false;
  if (!mojo::Equals(this->italic, other_struct.italic))
    return false;
  if (!mojo::Equals(this->underline, other_struct.underline))
    return false;
  if (!mojo::Equals(this->line_through, other_struct.line_through))
    return false;
  if (!mojo::Equals(this->selection, other_struct.selection))
    return false;
  if (!mojo::Equals(this->class_name, other_struct.class_name))
    return false;
  if (!mojo::Equals(this->role, other_struct.role))
    return false;
  return true;
}

template <typename T, AssistantNode::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.children_indices < rhs.children_indices)
    return true;
  if (rhs.children_indices < lhs.children_indices)
    return false;
  if (lhs.rect < rhs.rect)
    return true;
  if (rhs.rect < lhs.rect)
    return false;
  if (lhs.text < rhs.text)
    return true;
  if (rhs.text < lhs.text)
    return false;
  if (lhs.text_size < rhs.text_size)
    return true;
  if (rhs.text_size < lhs.text_size)
    return false;
  if (lhs.color < rhs.color)
    return true;
  if (rhs.color < lhs.color)
    return false;
  if (lhs.bgcolor < rhs.bgcolor)
    return true;
  if (rhs.bgcolor < lhs.bgcolor)
    return false;
  if (lhs.bold < rhs.bold)
    return true;
  if (rhs.bold < lhs.bold)
    return false;
  if (lhs.italic < rhs.italic)
    return true;
  if (rhs.italic < lhs.italic)
    return false;
  if (lhs.underline < rhs.underline)
    return true;
  if (rhs.underline < lhs.underline)
    return false;
  if (lhs.line_through < rhs.line_through)
    return true;
  if (rhs.line_through < lhs.line_through)
    return false;
  if (lhs.selection < rhs.selection)
    return true;
  if (rhs.selection < lhs.selection)
    return false;
  if (lhs.class_name < rhs.class_name)
    return true;
  if (rhs.class_name < lhs.class_name)
    return false;
  if (lhs.role < rhs.role)
    return true;
  if (rhs.role < lhs.role)
    return false;
  return false;
}
template <typename StructPtrType>
AssistantExtraPtr AssistantExtra::Clone() const {
  return New(
      mojo::Clone(url),
      mojo::Clone(bounds_pixel),
      mojo::Clone(title)
  );
}

template <typename T, AssistantExtra::EnableIfSame<T>*>
bool AssistantExtra::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->url, other_struct.url))
    return false;
  if (!mojo::Equals(this->bounds_pixel, other_struct.bounds_pixel))
    return false;
  if (!mojo::Equals(this->title, other_struct.title))
    return false;
  return true;
}

template <typename T, AssistantExtra::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.url < rhs.url)
    return true;
  if (rhs.url < lhs.url)
    return false;
  if (lhs.bounds_pixel < rhs.bounds_pixel)
    return true;
  if (rhs.bounds_pixel < lhs.bounds_pixel)
    return false;
  if (lhs.title < rhs.title)
    return true;
  if (rhs.title < lhs.title)
    return false;
  return false;
}
template <typename StructPtrType>
AssistantStructurePtr AssistantStructure::Clone() const {
  return New(
      mojo::Clone(assistant_tree),
      mojo::Clone(assistant_extra)
  );
}

template <typename T, AssistantStructure::EnableIfSame<T>*>
bool AssistantStructure::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->assistant_tree, other_struct.assistant_tree))
    return false;
  if (!mojo::Equals(this->assistant_extra, other_struct.assistant_extra))
    return false;
  return true;
}

template <typename T, AssistantStructure::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.assistant_tree < rhs.assistant_tree)
    return true;
  if (rhs.assistant_tree < lhs.assistant_tree)
    return false;
  if (lhs.assistant_extra < rhs.assistant_extra)
    return true;
  if (rhs.assistant_extra < lhs.assistant_extra)
    return false;
  return false;
}


}  // ax::mojom

namespace mojo {


template <>
struct  StructTraits<::ax::mojom::AssistantTree::DataView,
                                         ::ax::mojom::AssistantTreePtr> {
  static bool IsNull(const ::ax::mojom::AssistantTreePtr& input) { return !input; }
  static void SetToNull(::ax::mojom::AssistantTreePtr* output) { output->reset(); }

  static const decltype(::ax::mojom::AssistantTree::nodes)& nodes(
      const ::ax::mojom::AssistantTreePtr& input) {
    return input->nodes;
  }

  static bool Read(::ax::mojom::AssistantTree::DataView input, ::ax::mojom::AssistantTreePtr* output);
};


template <>
struct  StructTraits<::ax::mojom::AssistantNode::DataView,
                                         ::ax::mojom::AssistantNodePtr> {
  static bool IsNull(const ::ax::mojom::AssistantNodePtr& input) { return !input; }
  static void SetToNull(::ax::mojom::AssistantNodePtr* output) { output->reset(); }

  static const decltype(::ax::mojom::AssistantNode::children_indices)& children_indices(
      const ::ax::mojom::AssistantNodePtr& input) {
    return input->children_indices;
  }

  static const decltype(::ax::mojom::AssistantNode::rect)& rect(
      const ::ax::mojom::AssistantNodePtr& input) {
    return input->rect;
  }

  static const decltype(::ax::mojom::AssistantNode::text)& text(
      const ::ax::mojom::AssistantNodePtr& input) {
    return input->text;
  }

  static decltype(::ax::mojom::AssistantNode::text_size) text_size(
      const ::ax::mojom::AssistantNodePtr& input) {
    return input->text_size;
  }

  static decltype(::ax::mojom::AssistantNode::color) color(
      const ::ax::mojom::AssistantNodePtr& input) {
    return input->color;
  }

  static decltype(::ax::mojom::AssistantNode::bgcolor) bgcolor(
      const ::ax::mojom::AssistantNodePtr& input) {
    return input->bgcolor;
  }

  static decltype(::ax::mojom::AssistantNode::bold) bold(
      const ::ax::mojom::AssistantNodePtr& input) {
    return input->bold;
  }

  static decltype(::ax::mojom::AssistantNode::italic) italic(
      const ::ax::mojom::AssistantNodePtr& input) {
    return input->italic;
  }

  static decltype(::ax::mojom::AssistantNode::underline) underline(
      const ::ax::mojom::AssistantNodePtr& input) {
    return input->underline;
  }

  static decltype(::ax::mojom::AssistantNode::line_through) line_through(
      const ::ax::mojom::AssistantNodePtr& input) {
    return input->line_through;
  }

  static const decltype(::ax::mojom::AssistantNode::selection)& selection(
      const ::ax::mojom::AssistantNodePtr& input) {
    return input->selection;
  }

  static const decltype(::ax::mojom::AssistantNode::class_name)& class_name(
      const ::ax::mojom::AssistantNodePtr& input) {
    return input->class_name;
  }

  static const decltype(::ax::mojom::AssistantNode::role)& role(
      const ::ax::mojom::AssistantNodePtr& input) {
    return input->role;
  }

  static bool Read(::ax::mojom::AssistantNode::DataView input, ::ax::mojom::AssistantNodePtr* output);
};


template <>
struct  StructTraits<::ax::mojom::AssistantExtra::DataView,
                                         ::ax::mojom::AssistantExtraPtr> {
  static bool IsNull(const ::ax::mojom::AssistantExtraPtr& input) { return !input; }
  static void SetToNull(::ax::mojom::AssistantExtraPtr* output) { output->reset(); }

  static const decltype(::ax::mojom::AssistantExtra::url)& url(
      const ::ax::mojom::AssistantExtraPtr& input) {
    return input->url;
  }

  static const decltype(::ax::mojom::AssistantExtra::bounds_pixel)& bounds_pixel(
      const ::ax::mojom::AssistantExtraPtr& input) {
    return input->bounds_pixel;
  }

  static const decltype(::ax::mojom::AssistantExtra::title)& title(
      const ::ax::mojom::AssistantExtraPtr& input) {
    return input->title;
  }

  static bool Read(::ax::mojom::AssistantExtra::DataView input, ::ax::mojom::AssistantExtraPtr* output);
};


template <>
struct  StructTraits<::ax::mojom::AssistantStructure::DataView,
                                         ::ax::mojom::AssistantStructurePtr> {
  static bool IsNull(const ::ax::mojom::AssistantStructurePtr& input) { return !input; }
  static void SetToNull(::ax::mojom::AssistantStructurePtr* output) { output->reset(); }

  static const decltype(::ax::mojom::AssistantStructure::assistant_tree)& assistant_tree(
      const ::ax::mojom::AssistantStructurePtr& input) {
    return input->assistant_tree;
  }

  static const decltype(::ax::mojom::AssistantStructure::assistant_extra)& assistant_extra(
      const ::ax::mojom::AssistantStructurePtr& input) {
    return input->assistant_extra;
  }

  static bool Read(::ax::mojom::AssistantStructure::DataView input, ::ax::mojom::AssistantStructurePtr* output);
};

}  // namespace mojo

#endif  // UI_ACCESSIBILITY_MOJOM_AX_ASSISTANT_STRUCTURE_MOJOM_H_