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

#pragma once

#include "HybridOneContactUISpec.hpp"

// Forward declaration of `HybridOneContactUISpec_cxx` to properly resolve imports.
namespace One { class HybridOneContactUISpec_cxx; }

// Forward declaration of `HybridNativeCNContactSpec` to properly resolve imports.
namespace margelo::nitro::one { class HybridNativeCNContactSpec; }
// Forward declaration of `HybridNativeCNKeyDescriptorSpec` to properly resolve imports.
namespace margelo::nitro::one { class HybridNativeCNKeyDescriptorSpec; }
// Forward declaration of `ContactUIMode` to properly resolve imports.
namespace margelo::nitro::one { enum class ContactUIMode; }
// Forward declaration of `HybridNativeCNContactStoreSpec` to properly resolve imports.
namespace margelo::nitro::one { class HybridNativeCNContactStoreSpec; }

#include <memory>
#include "HybridNativeCNContactSpec.hpp"
#include <string>
#include <vector>
#include <optional>
#include "HybridNativeCNKeyDescriptorSpec.hpp"
#include "ContactUIMode.hpp"
#include "HybridNativeCNContactStoreSpec.hpp"
#include <NitroModules/Promise.hpp>
#include <functional>

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

namespace margelo::nitro::one {

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

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

  public:
    inline size_t getExternalMemorySize() noexcept override {
      return _swiftPart.getMemorySize();
    }
    bool equals(const std::shared_ptr<HybridObject>& other) override {
      if (auto otherCast = std::dynamic_pointer_cast<HybridOneContactUISpecSwift>(other)) {
        return _swiftPart.equals(otherCast->_swiftPart);
      }
      return false;
    }
    void dispose() noexcept override {
      _swiftPart.dispose();
    }
    std::string toString() override {
      return _swiftPart.toString();
    }

  public:
    // Properties
    inline std::shared_ptr<HybridNativeCNContactSpec> getContact() noexcept override {
      auto __result = _swiftPart.getContact();
      return __result;
    }
    inline std::optional<std::vector<std::string>> getDisplayedPropertyKeys() noexcept override {
      auto __result = _swiftPart.getDisplayedPropertyKeys();
      return __result;
    }
    inline void setDisplayedPropertyKeys(const std::optional<std::vector<std::string>>& displayedPropertyKeys) noexcept override {
      _swiftPart.setDisplayedPropertyKeys(displayedPropertyKeys);
    }
    inline std::optional<std::string> getAlternateName() noexcept override {
      auto __result = _swiftPart.getAlternateName();
      return __result;
    }
    inline void setAlternateName(const std::optional<std::string>& alternateName) noexcept override {
      _swiftPart.setAlternateName(alternateName);
    }
    inline std::optional<std::string> getMessage() noexcept override {
      auto __result = _swiftPart.getMessage();
      return __result;
    }
    inline void setMessage(const std::optional<std::string>& message) noexcept override {
      _swiftPart.setMessage(message);
    }
    inline bool getAllowsEditing() noexcept override {
      return _swiftPart.getAllowsEditing();
    }
    inline void setAllowsEditing(bool allowsEditing) noexcept override {
      _swiftPart.setAllowsEditing(std::forward<decltype(allowsEditing)>(allowsEditing));
    }
    inline bool getAllowsActions() noexcept override {
      return _swiftPart.getAllowsActions();
    }
    inline void setAllowsActions(bool allowsActions) noexcept override {
      _swiftPart.setAllowsActions(std::forward<decltype(allowsActions)>(allowsActions));
    }
    inline bool getShouldShowLinkedContacts() noexcept override {
      return _swiftPart.getShouldShowLinkedContacts();
    }
    inline void setShouldShowLinkedContacts(bool shouldShowLinkedContacts) noexcept override {
      _swiftPart.setShouldShowLinkedContacts(std::forward<decltype(shouldShowLinkedContacts)>(shouldShowLinkedContacts));
    }

  public:
    // Methods
    inline std::shared_ptr<HybridNativeCNKeyDescriptorSpec> descriptorForRequiredKeys() override {
      auto __result = _swiftPart.descriptorForRequiredKeys();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline void configure(ContactUIMode mode, const std::optional<std::shared_ptr<HybridNativeCNContactSpec>>& contact) override {
      auto __result = _swiftPart.configure(static_cast<int>(mode), contact);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline std::optional<std::shared_ptr<HybridNativeCNContactStoreSpec>> getContactStore() override {
      auto __result = _swiftPart.getContactStore();
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline void setContactStore(const std::optional<std::shared_ptr<HybridNativeCNContactStoreSpec>>& store) override {
      auto __result = _swiftPart.setContactStore(store);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline void highlightProperty(const std::string& withKey, const std::optional<std::string>& identifier) override {
      auto __result = _swiftPart.highlightProperty(withKey, identifier);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
    }
    inline std::shared_ptr<Promise<void>> present(bool animated, const std::function<void(const std::optional<std::shared_ptr<HybridNativeCNContactSpec>>& /* contact */)>& didComplete) override {
      auto __result = _swiftPart.present(std::forward<decltype(animated)>(animated), didComplete);
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }
    inline std::shared_ptr<Promise<void>> dismiss(bool animated) override {
      auto __result = _swiftPart.dismiss(std::forward<decltype(animated)>(animated));
      if (__result.hasError()) [[unlikely]] {
        std::rethrow_exception(__result.error());
      }
      auto __value = std::move(__result.value());
      return __value;
    }

  private:
    One::HybridOneContactUISpec_cxx _swiftPart;
  };

} // namespace margelo::nitro::one
