/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.12
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

namespace SLNet {

using System;
using System.Runtime.InteropServices;

public class DirectoryDeltaTransfer : PluginInterface2 {
  private HandleRef swigCPtr;

  internal DirectoryDeltaTransfer(IntPtr cPtr, bool cMemoryOwn) : base(SLikeNetPINVOKE.DirectoryDeltaTransfer_SWIGUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(DirectoryDeltaTransfer obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~DirectoryDeltaTransfer() {
    Dispose();
  }

  public override void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SLikeNetPINVOKE.delete_DirectoryDeltaTransfer(swigCPtr);
        }
        swigCPtr = new HandleRef(null, IntPtr.Zero);
      }
      GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

  public static DirectoryDeltaTransfer GetInstance() {
    IntPtr cPtr = SLikeNetPINVOKE.DirectoryDeltaTransfer_GetInstance();
    DirectoryDeltaTransfer ret = (cPtr == IntPtr.Zero) ? null : new DirectoryDeltaTransfer(cPtr, false);
    return ret;
  }

  public static void DestroyInstance(DirectoryDeltaTransfer i) {
    SLikeNetPINVOKE.DirectoryDeltaTransfer_DestroyInstance(DirectoryDeltaTransfer.getCPtr(i));
  }

  public DirectoryDeltaTransfer() : this(SLikeNetPINVOKE.new_DirectoryDeltaTransfer(), true) {
  }

  public void SetFileListTransferPlugin(FileListTransfer flt) {
    SLikeNetPINVOKE.DirectoryDeltaTransfer_SetFileListTransferPlugin(swigCPtr, FileListTransfer.getCPtr(flt));
  }

  public void SetApplicationDirectory(string pathToApplication) {
    SLikeNetPINVOKE.DirectoryDeltaTransfer_SetApplicationDirectory(swigCPtr, pathToApplication);
  }

  public void SetUploadSendParameters(PacketPriority _priority, char _orderingChannel) {
    SLikeNetPINVOKE.DirectoryDeltaTransfer_SetUploadSendParameters(swigCPtr, (int)_priority, _orderingChannel);
  }

  public void AddUploadsFromSubdirectory(string subdir) {
    SLikeNetPINVOKE.DirectoryDeltaTransfer_AddUploadsFromSubdirectory(swigCPtr, subdir);
  }

  public ushort DownloadFromSubdirectory(string subdir, string outputSubdir, bool prependAppDirToOutputSubdir, SystemAddress host, FileListTransferCBInterface onFileCallback, PacketPriority _priority, char _orderingChannel, FileListProgress cb) {
    ushort ret = SLikeNetPINVOKE.DirectoryDeltaTransfer_DownloadFromSubdirectory__SWIG_0(swigCPtr, subdir, outputSubdir, prependAppDirToOutputSubdir, SystemAddress.getCPtr(host), FileListTransferCBInterface.getCPtr(onFileCallback), (int)_priority, _orderingChannel, FileListProgress.getCPtr(cb));
    if (SLikeNetPINVOKE.SWIGPendingException.Pending) throw SLikeNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public ushort DownloadFromSubdirectory(FileList localFiles, string subdir, string outputSubdir, bool prependAppDirToOutputSubdir, SystemAddress host, FileListTransferCBInterface onFileCallback, PacketPriority _priority, char _orderingChannel, FileListProgress cb) {
    ushort ret = SLikeNetPINVOKE.DirectoryDeltaTransfer_DownloadFromSubdirectory__SWIG_1(swigCPtr, FileList.getCPtr(localFiles), subdir, outputSubdir, prependAppDirToOutputSubdir, SystemAddress.getCPtr(host), FileListTransferCBInterface.getCPtr(onFileCallback), (int)_priority, _orderingChannel, FileListProgress.getCPtr(cb));
    if (SLikeNetPINVOKE.SWIGPendingException.Pending) throw SLikeNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public void GenerateHashes(FileList localFiles, string outputSubdir, bool prependAppDirToOutputSubdir) {
    SLikeNetPINVOKE.DirectoryDeltaTransfer_GenerateHashes(swigCPtr, FileList.getCPtr(localFiles), outputSubdir, prependAppDirToOutputSubdir);
    if (SLikeNetPINVOKE.SWIGPendingException.Pending) throw SLikeNetPINVOKE.SWIGPendingException.Retrieve();
  }

  public void ClearUploads() {
    SLikeNetPINVOKE.DirectoryDeltaTransfer_ClearUploads(swigCPtr);
  }

  public uint GetNumberOfFilesForUpload() {
    uint ret = SLikeNetPINVOKE.DirectoryDeltaTransfer_GetNumberOfFilesForUpload(swigCPtr);
    return ret;
  }

  public void SetDownloadRequestIncrementalReadInterface(IncrementalReadInterface _incrementalReadInterface, uint _chunkSize) {
    SLikeNetPINVOKE.DirectoryDeltaTransfer_SetDownloadRequestIncrementalReadInterface(swigCPtr, IncrementalReadInterface.getCPtr(_incrementalReadInterface), _chunkSize);
  }

}

}
