///
/// HybridMunimBluetoothSpec.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 `AdvertisingOptions` to properly resolve imports.
namespace margelo::nitro::munimbluetooth { struct AdvertisingOptions; }
// Forward declaration of `AdvertisingDataTypes` to properly resolve imports.
namespace margelo::nitro::munimbluetooth { struct AdvertisingDataTypes; }
// Forward declaration of `GATTService` to properly resolve imports.
namespace margelo::nitro::munimbluetooth { struct GATTService; }
// Forward declaration of `ScanOptions` to properly resolve imports.
namespace margelo::nitro::munimbluetooth { struct ScanOptions; }
// Forward declaration of `CharacteristicValue` to properly resolve imports.
namespace margelo::nitro::munimbluetooth { struct CharacteristicValue; }
// Forward declaration of `WriteType` to properly resolve imports.
namespace margelo::nitro::munimbluetooth { enum class WriteType; }

#include "AdvertisingOptions.hpp"
#include "AdvertisingDataTypes.hpp"
#include <NitroModules/Promise.hpp>
#include "GATTService.hpp"
#include <vector>
#include "ScanOptions.hpp"
#include <optional>
#include <string>
#include "CharacteristicValue.hpp"
#include "WriteType.hpp"

namespace margelo::nitro::munimbluetooth {

  using namespace margelo::nitro;

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

      // Destructor
      ~HybridMunimBluetoothSpec() override = default;

    public:
      // Properties
      

    public:
      // Methods
      virtual void startAdvertising(const AdvertisingOptions& options) = 0;
      virtual void updateAdvertisingData(const AdvertisingDataTypes& advertisingData) = 0;
      virtual std::shared_ptr<Promise<AdvertisingDataTypes>> getAdvertisingData() = 0;
      virtual void stopAdvertising() = 0;
      virtual void setServices(const std::vector<GATTService>& services) = 0;
      virtual std::shared_ptr<Promise<bool>> isBluetoothEnabled() = 0;
      virtual std::shared_ptr<Promise<bool>> requestBluetoothPermission() = 0;
      virtual void startScan(const std::optional<ScanOptions>& options) = 0;
      virtual void stopScan() = 0;
      virtual std::shared_ptr<Promise<void>> connect(const std::string& deviceId) = 0;
      virtual void disconnect(const std::string& deviceId) = 0;
      virtual std::shared_ptr<Promise<std::vector<GATTService>>> discoverServices(const std::string& deviceId) = 0;
      virtual std::shared_ptr<Promise<CharacteristicValue>> readCharacteristic(const std::string& deviceId, const std::string& serviceUUID, const std::string& characteristicUUID) = 0;
      virtual std::shared_ptr<Promise<void>> writeCharacteristic(const std::string& deviceId, const std::string& serviceUUID, const std::string& characteristicUUID, const std::string& value, std::optional<WriteType> writeType) = 0;
      virtual void subscribeToCharacteristic(const std::string& deviceId, const std::string& serviceUUID, const std::string& characteristicUUID) = 0;
      virtual void unsubscribeFromCharacteristic(const std::string& deviceId, const std::string& serviceUUID, const std::string& characteristicUUID) = 0;
      virtual std::shared_ptr<Promise<std::vector<std::string>>> getConnectedDevices() = 0;
      virtual std::shared_ptr<Promise<double>> readRSSI(const std::string& deviceId) = 0;
      virtual void addListener(const std::string& eventName) = 0;
      virtual void removeListeners(double count) = 0;

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

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

} // namespace margelo::nitro::munimbluetooth
