///
/// HybridOneBatterySpec.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 `BatteryState` to properly resolve imports.
namespace margelo::nitro::one { enum class BatteryState; }
// Forward declaration of `BatteryPowerState` to properly resolve imports.
namespace margelo::nitro::one { struct BatteryPowerState; }
// Forward declaration of `BatteryLevelEvent` to properly resolve imports.
namespace margelo::nitro::one { struct BatteryLevelEvent; }
// Forward declaration of `BatteryStateEvent` to properly resolve imports.
namespace margelo::nitro::one { struct BatteryStateEvent; }
// Forward declaration of `BatteryPowerModeEvent` to properly resolve imports.
namespace margelo::nitro::one { struct BatteryPowerModeEvent; }

#include <NitroModules/Promise.hpp>
#include "BatteryState.hpp"
#include "BatteryPowerState.hpp"
#include <functional>
#include "BatteryLevelEvent.hpp"
#include "BatteryStateEvent.hpp"
#include "BatteryPowerModeEvent.hpp"

namespace margelo::nitro::one {

  using namespace margelo::nitro;

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

      // Destructor
      ~HybridOneBatterySpec() override = default;

    public:
      // Properties
      

    public:
      // Methods
      virtual std::shared_ptr<Promise<double>> getLevel() = 0;
      virtual std::shared_ptr<Promise<BatteryState>> getState() = 0;
      virtual std::shared_ptr<Promise<BatteryPowerState>> getPowerState() = 0;
      virtual std::shared_ptr<Promise<bool>> isLowPowerModeEnabled() = 0;
      virtual bool isAvailable() = 0;
      virtual std::function<void()> addLevelListener(const std::function<void(const BatteryLevelEvent& /* event */)>& listener) = 0;
      virtual std::function<void()> addStateListener(const std::function<void(const BatteryStateEvent& /* event */)>& listener) = 0;
      virtual std::function<void()> addLowPowerModeListener(const std::function<void(const BatteryPowerModeEvent& /* event */)>& listener) = 0;

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

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

} // namespace margelo::nitro::one
