///
/// HybridOneBrowserSpec.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 `BrowserResult` to properly resolve imports.
namespace margelo::nitro::one { struct BrowserResult; }
// Forward declaration of `BrowserNativeOptions` to properly resolve imports.
namespace margelo::nitro::one { struct BrowserNativeOptions; }
// Forward declaration of `BrowserAuthResult` to properly resolve imports.
namespace margelo::nitro::one { struct BrowserAuthResult; }

#include "BrowserResult.hpp"
#include <NitroModules/Promise.hpp>
#include <string>
#include "BrowserNativeOptions.hpp"
#include "BrowserAuthResult.hpp"
#include <optional>

namespace margelo::nitro::one {

  using namespace margelo::nitro;

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

      // Destructor
      ~HybridOneBrowserSpec() override = default;

    public:
      // Properties
      

    public:
      // Methods
      virtual std::shared_ptr<Promise<BrowserResult>> open(const std::string& url, const BrowserNativeOptions& options) = 0;
      virtual std::shared_ptr<Promise<BrowserResult>> dismiss() = 0;
      virtual std::shared_ptr<Promise<BrowserAuthResult>> openAuthSession(const std::string& url, const std::optional<std::string>& redirectUrl, const BrowserNativeOptions& options) = 0;
      virtual void dismissAuthSession() = 0;
      virtual std::shared_ptr<Promise<bool>> warmup(const std::optional<std::string>& browserPackage) = 0;
      virtual std::shared_ptr<Promise<bool>> mayLaunchUrl(const std::string& url, const std::optional<std::string>& browserPackage) = 0;

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

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

} // namespace margelo::nitro::one
