// content/browser/xr/webxr_internals/mojom/webxr_internals.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 CONTENT_BROWSER_XR_WEBXR_INTERNALS_MOJOM_WEBXR_INTERNALS_MOJOM_DATA_VIEW_H_
#define CONTENT_BROWSER_XR_WEBXR_INTERNALS_MOJOM_WEBXR_INTERNALS_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 "content/browser/xr/webxr_internals/mojom/webxr_internals.mojom-shared-internal.h"
#include "device/vr/public/mojom/xr_device.mojom-shared.h"
#include "device/vr/public/mojom/xr_session.mojom-shared.h"
#include "mojo/public/mojom/base/time.mojom-shared.h"


namespace webxr::mojom {
class DeviceInfoDataView;

class SessionRequestedRecordDataView;

class SessionRejectedRecordDataView;

class SessionStartedRecordDataView;

class SessionStoppedRecordDataView;

class RuntimeInfoDataView;



}  // webxr::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::webxr::mojom::DeviceInfoDataView> {
  using Data = ::webxr::mojom::internal::DeviceInfo_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::webxr::mojom::SessionRequestedRecordDataView> {
  using Data = ::webxr::mojom::internal::SessionRequestedRecord_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::webxr::mojom::SessionRejectedRecordDataView> {
  using Data = ::webxr::mojom::internal::SessionRejectedRecord_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::webxr::mojom::SessionStartedRecordDataView> {
  using Data = ::webxr::mojom::internal::SessionStartedRecord_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::webxr::mojom::SessionStoppedRecordDataView> {
  using Data = ::webxr::mojom::internal::SessionStoppedRecord_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

template <>
struct MojomTypeTraits<::webxr::mojom::RuntimeInfoDataView> {
  using Data = ::webxr::mojom::internal::RuntimeInfo_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


namespace webxr::mojom {
// Interface base classes. They are used for type safety check.
class WebXrInternalsHandlerInterfaceBase {};

using WebXrInternalsHandlerPtrDataView =
    mojo::InterfacePtrDataView<WebXrInternalsHandlerInterfaceBase>;
using WebXrInternalsHandlerRequestDataView =
    mojo::InterfaceRequestDataView<WebXrInternalsHandlerInterfaceBase>;
using WebXrInternalsHandlerAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<WebXrInternalsHandlerInterfaceBase>;
using WebXrInternalsHandlerAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<WebXrInternalsHandlerInterfaceBase>;
class XRInternalsSessionListenerInterfaceBase {};

using XRInternalsSessionListenerPtrDataView =
    mojo::InterfacePtrDataView<XRInternalsSessionListenerInterfaceBase>;
using XRInternalsSessionListenerRequestDataView =
    mojo::InterfaceRequestDataView<XRInternalsSessionListenerInterfaceBase>;
using XRInternalsSessionListenerAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<XRInternalsSessionListenerInterfaceBase>;
using XRInternalsSessionListenerAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<XRInternalsSessionListenerInterfaceBase>;


class DeviceInfoDataView {
 public:
  DeviceInfoDataView() = default;

  DeviceInfoDataView(
      internal::DeviceInfo_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetOperatingSystemNameDataView(
      mojo::StringDataView* output);

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

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

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

  template <typename UserType>
  [[nodiscard]] bool ReadGpuGlRenderer(UserType* output) {
    
    auto* pointer = data_->gpu_gl_renderer.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
 private:
  internal::DeviceInfo_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class SessionRequestedRecordDataView {
 public:
  SessionRequestedRecordDataView() = default;

  SessionRequestedRecordDataView(
      internal::SessionRequestedRecord_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetOptionsDataView(
      ::device::mojom::XRSessionOptionsDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadOptions(UserType* output) {
    
    auto* pointer = data_->options.Get();
    return mojo::internal::Deserialize<::device::mojom::XRSessionOptionsDataView>(
        pointer, output, message_);
  }
  inline void GetRequestedTimeDataView(
      ::mojo_base::mojom::TimeDataView* output);

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


class SessionRejectedRecordDataView {
 public:
  SessionRejectedRecordDataView() = default;

  SessionRejectedRecordDataView(
      internal::SessionRejectedRecord_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  uint64_t trace_id() const {
    return data_->trace_id;
  }
  template <typename UserType>
  [[nodiscard]] bool ReadFailureReason(UserType* output) const {
    auto data_value = data_->failure_reason;
    return mojo::internal::Deserialize<::device::mojom::RequestSessionError>(
        data_value, output);
  }
  ::device::mojom::RequestSessionError failure_reason() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::device::mojom::RequestSessionError>(data_->failure_reason));
  }
  inline void GetRejectedTimeDataView(
      ::mojo_base::mojom::TimeDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadRejectedTime(UserType* output) {
    
    auto* pointer = data_->rejected_time.Get();
    return mojo::internal::Deserialize<::mojo_base::mojom::TimeDataView>(
        pointer, output, message_);
  }
  inline void GetFailureReasonDescriptionDataView(
      mojo::StringDataView* output);

  template <typename UserType>
  [[nodiscard]] bool ReadFailureReasonDescription(UserType* output) {
    
    auto* pointer = data_->failure_reason_description.Get();
    return mojo::internal::Deserialize<mojo::StringDataView>(
        pointer, output, message_);
  }
  inline void GetRejectedFeaturesDataView(
      mojo::ArrayDataView<::device::mojom::XRSessionFeature>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadRejectedFeatures(UserType* output) {
    
    auto* pointer = data_->rejected_features.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::device::mojom::XRSessionFeature>>(
        pointer, output, message_);
  }
 private:
  internal::SessionRejectedRecord_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


class SessionStartedRecordDataView {
 public:
  SessionStartedRecordDataView() = default;

  SessionStartedRecordDataView(
      internal::SessionStartedRecord_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  uint64_t trace_id() const {
    return data_->trace_id;
  }
  template <typename UserType>
  [[nodiscard]] bool ReadDeviceId(UserType* output) const {
    auto data_value = data_->device_id;
    return mojo::internal::Deserialize<::device::mojom::XRDeviceId>(
        data_value, output);
  }
  ::device::mojom::XRDeviceId device_id() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::device::mojom::XRDeviceId>(data_->device_id));
  }
  inline void GetStartedTimeDataView(
      ::mojo_base::mojom::TimeDataView* output);

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


class SessionStoppedRecordDataView {
 public:
  SessionStoppedRecordDataView() = default;

  SessionStoppedRecordDataView(
      internal::SessionStoppedRecord_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  uint64_t trace_id() const {
    return data_->trace_id;
  }
  inline void GetStoppedTimeDataView(
      ::mojo_base::mojom::TimeDataView* output);

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


class RuntimeInfoDataView {
 public:
  RuntimeInfoDataView() = default;

  RuntimeInfoDataView(
      internal::RuntimeInfo_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  template <typename UserType>
  [[nodiscard]] bool ReadDeviceId(UserType* output) const {
    auto data_value = data_->device_id;
    return mojo::internal::Deserialize<::device::mojom::XRDeviceId>(
        data_value, output);
  }
  ::device::mojom::XRDeviceId device_id() const {
    return ::mojo::internal::ToKnownEnumValueHelper(
          static_cast<::device::mojom::XRDeviceId>(data_->device_id));
  }
  inline void GetSupportedFeaturesDataView(
      mojo::ArrayDataView<::device::mojom::XRSessionFeature>* output);

  template <typename UserType>
  [[nodiscard]] bool ReadSupportedFeatures(UserType* output) {
    
    auto* pointer = data_->supported_features.Get();
    return mojo::internal::Deserialize<mojo::ArrayDataView<::device::mojom::XRSessionFeature>>(
        pointer, output, message_);
  }
  bool is_ar_blend_mode_supported() const {
    return data_->is_ar_blend_mode_supported;
  }
 private:
  internal::RuntimeInfo_Data* data_ = nullptr;
  mojo::Message* message_ = nullptr;
};


}  // webxr::mojom

#endif  // CONTENT_BROWSER_XR_WEBXR_INTERNALS_MOJOM_WEBXR_INTERNALS_MOJOM_DATA_VIEW_H_