///
/// HybridHapticsSpecSwift.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 "HybridHapticsSpec.hpp"

// Forward declaration of `HybridHapticsSpec_cxx` to properly resolve imports.
namespace NitroHaptics { class HybridHapticsSpec_cxx; }

// Forward declaration of `ImpactFeedbackStyle` to properly resolve imports.
namespace margelo::nitro::haptics { enum class ImpactFeedbackStyle; }
// Forward declaration of `NotificationFeedbackType` to properly resolve imports.
namespace margelo::nitro::haptics { enum class NotificationFeedbackType; }
// Forward declaration of `AndroidHaptics` to properly resolve imports.
namespace margelo::nitro::haptics { enum class AndroidHaptics; }

#include "ImpactFeedbackStyle.hpp"
#include "NotificationFeedbackType.hpp"
#include "AndroidHaptics.hpp"

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

namespace margelo::nitro::haptics {

  /**
   * The C++ part of HybridHapticsSpec_cxx.swift.
   *
   * HybridHapticsSpecSwift (C++) accesses HybridHapticsSpec_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, HybridHapticsSpec_cxx can directly inherit from the C++ class HybridHapticsSpec
   * to simplify the whole structure and memory management.
   */
  class HybridHapticsSpecSwift: public virtual HybridHapticsSpec {
  public:
    // Constructor from a Swift instance
    explicit HybridHapticsSpecSwift(const NitroHaptics::HybridHapticsSpec_cxx& swiftPart):
      HybridObject(HybridHapticsSpec::TAG),
      _swiftPart(swiftPart) { }

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

  public:
    // Get memory pressure
    inline size_t getExternalMemorySize() noexcept override {
      return _swiftPart.getMemorySize();
    }

  public:
    // Properties
    

  public:
    // Methods
    inline void impact(ImpactFeedbackStyle style) override {
      auto __result = _swiftPart.impact(static_cast<int>(style));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void notification(NotificationFeedbackType type) override {
      auto __result = _swiftPart.notification(static_cast<int>(type));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void selection() override {
      auto __result = _swiftPart.selection();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void performAndroidHaptics(AndroidHaptics type) override {
      auto __result = _swiftPart.performAndroidHaptics(static_cast<int>(type));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }

  private:
    NitroHaptics::HybridHapticsSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::haptics
