///
/// HybridMailAccountSpec.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 `MailMailboxInfo` to properly resolve imports.
namespace margelo::nitro::mailengine { struct MailMailboxInfo; }
// Forward declaration of `HybridMailMailboxSpec` to properly resolve imports.
namespace margelo::nitro::mailengine { class HybridMailMailboxSpec; }
// Forward declaration of `MailOutgoingMessage` to properly resolve imports.
namespace margelo::nitro::mailengine { struct MailOutgoingMessage; }

#include <string>
#include "MailMailboxInfo.hpp"
#include <vector>
#include <NitroModules/Promise.hpp>
#include <memory>
#include "HybridMailMailboxSpec.hpp"
#include "MailOutgoingMessage.hpp"

namespace margelo::nitro::mailengine {

  using namespace margelo::nitro;

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

      // Destructor
      ~HybridMailAccountSpec() override = default;

    public:
      // Properties
      virtual std::string getId() = 0;
      virtual bool getIsConnected() = 0;

    public:
      // Methods
      virtual std::shared_ptr<Promise<std::vector<MailMailboxInfo>>> listMailboxes() = 0;
      virtual std::shared_ptr<Promise<std::shared_ptr<HybridMailMailboxSpec>>> openMailbox(const std::string& path, bool readOnly) = 0;
      virtual std::shared_ptr<Promise<void>> createMailbox(const std::string& path) = 0;
      virtual std::shared_ptr<Promise<void>> deleteMailbox(const std::string& path) = 0;
      virtual std::shared_ptr<Promise<void>> renameMailbox(const std::string& path, const std::string& newPath) = 0;
      virtual std::shared_ptr<Promise<void>> send(const MailOutgoingMessage& message) = 0;
      virtual std::shared_ptr<Promise<void>> noop() = 0;
      virtual std::shared_ptr<Promise<void>> disconnect() = 0;

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

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

} // namespace margelo::nitro::mailengine
