// Copyright (c) 2026 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=f1bb6e813c511db4daaae422ebc33a2e564d4aa8$
//

#include "libcef_dll/ctocpp/component_ctocpp.h"
#include "libcef_dll/shutdown_checker.h"

#if CEF_API_ADDED(14600)

// VIRTUAL METHODS - Body may be edited by hand.

NO_SANITIZE("cfi-icall") CefString CefComponentCToCpp::GetID() {
  shutdown_checker::AssertNotShutdown();

  auto *_struct = GetStruct();
  if (!_struct->get_id) {
    return CefString();
  }

  // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

  // Execute
  cef_string_userfree_t _retval = _struct->get_id(_struct);

  // Return type: string
  CefString _retvalStr;
  _retvalStr.AttachToUserFree(_retval);
  return _retvalStr;
}

NO_SANITIZE("cfi-icall") CefString CefComponentCToCpp::GetName() {
  shutdown_checker::AssertNotShutdown();

  auto *_struct = GetStruct();
  if (!_struct->get_name) {
    return CefString();
  }

  // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

  // Execute
  cef_string_userfree_t _retval = _struct->get_name(_struct);

  // Return type: string
  CefString _retvalStr;
  _retvalStr.AttachToUserFree(_retval);
  return _retvalStr;
}

NO_SANITIZE("cfi-icall") CefString CefComponentCToCpp::GetVersion() {
  shutdown_checker::AssertNotShutdown();

  auto *_struct = GetStruct();
  if (!_struct->get_version) {
    return CefString();
  }

  // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

  // Execute
  cef_string_userfree_t _retval = _struct->get_version(_struct);

  // Return type: string
  CefString _retvalStr;
  _retvalStr.AttachToUserFree(_retval);
  return _retvalStr;
}

NO_SANITIZE("cfi-icall") cef_component_state_t CefComponentCToCpp::GetState() {
  shutdown_checker::AssertNotShutdown();

  auto *_struct = GetStruct();
  if (!_struct->get_state) {
    return CEF_COMPONENT_STATE_NEW;
  }

  // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

  // Execute
  cef_component_state_t _retval = _struct->get_state(_struct);

  // Return type: simple
  return _retval;
}

// CONSTRUCTOR - Do not edit by hand.

CefComponentCToCpp::CefComponentCToCpp() {}

// DESTRUCTOR - Do not edit by hand.

CefComponentCToCpp::~CefComponentCToCpp() {
  shutdown_checker::AssertNotShutdown();
}

template <>
cef_component_t *
CefCToCppRefCounted<CefComponentCToCpp, CefComponent,
                    cef_component_t>::UnwrapDerived(CefWrapperType type,
                                                    CefComponent *c) {
  CHECK(false) << __func__ << " called with unexpected class type " << type;
  return nullptr;
}

template <>
CefWrapperType CefCToCppRefCounted<CefComponentCToCpp, CefComponent,
                                   cef_component_t>::kWrapperType =
    WT_COMPONENT;

#endif // CEF_API_ADDED(14600)
