// third_party/blink/public/mojom/annotation/annotation.mojom-params-data.h is auto generated by mojom_bindings_generator.py, do not edit

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

#ifndef THIRD_PARTY_BLINK_PUBLIC_MOJOM_ANNOTATION_ANNOTATION_MOJOM_PARAMS_DATA_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_ANNOTATION_ANNOTATION_MOJOM_PARAMS_DATA_H_
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "mojo/public/cpp/bindings/map_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif

namespace mojo::internal {
class ValidationContext;
}


namespace blink::mojom {
namespace internal {
class COMPONENT_EXPORT(MOJOM_SHARED_BLINK_COMMON_EXPORT) AnnotationAgent_ScrollIntoView_Params_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  uint8_t applies_focus : 1;
  uint8_t padfinal_[7];

 private:
  friend class mojo::internal::MessageFragment<AnnotationAgent_ScrollIntoView_Params_Data>;

  AnnotationAgent_ScrollIntoView_Params_Data();
  ~AnnotationAgent_ScrollIntoView_Params_Data() = delete;
};
static_assert(sizeof(AnnotationAgent_ScrollIntoView_Params_Data) == 16,
              "Bad sizeof(AnnotationAgent_ScrollIntoView_Params_Data)");
class COMPONENT_EXPORT(MOJOM_SHARED_BLINK_COMMON_EXPORT) AnnotationAgentHost_DidFinishAttachment_Params_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  mojo::internal::Pointer<::gfx::mojom::internal::Rect_Data> document_relative_rect;
  int32_t attachment_result;
  uint8_t padfinal_[4];

 private:
  friend class mojo::internal::MessageFragment<AnnotationAgentHost_DidFinishAttachment_Params_Data>;

  AnnotationAgentHost_DidFinishAttachment_Params_Data();
  ~AnnotationAgentHost_DidFinishAttachment_Params_Data() = delete;
};
static_assert(sizeof(AnnotationAgentHost_DidFinishAttachment_Params_Data) == 24,
              "Bad sizeof(AnnotationAgentHost_DidFinishAttachment_Params_Data)");
class COMPONENT_EXPORT(MOJOM_SHARED_BLINK_COMMON_EXPORT) AnnotationAgentContainer_CreateAgent_Params_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  mojo::internal::Interface_Data host_remote;
  mojo::internal::Handle_Data agent_receiver;
  int32_t type;
  internal::Selector_Data selector;
  uint8_t search_range_start_node_id_$flag : 1;
  uint8_t pad4_[3];
  int32_t search_range_start_node_id_$value;

 private:
  friend class mojo::internal::MessageFragment<AnnotationAgentContainer_CreateAgent_Params_Data>;

  AnnotationAgentContainer_CreateAgent_Params_Data();
  ~AnnotationAgentContainer_CreateAgent_Params_Data() = delete;
};
static_assert(sizeof(AnnotationAgentContainer_CreateAgent_Params_Data) == 48,
              "Bad sizeof(AnnotationAgentContainer_CreateAgent_Params_Data)");
class COMPONENT_EXPORT(MOJOM_SHARED_BLINK_COMMON_EXPORT) AnnotationAgentContainer_CreateAgentFromSelection_Params_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  int32_t type;
  uint8_t padfinal_[4];

 private:
  friend class mojo::internal::MessageFragment<AnnotationAgentContainer_CreateAgentFromSelection_Params_Data>;

  AnnotationAgentContainer_CreateAgentFromSelection_Params_Data();
  ~AnnotationAgentContainer_CreateAgentFromSelection_Params_Data() = delete;
};
static_assert(sizeof(AnnotationAgentContainer_CreateAgentFromSelection_Params_Data) == 16,
              "Bad sizeof(AnnotationAgentContainer_CreateAgentFromSelection_Params_Data)");
class COMPONENT_EXPORT(MOJOM_SHARED_BLINK_COMMON_EXPORT) AnnotationAgentContainer_CreateAgentFromSelection_ResponseParams_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  mojo::internal::Pointer<internal::SelectorCreationResult_Data> result;
  int32_t error;
  int32_t ready_status;

 private:
  friend class mojo::internal::MessageFragment<AnnotationAgentContainer_CreateAgentFromSelection_ResponseParams_Data>;

  AnnotationAgentContainer_CreateAgentFromSelection_ResponseParams_Data();
  ~AnnotationAgentContainer_CreateAgentFromSelection_ResponseParams_Data() = delete;
};
static_assert(sizeof(AnnotationAgentContainer_CreateAgentFromSelection_ResponseParams_Data) == 24,
              "Bad sizeof(AnnotationAgentContainer_CreateAgentFromSelection_ResponseParams_Data)");
class COMPONENT_EXPORT(MOJOM_SHARED_BLINK_COMMON_EXPORT) AnnotationAgentContainer_RemoveAgentsOfType_Params_Data {
 public:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);

  mojo::internal::StructHeader header_;
  int32_t type;
  uint8_t padfinal_[4];

 private:
  friend class mojo::internal::MessageFragment<AnnotationAgentContainer_RemoveAgentsOfType_Params_Data>;

  AnnotationAgentContainer_RemoveAgentsOfType_Params_Data();
  ~AnnotationAgentContainer_RemoveAgentsOfType_Params_Data() = delete;
};
static_assert(sizeof(AnnotationAgentContainer_RemoveAgentsOfType_Params_Data) == 16,
              "Bad sizeof(AnnotationAgentContainer_RemoveAgentsOfType_Params_Data)");

}  // namespace internal


class AnnotationAgent_ScrollIntoView_ParamsDataView {
 public:
  AnnotationAgent_ScrollIntoView_ParamsDataView() = default;

  AnnotationAgent_ScrollIntoView_ParamsDataView(
      internal::AnnotationAgent_ScrollIntoView_Params_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  bool applies_focus() const {
    return data_->applies_focus;
  }
 private:
  internal::AnnotationAgent_ScrollIntoView_Params_Data* data_ = nullptr;
};


class AnnotationAgentHost_DidFinishAttachment_ParamsDataView {
 public:
  AnnotationAgentHost_DidFinishAttachment_ParamsDataView() = default;

  AnnotationAgentHost_DidFinishAttachment_ParamsDataView(
      internal::AnnotationAgentHost_DidFinishAttachment_Params_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetDocumentRelativeRectDataView(
      ::gfx::mojom::RectDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadDocumentRelativeRect(UserType* output) {
    
    auto* pointer = data_->document_relative_rect.Get();
    return mojo::internal::Deserialize<::gfx::mojom::RectDataView>(
        pointer, output, message_);
  }
  template <typename UserType>
  [[nodiscard]] bool ReadAttachmentResult(UserType* output) const {
    auto data_value = data_->attachment_result;
    return mojo::internal::Deserialize<::blink::mojom::AttachmentResult>(
        data_value, output);
  }
  AttachmentResult attachment_result() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::blink::mojom::AttachmentResult>(data_->attachment_result));
  }
 private:
  internal::AnnotationAgentHost_DidFinishAttachment_Params_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class AnnotationAgentContainer_CreateAgent_ParamsDataView {
 public:
  AnnotationAgentContainer_CreateAgent_ParamsDataView() = default;

  AnnotationAgentContainer_CreateAgent_ParamsDataView(
      internal::AnnotationAgentContainer_CreateAgent_Params_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  UserType TakeHostRemote() {
    UserType result;
    bool ret =
        mojo::internal::Deserialize<mojo::InterfacePtrDataView<::blink::mojom::AnnotationAgentHostInterfaceBase>>(
            &data_->host_remote, &result, message_);
    DCHECK(ret);
    return result;
  }
  template <typename UserType>
  UserType TakeAgentReceiver() {
    UserType result;
    bool ret =
        mojo::internal::Deserialize<mojo::InterfaceRequestDataView<::blink::mojom::AnnotationAgentInterfaceBase>>(
            &data_->agent_receiver, &result, message_);
    DCHECK(ret);
    return result;
  }
  template <typename UserType>
  [[nodiscard]] bool ReadType(UserType* output) const {
    auto data_value = data_->type;
    return mojo::internal::Deserialize<::blink::mojom::AnnotationType>(
        data_value, output);
  }
  AnnotationType type() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::blink::mojom::AnnotationType>(data_->type));
  }
  inline void GetSelectorDataView(
      SelectorDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSelector(UserType* output) {
    
    auto* pointer = !data_->selector.is_null() ? &data_->selector : nullptr;
    return mojo::internal::Deserialize<::blink::mojom::SelectorDataView>(
        pointer, output, message_);
  }
  std::optional<int32_t> search_range_start_node_id() const {

    return data_->search_range_start_node_id_$flag
        ? std::make_optional(data_->search_range_start_node_id_$value)
        : std::nullopt;
  }
 private:
  internal::AnnotationAgentContainer_CreateAgent_Params_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class AnnotationAgentContainer_CreateAgentFromSelection_ParamsDataView {
 public:
  AnnotationAgentContainer_CreateAgentFromSelection_ParamsDataView() = default;

  AnnotationAgentContainer_CreateAgentFromSelection_ParamsDataView(
      internal::AnnotationAgentContainer_CreateAgentFromSelection_Params_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  [[nodiscard]] bool ReadType(UserType* output) const {
    auto data_value = data_->type;
    return mojo::internal::Deserialize<::blink::mojom::AnnotationType>(
        data_value, output);
  }
  AnnotationType type() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::blink::mojom::AnnotationType>(data_->type));
  }
 private:
  internal::AnnotationAgentContainer_CreateAgentFromSelection_Params_Data* data_ = nullptr;
};


class AnnotationAgentContainer_CreateAgentFromSelection_ResponseParamsDataView {
 public:
  AnnotationAgentContainer_CreateAgentFromSelection_ResponseParamsDataView() = default;

  AnnotationAgentContainer_CreateAgentFromSelection_ResponseParamsDataView(
      internal::AnnotationAgentContainer_CreateAgentFromSelection_ResponseParams_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetResultDataView(
      SelectorCreationResultDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadResult(UserType* output) {
    
static_assert(
    mojo::internal::IsValidUserTypeForOptionalValue<
        ::blink::mojom::SelectorCreationResultDataView, UserType>(),
    "Attempting to read the optional `result` 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 `MaybeReadResult` instead "
    "of `ReadResult if you're fine with null values being "
    "silently ignored in this case.");
    auto* pointer = data_->result.Get();
    return mojo::internal::Deserialize<::blink::mojom::SelectorCreationResultDataView>(
        pointer, output, message_);
  }
  template <typename UserType>
  [[nodiscard]] bool ReadError(UserType* output) const {
    auto data_value = data_->error;
    return mojo::internal::Deserialize<::blink::mojom::LinkGenerationError>(
        data_value, output);
  }
  ::blink::mojom::LinkGenerationError error() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::blink::mojom::LinkGenerationError>(data_->error));
  }
  template <typename UserType>
  [[nodiscard]] bool ReadReadyStatus(UserType* output) const {
    auto data_value = data_->ready_status;
    return mojo::internal::Deserialize<::blink::mojom::LinkGenerationReadyStatus>(
        data_value, output);
  }
  ::blink::mojom::LinkGenerationReadyStatus ready_status() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::blink::mojom::LinkGenerationReadyStatus>(data_->ready_status));
  }
 private:
  internal::AnnotationAgentContainer_CreateAgentFromSelection_ResponseParams_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class AnnotationAgentContainer_RemoveAgentsOfType_ParamsDataView {
 public:
  AnnotationAgentContainer_RemoveAgentsOfType_ParamsDataView() = default;

  AnnotationAgentContainer_RemoveAgentsOfType_ParamsDataView(
      internal::AnnotationAgentContainer_RemoveAgentsOfType_Params_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  [[nodiscard]] bool ReadType(UserType* output) const {
    auto data_value = data_->type;
    return mojo::internal::Deserialize<::blink::mojom::AnnotationType>(
        data_value, output);
  }
  AnnotationType type() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::blink::mojom::AnnotationType>(data_->type));
  }
 private:
  internal::AnnotationAgentContainer_RemoveAgentsOfType_Params_Data* data_ = nullptr;
};



inline void AnnotationAgentHost_DidFinishAttachment_ParamsDataView::GetDocumentRelativeRectDataView(
    ::gfx::mojom::RectDataView* output) {
  auto pointer = data_->document_relative_rect.Get();
  *output = ::gfx::mojom::RectDataView(pointer, message_);
}


inline void AnnotationAgentContainer_CreateAgent_ParamsDataView::GetSelectorDataView(
    SelectorDataView* output) {
  auto pointer = &data_->selector;
  *output = SelectorDataView(pointer, message_);
}




inline void AnnotationAgentContainer_CreateAgentFromSelection_ResponseParamsDataView::GetResultDataView(
    SelectorCreationResultDataView* output) {
  auto pointer = data_->result.Get();
  *output = SelectorCreationResultDataView(pointer, message_);
}





}  // blink::mojom

#if defined(__clang__)
#pragma clang diagnostic pop
#endif

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_ANNOTATION_ANNOTATION_MOJOM_PARAMS_DATA_H_