// components/optimization_guide/content/mojom/page_text_service.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 COMPONENTS_OPTIMIZATION_GUIDE_CONTENT_MOJOM_PAGE_TEXT_SERVICE_MOJOM_DATA_VIEW_H_
#define COMPONENTS_OPTIMIZATION_GUIDE_CONTENT_MOJOM_PAGE_TEXT_SERVICE_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 "components/optimization_guide/content/mojom/page_text_service.mojom-shared-internal.h"
#include "mojo/public/mojom/base/string16.mojom-shared.h"


namespace optimization_guide::mojom {
class PageTextDumpRequestDataView;



}  // optimization_guide::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::optimization_guide::mojom::PageTextDumpRequestDataView> {
  using Data = ::optimization_guide::mojom::internal::PageTextDumpRequest_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


namespace optimization_guide::mojom {


enum class TextDumpEvent : int32_t {
  
  kFirstLayout = 0,
  
  kFinishedLoad = 1,
  kMinValue = 0,
  kMaxValue = 1,
};

 std::ostream& operator<<(std::ostream& os, TextDumpEvent value);
inline bool IsKnownEnumValue(TextDumpEvent value) {
  return internal::TextDumpEvent_Data::IsKnownValue(
      static_cast<int32_t>(value));
}

// Returns true if the enum has an infallible conversion from the mojom enum.
consteval bool HasInfallibleConversion(TextDumpEvent) {
  return true;
}
// Interface base classes. They are used for type safety check.
class PageTextConsumerInterfaceBase {};

using PageTextConsumerPtrDataView =
    mojo::InterfacePtrDataView<PageTextConsumerInterfaceBase>;
using PageTextConsumerRequestDataView =
    mojo::InterfaceRequestDataView<PageTextConsumerInterfaceBase>;
using PageTextConsumerAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<PageTextConsumerInterfaceBase>;
using PageTextConsumerAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<PageTextConsumerInterfaceBase>;
class PageTextServiceInterfaceBase {};

using PageTextServicePtrDataView =
    mojo::InterfacePtrDataView<PageTextServiceInterfaceBase>;
using PageTextServiceRequestDataView =
    mojo::InterfaceRequestDataView<PageTextServiceInterfaceBase>;
using PageTextServiceAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<PageTextServiceInterfaceBase>;
using PageTextServiceAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<PageTextServiceInterfaceBase>;


class PageTextDumpRequestDataView {
 public:
  PageTextDumpRequestDataView() = default;

  PageTextDumpRequestDataView(
      internal::PageTextDumpRequest_Data* data,
      mojo::Message* message)
      : data_(data) {}

  bool is_null() const { return !data_; }
  uint32_t max_size() const {
    return data_->max_size;
  }
  template <typename UserType>
  [[nodiscard]] bool ReadEvent(UserType* output) const {
    auto data_value = data_->event;
    return mojo::internal::Deserialize<::optimization_guide::mojom::TextDumpEvent>(
        data_value, output);
  }
  TextDumpEvent event() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::optimization_guide::mojom::TextDumpEvent>(data_->event));
  }
 private:
  internal::PageTextDumpRequest_Data* data_ = nullptr;
};


}  // optimization_guide::mojom

#endif  // COMPONENTS_OPTIMIZATION_GUIDE_CONTENT_MOJOM_PAGE_TEXT_SERVICE_MOJOM_DATA_VIEW_H_