// media/mojo/mojom/android_overlay.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 MEDIA_MOJO_MOJOM_ANDROID_OVERLAY_MOJOM_DATA_VIEW_H_
#define MEDIA_MOJO_MOJOM_ANDROID_OVERLAY_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 "media/mojo/mojom/android_overlay.mojom-shared-internal.h"
#include "media/mojo/mojom/media_types.mojom-shared.h"
#include "mojo/public/mojom/base/unguessable_token.mojom-shared.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-shared.h"


namespace media::mojom {
class AndroidOverlayConfigDataView;



}  // media::mojom


namespace mojo {
namespace internal {

template <>
struct MojomTypeTraits<::media::mojom::AndroidOverlayConfigDataView> {
  using Data = ::media::mojom::internal::AndroidOverlayConfig_Data;
  using DataAsArrayElement = Pointer<Data>;
  static constexpr MojomTypeCategory category = MojomTypeCategory::kStruct;
};

}  // namespace internal
}  // namespace mojo


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

using AndroidOverlayProviderPtrDataView =
    mojo::InterfacePtrDataView<AndroidOverlayProviderInterfaceBase>;
using AndroidOverlayProviderRequestDataView =
    mojo::InterfaceRequestDataView<AndroidOverlayProviderInterfaceBase>;
using AndroidOverlayProviderAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<AndroidOverlayProviderInterfaceBase>;
using AndroidOverlayProviderAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<AndroidOverlayProviderInterfaceBase>;
class AndroidOverlayInterfaceBase {};

using AndroidOverlayPtrDataView =
    mojo::InterfacePtrDataView<AndroidOverlayInterfaceBase>;
using AndroidOverlayRequestDataView =
    mojo::InterfaceRequestDataView<AndroidOverlayInterfaceBase>;
using AndroidOverlayAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<AndroidOverlayInterfaceBase>;
using AndroidOverlayAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<AndroidOverlayInterfaceBase>;
class AndroidOverlayClientInterfaceBase {};

using AndroidOverlayClientPtrDataView =
    mojo::InterfacePtrDataView<AndroidOverlayClientInterfaceBase>;
using AndroidOverlayClientRequestDataView =
    mojo::InterfaceRequestDataView<AndroidOverlayClientInterfaceBase>;
using AndroidOverlayClientAssociatedPtrInfoDataView =
    mojo::AssociatedInterfacePtrInfoDataView<AndroidOverlayClientInterfaceBase>;
using AndroidOverlayClientAssociatedRequestDataView =
    mojo::AssociatedInterfaceRequestDataView<AndroidOverlayClientInterfaceBase>;


class AndroidOverlayConfigDataView {
 public:
  AndroidOverlayConfigDataView() = default;

  AndroidOverlayConfigDataView(
      internal::AndroidOverlayConfig_Data* data,
      mojo::Message* message)
      : data_(data), message_(message) {}

  bool is_null() const { return !data_; }
  inline void GetRoutingTokenDataView(
      ::mojo_base::mojom::UnguessableTokenDataView* output);

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

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


}  // media::mojom

#endif  // MEDIA_MOJO_MOJOM_ANDROID_OVERLAY_MOJOM_DATA_VIEW_H_