///
/// HybridNitroOrientationSpecSwift.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 "HybridNitroOrientationSpec.hpp"

// Forward declaration of `HybridNitroOrientationSpec_cxx` to properly resolve imports.
namespace NitroOrientation { class HybridNitroOrientationSpec_cxx; }



#include <string>
#include <functional>

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

namespace margelo::nitro::orientation {

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

  public:
    // Get the Swift part
    inline NitroOrientation::HybridNitroOrientationSpec_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 std::string getOrientation() override {
      auto __result = _swiftPart.getOrientation();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::string getDeviceOrientation() override {
      auto __result = _swiftPart.getDeviceOrientation();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline void lockToPortrait() override {
      auto __result = _swiftPart.lockToPortrait();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void lockToPortraitUpsideDown() override {
      auto __result = _swiftPart.lockToPortraitUpsideDown();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void lockToLandscape() override {
      auto __result = _swiftPart.lockToLandscape();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void lockToLandscapeLeft() override {
      auto __result = _swiftPart.lockToLandscapeLeft();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void lockToLandscapeRight() override {
      auto __result = _swiftPart.lockToLandscapeRight();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void unlockAllOrientations() override {
      auto __result = _swiftPart.unlockAllOrientations();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline bool getAutoRotateState() override {
      auto __result = _swiftPart.getAutoRotateState();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline void setChangeListener(const std::function<void(const std::string& /* orientation */)>& listener) override {
      auto __result = _swiftPart.setChangeListener(listener);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }

  private:
    NitroOrientation::HybridNitroOrientationSpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::orientation
