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

#pragma once

#if __has_include(<NitroModules/HybridObject.hpp>)
#include <NitroModules/HybridObject.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif

// Forward declaration of `MessageAttachment` to properly resolve imports.
namespace margelo::nitro::one { struct MessageAttachment; }
// Forward declaration of `MessageComposeResult` to properly resolve imports.
namespace margelo::nitro::one { enum class MessageComposeResult; }

#include <string>
#include <vector>
#include <optional>
#include "MessageAttachment.hpp"
#include <NitroModules/ArrayBuffer.hpp>
#include <NitroModules/Promise.hpp>
#include "MessageComposeResult.hpp"
#include <functional>

namespace margelo::nitro::one {

  using namespace margelo::nitro;

  /**
   * An abstract base class for `OneMessageCompose`
   * Inherit this class to create instances of `HybridOneMessageComposeSpec` in C++.
   * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
   * @example
   * ```cpp
   * class HybridOneMessageCompose: public HybridOneMessageComposeSpec {
   * public:
   *   HybridOneMessageCompose(...): HybridObject(TAG) { ... }
   *   // ...
   * };
   * ```
   */
  class HybridOneMessageComposeSpec: public virtual HybridObject {
    public:
      // Constructor
      explicit HybridOneMessageComposeSpec(): HybridObject(TAG) { }

      // Destructor
      ~HybridOneMessageComposeSpec() override = default;

    public:
      // Properties
      virtual std::optional<std::vector<std::string>> getRecipients() = 0;
      virtual void setRecipients(const std::optional<std::vector<std::string>>& recipients) = 0;
      virtual std::optional<std::string> getBody() = 0;
      virtual void setBody(const std::optional<std::string>& body) = 0;
      virtual std::optional<std::string> getSubject() = 0;
      virtual void setSubject(const std::optional<std::string>& subject) = 0;
      virtual std::vector<MessageAttachment> getAttachments() = 0;

    public:
      // Methods
      virtual bool canSendText() = 0;
      virtual bool canSendAttachments() = 0;
      virtual bool canSendSubject() = 0;
      virtual bool isSupportedAttachmentUTI(const std::string& uti) = 0;
      virtual void disableUserAttachments() = 0;
      virtual bool addAttachmentData(const std::shared_ptr<ArrayBuffer>& attachment, const std::string& typeIdentifier, const std::string& filename) = 0;
      virtual bool addAttachmentURL(const std::string& attachmentURL, const std::optional<std::string>& withAlternateFilename) = 0;
      virtual std::shared_ptr<Promise<void>> present(bool animated, const std::function<void(MessageComposeResult /* result */)>& didFinish) = 0;
      virtual std::shared_ptr<Promise<void>> dismiss(bool animated) = 0;

    protected:
      // Hybrid Setup
      void loadHybridMethods() override;

    protected:
      // Tag for logging
      static constexpr auto TAG = "OneMessageCompose";
  };

} // namespace margelo::nitro::one
