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

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

// This file defines XDataView for type traits and can be included in
// _mojom_traits.h definitions but otherwise please use .mojom-forward.h,
// .mojom-shared.h or .mojom.h.

// IWYU pragma: private
// IWYU pragma: friend "traits"

#ifndef UI_ACCESSIBILITY_MOJOM_AX_ASSISTANT_STRUCTURE_MOJOM_DATA_VIEW_H_
#define UI_ACCESSIBILITY_MOJOM_AX_ASSISTANT_STRUCTURE_MOJOM_DATA_VIEW_H_

#include <stdint.h>

#include <functional>
#include <iosfwd>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"

#include "ui/accessibility/mojom/ax_assistant_structure.mojom-shared-internal.h"
#include "mojo/public/mojom/base/string16.mojom-shared.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared.h"
#include "ui/gfx/range/mojom/range.mojom-shared.h"
#include "url/mojom/url.mojom-shared.h"


namespace ax::mojom {
class AssistantTreeDataView;

class AssistantNodeDataView;

class AssistantExtraDataView;

class AssistantStructureDataView;



}  // ax::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::ax::mojom::AssistantTreeDataView> {
  using Data = ::ax::mojom::internal::AssistantTree_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::ax::mojom::AssistantNodeDataView> {
  using Data = ::ax::mojom::internal::AssistantNode_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::ax::mojom::AssistantExtraDataView> {
  using Data = ::ax::mojom::internal::AssistantExtra_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::ax::mojom::AssistantStructureDataView> {
  using Data = ::ax::mojom::internal::AssistantStructure_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


namespace ax::mojom {


class AssistantTreeDataView {
 public:
  AssistantTreeDataView() = default;

  AssistantTreeDataView(
      internal::AssistantTree_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetNodesDataView(
      mojo::ArrayDataView<AssistantNodeDataView>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadNodes(UserType* output) {
    
    auto* pointer = data_->nodes.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::ax::mojom::AssistantNodeDataView>>(
        pointer, output, message_);
  }
 private:
  internal::AssistantTree_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class AssistantNodeDataView {
 public:
  AssistantNodeDataView() = default;

  AssistantNodeDataView(
      internal::AssistantNode_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetChildrenIndicesDataView(
      mojo::ArrayDataView<int32_t>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadChildrenIndices(UserType* output) {
    
    auto* pointer = data_->children_indices.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<int32_t>>(
        pointer, output, message_);
  }
  inline void GetRectDataView(
      ::gfx::mojom::RectDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadRect(UserType* output) {
    
    auto* pointer = data_->rect.Get();
    return mojo::internal::Deserialize<::gfx::mojom::RectDataView>(
        pointer, output, message_);
  }
  inline void GetTextDataView(
      ::mojo_base::mojom::String16DataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadText(UserType* output) {
    
    auto* pointer = data_->text.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::String16DataView>(
        pointer, output, message_);
  }
  float text_size() const {
    return data_->text_size;
  }
  uint32_t color() const {
    return data_->color;
  }
  uint32_t bgcolor() const {
    return data_->bgcolor;
  }
  bool bold() const {
    return data_->bold;
  }
  bool italic() const {
    return data_->italic;
  }
  bool underline() const {
    return data_->underline;
  }
  bool line_through() const {
    return data_->line_through;
  }
  inline void GetSelectionDataView(
      ::gfx::mojom::RangeDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSelection(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::gfx::mojom::RangeDataView, UserType>(),
    "Attempting to read the optional `selection` field into a type which "
    "cannot represent a null value. Either wrap the destination object "
    "with std::optional, ensure that any corresponding "
    "{Struct/Union/Array/String}Traits define the necessary IsNull and "
    "SetToNull methods, or use `MaybeReadSelection` instead "
    "of `ReadSelection if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->selection.Get();
    return mojo::internal::Deserialize<::gfx::mojom::RangeDataView>(
        pointer, output, message_);
  }
  inline void GetClassNameDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadClassName(UserType* output) {
    
    auto* pointer = data_->class_name.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  inline void GetRoleDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadRole(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        mojo::StringDataView, UserType>(),
    "Attempting to read the optional `role` field into a type which "
    "cannot represent a null value. Either wrap the destination object "
    "with std::optional, ensure that any corresponding "
    "{Struct/Union/Array/String}Traits define the necessary IsNull and "
    "SetToNull methods, or use `MaybeReadRole` instead "
    "of `ReadRole if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->role.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
 private:
  internal::AssistantNode_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class AssistantExtraDataView {
 public:
  AssistantExtraDataView() = default;

  AssistantExtraDataView(
      internal::AssistantExtra_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetUrlDataView(
      ::url::mojom::UrlDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadUrl(UserType* output) {
    
    auto* pointer = data_->url.Get();
    return mojo::internal::Deserialize<::url::mojom::UrlDataView>(
        pointer, output, message_);
  }
  inline void GetBoundsPixelDataView(
      ::gfx::mojom::RectDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadBoundsPixel(UserType* output) {
    
    auto* pointer = data_->bounds_pixel.Get();
    return mojo::internal::Deserialize<::gfx::mojom::RectDataView>(
        pointer, output, message_);
  }
  inline void GetTitleDataView(
      ::mojo_base::mojom::String16DataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadTitle(UserType* output) {
    
    auto* pointer = data_->title.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::String16DataView>(
        pointer, output, message_);
  }
 private:
  internal::AssistantExtra_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class AssistantStructureDataView {
 public:
  AssistantStructureDataView() = default;

  AssistantStructureDataView(
      internal::AssistantStructure_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetAssistantTreeDataView(
      AssistantTreeDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadAssistantTree(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::ax::mojom::AssistantTreeDataView, UserType>(),
    "Attempting to read the optional `assistant_tree` field into a type which "
    "cannot represent a null value. Either wrap the destination object "
    "with std::optional, ensure that any corresponding "
    "{Struct/Union/Array/String}Traits define the necessary IsNull and "
    "SetToNull methods, or use `MaybeReadAssistantTree` instead "
    "of `ReadAssistantTree if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->assistant_tree.Get();
    return mojo::internal::Deserialize<::ax::mojom::AssistantTreeDataView>(
        pointer, output, message_);
  }
  inline void GetAssistantExtraDataView(
      AssistantExtraDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadAssistantExtra(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::ax::mojom::AssistantExtraDataView, UserType>(),
    "Attempting to read the optional `assistant_extra` field into a type which "
    "cannot represent a null value. Either wrap the destination object "
    "with std::optional, ensure that any corresponding "
    "{Struct/Union/Array/String}Traits define the necessary IsNull and "
    "SetToNull methods, or use `MaybeReadAssistantExtra` instead "
    "of `ReadAssistantExtra if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->assistant_extra.Get();
    return mojo::internal::Deserialize<::ax::mojom::AssistantExtraDataView>(
        pointer, output, message_);
  }
 private:
  internal::AssistantStructure_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


}  // ax::mojom

#endif  // UI_ACCESSIBILITY_MOJOM_AX_ASSISTANT_STRUCTURE_MOJOM_DATA_VIEW_H_