// third_party/blink/public/mojom/frame/frame_visual_properties.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_FRAME_FRAME_VISUAL_PROPERTIES_MOJOM_DATA_VIEW_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_FRAME_FRAME_VISUAL_PROPERTIES_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/frame/frame_visual_properties.mojom-shared-internal.h"
#include "cc/mojom/browser_controls_params.mojom-shared.h"
#include "services/viz/public/mojom/compositing/local_surface_id.mojom-shared.h"
#include "ui/display/mojom/screen_infos.mojom-shared.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared.h"


namespace blink::mojom {
class FrameVisualPropertiesDataView;



}  // blink::mojom


namespace mojo {
namespace internal {

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

}  // namespace internal
}  // namespace mojo


namespace blink::mojom {


class FrameVisualPropertiesDataView {
 public:
  FrameVisualPropertiesDataView() = default;

  FrameVisualPropertiesDataView(
      internal::FrameVisualProperties_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetScreenInfosDataView(
      ::display::mojom::ScreenInfosDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadScreenInfos(UserType* output) {
    
    auto* pointer = data_->screen_infos.Get();
    return mojo::internal::Deserialize<::display::mojom::ScreenInfosDataView>(
        pointer, output, message_);
  }
  bool auto_resize_enabled() const {
    return data_->auto_resize_enabled;
  }
  bool is_pinch_gesture_active() const {
    return data_->is_pinch_gesture_active;
  }
  double zoom_level() const {
    return data_->zoom_level;
  }
  double css_zoom_factor() const {
    return data_->css_zoom_factor;
  }
  float page_scale_factor() const {
    return data_->page_scale_factor;
  }
  float compositing_scale_factor() const {
    return data_->compositing_scale_factor;
  }
  float cursor_accessibility_scale_factor() const {
    return data_->cursor_accessibility_scale_factor;
  }
  inline void GetVisibleViewportSizeDataView(
      ::gfx::mojom::SizeDataView* output);

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

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

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

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

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

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

  template <typename UserType>
  [[nodiscard]] bool ReadLocalFrameSize(UserType* output) {
    
    auto* pointer = data_->local_frame_size.Get();
    return mojo::internal::Deserialize<::gfx::mojom::SizeDataView>(
        pointer, output, message_);
  }
  inline void GetLocalSurfaceIdDataView(
      ::viz::mojom::LocalSurfaceIdDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadLocalSurfaceId(UserType* output) {
    
    auto* pointer = data_->local_surface_id.Get();
    return mojo::internal::Deserialize<::viz::mojom::LocalSurfaceIdDataView>(
        pointer, output, message_);
  }
 private:
  internal::FrameVisualProperties_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


}  // blink::mojom

#endif  // THIRD_PARTY_BLINK_PUBLIC_MOJOM_FRAME_FRAME_VISUAL_PROPERTIES_MOJOM_DATA_VIEW_H_