// third_party/blink/public/mojom/page/widget.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 THIRD_PARTY_BLINK_PUBLIC_MOJOM_PAGE_WIDGET_MOJOM_DATA_VIEW_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_PAGE_WIDGET_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 "third_party/blink/public/mojom/page/widget.mojom-shared-internal.h"
#include "cc/mojom/touch_action.mojom-shared.h"
#include "mojo/public/mojom/base/text_direction.mojom-shared.h"
#include "services/viz/public/mojom/compositing/local_surface_id.mojom-shared.h"
#include "skia/public/mojom/bitmap.mojom-shared.h"
#include "third_party/blink/public/mojom/frame/intrinsic_sizing_info.mojom-shared.h"
#include "third_party/blink/public/mojom/frame/viewport_intersection_state.mojom-shared.h"
#include "third_party/blink/public/mojom/input/ime_host.mojom-shared.h"
#include "third_party/blink/public/mojom/input/touch_event.mojom-shared.h"
#include "third_party/blink/public/mojom/drag/drag.mojom-shared.h"
#include "third_party/blink/public/mojom/widget/platform_widget.mojom-shared.h"
#include "third_party/blink/public/mojom/widget/device_emulation_params.mojom-shared.h"
#include "third_party/blink/public/mojom/widget/visual_properties.mojom-shared.h"
#include "ui/base/dragdrop/mojom/drag_drop_types.mojom-shared.h"
#include "ui/base/mojom/ui_base_types.mojom-shared.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared.h"
#include "ui/gfx/range/mojom/range.mojom-shared.h"


namespace blink::mojom {
class StylusWritingFocusResultDataView;



}  // blink::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::blink::mojom::StylusWritingFocusResultDataView> {
  using Data = ::blink::mojom::internal::StylusWritingFocusResult_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


namespace blink::mojom {


enum class DeviceEmulationCacheBehavior : int32_t {
  
  kClearCache = 0,
  
  kKeepCache = 1,
  kMinValue = 0,
  kMaxValue = 1,
};

COMPONENT_EXPORT(MOJOM_SHARED_BLINK_COMMON_EXPORT) std::ostream& operator<<(std::ostream& os, DeviceEmulationCacheBehavior value);
inline bool IsKnownEnumValue(DeviceEmulationCacheBehavior value) {
  return internal::DeviceEmulationCacheBehavior_Data::IsKnownValue(
      static_cast<int32_t>(value));
}

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

using FrameWidgetPtrDataView =
    mojo::InterfacePtrDataView<FrameWidgetInterfaceBase>;
using FrameWidgetRequestDataView =
    mojo::InterfaceRequestDataView<FrameWidgetInterfaceBase>;
using FrameWidgetAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<FrameWidgetInterfaceBase>;
using FrameWidgetAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<FrameWidgetInterfaceBase>;
class FrameWidgetHostInterfaceBase {};

using FrameWidgetHostPtrDataView =
    mojo::InterfacePtrDataView<FrameWidgetHostInterfaceBase>;
using FrameWidgetHostRequestDataView =
    mojo::InterfaceRequestDataView<FrameWidgetHostInterfaceBase>;
using FrameWidgetHostAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<FrameWidgetHostInterfaceBase>;
using FrameWidgetHostAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<FrameWidgetHostInterfaceBase>;
class PopupWidgetHostInterfaceBase {};

using PopupWidgetHostPtrDataView =
    mojo::InterfacePtrDataView<PopupWidgetHostInterfaceBase>;
using PopupWidgetHostRequestDataView =
    mojo::InterfaceRequestDataView<PopupWidgetHostInterfaceBase>;
using PopupWidgetHostAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<PopupWidgetHostInterfaceBase>;
using PopupWidgetHostAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<PopupWidgetHostInterfaceBase>;


class StylusWritingFocusResultDataView {
 public:
  StylusWritingFocusResultDataView() = default;

  StylusWritingFocusResultDataView(
      internal::StylusWritingFocusResult_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

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

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

  template <typename UserType>
  [[nodiscard]] bool ReadCaretBounds(UserType* output) {
    
    auto* pointer = data_->caret_bounds.Get();
    return mojo::internal::Deserialize<::gfx::mojom::RectDataView>(
        pointer, output, message_);
  }
 private:
  internal::StylusWritingFocusResult_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


}  // blink::mojom

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_PAGE_WIDGET_MOJOM_DATA_VIEW_H_