///
/// HybridNitroDpiMetricSpecSwift.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///

#pragma once

#include "HybridNitroDpiMetricSpec.hpp"

// Forward declaration of `HybridNitroDpiMetricSpec_cxx` to properly resolve imports.
namespace NitroDpiMetric { class HybridNitroDpiMetricSpec_cxx; }





#include "NitroDpiMetric-Swift-Cxx-Umbrella.hpp"

namespace margelo::nitro::dpimetric {

  /**
   * The C++ part of HybridNitroDpiMetricSpec_cxx.swift.
   *
   * HybridNitroDpiMetricSpecSwift (C++) accesses HybridNitroDpiMetricSpec_cxx (Swift), and might
   * contain some additional bridging code for C++ <> Swift interop.
   *
   * Since this obviously introduces an overhead, I hope at some point in
   * the future, HybridNitroDpiMetricSpec_cxx can directly inherit from the C++ class HybridNitroDpiMetricSpec
   * to simplify the whole structure and memory management.
   */
  class HybridNitroDpiMetricSpecSwift: public virtual HybridNitroDpiMetricSpec {
  public:
    // Constructor from a Swift instance
    explicit HybridNitroDpiMetricSpecSwift(const NitroDpiMetric::HybridNitroDpiMetricSpec_cxx& swiftPart):
      HybridObject(HybridNitroDpiMetricSpec::TAG),
      _swiftPart(swiftPart) { }

  public:
    // Get the Swift part
    inline NitroDpiMetric::HybridNitroDpiMetricSpec_cxx& getSwiftPart() noexcept {
      return _swiftPart;
    }

  public:
    inline size_t getExternalMemorySize() noexcept override {
      return _swiftPart.getMemorySize();
    }
    void dispose() noexcept override {
      _swiftPart.dispose();
    }

  public:
    // Properties
    

  public:
    // Methods
    inline bool isTablet() override {
      auto __result = _swiftPart.isTablet();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline double getNavBarHeight() override {
      auto __result = _swiftPart.getNavBarHeight();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline double getDpi() override {
      auto __result = _swiftPart.getDpi();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline double deviceInch() override {
      auto __result = _swiftPart.deviceInch();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }

  private:
    NitroDpiMetric::HybridNitroDpiMetricSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::dpimetric
