///
/// HybridNativeListDataSourceSpec.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 `NativeListItem` to properly resolve imports.
namespace margelo::nitro::reactnativelist { struct NativeListItem; }

#include "NativeListItem.hpp"
#include <functional>
#include <vector>

namespace margelo::nitro::reactnativelist {

  using namespace margelo::nitro;

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

      // Destructor
      ~HybridNativeListDataSourceSpec() override = default;

    public:
      // Properties
      

    public:
      // Methods
      virtual void setContentEqualCallback(const std::function<bool(const NativeListItem& /* oldItem */, const NativeListItem& /* newItem */)>& isContentEqual) = 0;
      virtual void replaceData(const std::vector<NativeListItem>& items, bool animated) = 0;
      virtual void insertItem(double index, const NativeListItem& item) = 0;
      virtual void updateItem(double index, const NativeListItem& item) = 0;
      virtual void removeItem(double index) = 0;
      virtual void moveItem(double fromIndex, double toIndex) = 0;
      virtual double getCount() = 0;
      virtual NativeListItem getItem(double index) = 0;

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

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

} // namespace margelo::nitro::reactnativelist
