///
/// HybridOneScreenCaptureSpec.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 `ScreenCaptureState` to properly resolve imports.
namespace margelo::nitro::one { enum class ScreenCaptureState; }
// Forward declaration of `ScreenCaptureResult` to properly resolve imports.
namespace margelo::nitro::one { struct ScreenCaptureResult; }

#include "ScreenCaptureState.hpp"
#include <NitroModules/Promise.hpp>
#include "ScreenCaptureResult.hpp"
#include <functional>

namespace margelo::nitro::one {

  using namespace margelo::nitro;

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

      // Destructor
      ~HybridOneScreenCaptureSpec() override = default;

    public:
      // Properties
      

    public:
      // Methods
      virtual std::shared_ptr<Promise<ScreenCaptureState>> getState() = 0;
      virtual std::shared_ptr<Promise<ScreenCaptureResult>> captureWindow() = 0;
      virtual std::shared_ptr<Promise<ScreenCaptureResult>> captureView(double viewTag) = 0;
      virtual std::function<void()> addStateListener(const std::function<void(ScreenCaptureState /* state */)>& onChange) = 0;
      virtual std::function<void()> addScreenshotListener(const std::function<void(double /* timestampMs */)>& onScreenshot) = 0;
      virtual std::shared_ptr<Promise<void>> prevent() = 0;
      virtual std::shared_ptr<Promise<void>> allow() = 0;
      virtual std::shared_ptr<Promise<bool>> isPrevented() = 0;

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

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

} // namespace margelo::nitro::one
