// This is a generated file, modify: generate/templates/templates/struct_header.h

// generated from struct_header.h
#ifndef GITDIFFOPTIONS_H
#define GITDIFFOPTIONS_H
#include <nan.h>
#include <string>
#include <utility>

#include "async_baton.h"
#include "async_worker.h"
#include "callback_wrapper.h"
#include "context.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
#include "configurable_class_wrapper.h"
#include "v8_helpers.h"

extern "C" {
  #include <git2.h>
 }

  #include "../include/strarray.h"
  #include "../include/diff_delta.h"
 
using namespace node;
using namespace v8;

class GitDiffOptions;
class ConfigurableGitDiffOptions;
 
struct GitDiffOptionsTraits {
  typedef GitDiffOptions cppClass;
  typedef git_diff_options cType;
  typedef ConfigurableGitDiffOptions configurableCppClass;
 
  static const bool isDuplicable = false;
  static void duplicate(git_diff_options **dest, git_diff_options *src) {
     Nan::ThrowError("duplicate called on GitDiffOptions which cannot be duplicated");
   }

  static std::string className() { return "GitDiffOptions"; };
  static const bool isSingleton = false;
  static const bool isFreeable = true;
  static void free(git_diff_options *raw) {
    unsigned long referenceCount = 0;
     if (referenceCount == 0) {
      ::free(raw); // :: to avoid calling this free recursively
    }
   }
};
  
class ConfigurableGitDiffOptions : public nodegit::ConfigurableClassWrapper<GitDiffOptionsTraits> {
  friend class nodegit::ConfigurableClassWrapper<GitDiffOptionsTraits>;

public:
  static v8ConversionResult fromJavascript(nodegit::Context *nodegitContext, v8::Local<v8::Value> input);
  ~ConfigurableGitDiffOptions();

  ConfigurableGitDiffOptions(const ConfigurableGitDiffOptions &) = delete;
  ConfigurableGitDiffOptions(ConfigurableGitDiffOptions &&) = delete;
  ConfigurableGitDiffOptions &operator=(const ConfigurableGitDiffOptions &) = delete;
  ConfigurableGitDiffOptions &operator=(ConfigurableGitDiffOptions &&) = delete;

                static int notifyCb_cppCallback (
            const git_diff * diff_so_far
              ,
             git_diff_delta * delta_to_add
              ,
             const char * matched_pathspec
              ,
             void * payload
          );

        static void notifyCb_cancelAsync(void *baton);
        static void notifyCb_async(void *baton);
        static void notifyCb_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local<v8::Value> result);
           class NotifyCbBaton : public nodegit::AsyncBatonWithResult<int> {
          public:
              const git_diff * diff_so_far;
              git_diff_delta * delta_to_add;
              const char * matched_pathspec;
              void * payload;
 
            NotifyCbBaton(const int &defaultResult)
              : nodegit::AsyncBatonWithResult<int>(defaultResult) {
              }
          };
         static ConfigurableGitDiffOptions * notifyCb_getInstanceFromBaton (
          NotifyCbBaton *baton);
          static int progressCb_cppCallback (
            const git_diff * diff_so_far
              ,
             const char * old_path
              ,
             const char * new_path
              ,
             void * payload
          );

        static void progressCb_cancelAsync(void *baton);
        static void progressCb_async(void *baton);
        static void progressCb_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local<v8::Value> result);
           class ProgressCbBaton : public nodegit::AsyncBatonWithResult<int> {
          public:
              const git_diff * diff_so_far;
              const char * old_path;
              const char * new_path;
              void * payload;
 
            ProgressCbBaton(const int &defaultResult)
              : nodegit::AsyncBatonWithResult<int>(defaultResult) {
              }
          };
         static ConfigurableGitDiffOptions * progressCb_getInstanceFromBaton (
          ProgressCbBaton *baton);
                   
private:
  ConfigurableGitDiffOptions(nodegit::Context *nodegitContext);
  ConfigurableGitDiffOptions() = delete;
  Nan::Global<Value> promiseError;

                      CallbackWrapper notifyCb;
             CallbackWrapper progressCb;
                          
};

#endif
