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

package com.chilkatsoft;

public class CkHttpProgress extends CkBaseProgress {
  private transient long swigCPtr;

  protected CkHttpProgress(long cPtr, boolean cMemoryOwn) {
    super(chilkatJNI.CkHttpProgress_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  protected static long getCPtr(CkHttpProgress obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected static long swigRelease(CkHttpProgress obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

  @SuppressWarnings({"deprecation", "removal"})
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        chilkatJNI.delete_CkHttpProgress(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  protected void swigDirectorDisconnect() {
    swigCMemOwn = false;
    delete();
  }

  public void swigReleaseOwnership() {
    swigCMemOwn = false;
    chilkatJNI.CkHttpProgress_change_ownership(this, swigCPtr, false);
  }

  public void swigTakeOwnership() {
    swigCMemOwn = true;
    chilkatJNI.CkHttpProgress_change_ownership(this, swigCPtr, true);
  }

  public CkHttpProgress() {
    this(chilkatJNI.new_CkHttpProgress(), true);
    chilkatJNI.CkHttpProgress_director_connect(this, swigCPtr, true, true);
  }

  public boolean HttpRedirect(String originalUrl, String redirectUrl) {
    return (getClass() == CkHttpProgress.class) ? chilkatJNI.CkHttpProgress_HttpRedirect(swigCPtr, this, originalUrl, redirectUrl) : chilkatJNI.CkHttpProgress_HttpRedirectSwigExplicitCkHttpProgress(swigCPtr, this, originalUrl, redirectUrl);
  }

  public void HttpChunked() {
    if (getClass() == CkHttpProgress.class) chilkatJNI.CkHttpProgress_HttpChunked(swigCPtr, this); else chilkatJNI.CkHttpProgress_HttpChunkedSwigExplicitCkHttpProgress(swigCPtr, this);
  }

  public void HttpBeginReceive() {
    if (getClass() == CkHttpProgress.class) chilkatJNI.CkHttpProgress_HttpBeginReceive(swigCPtr, this); else chilkatJNI.CkHttpProgress_HttpBeginReceiveSwigExplicitCkHttpProgress(swigCPtr, this);
  }

  public void HttpEndReceive(boolean success) {
    if (getClass() == CkHttpProgress.class) chilkatJNI.CkHttpProgress_HttpEndReceive(swigCPtr, this, success); else chilkatJNI.CkHttpProgress_HttpEndReceiveSwigExplicitCkHttpProgress(swigCPtr, this, success);
  }

  public void HttpBeginSend() {
    if (getClass() == CkHttpProgress.class) chilkatJNI.CkHttpProgress_HttpBeginSend(swigCPtr, this); else chilkatJNI.CkHttpProgress_HttpBeginSendSwigExplicitCkHttpProgress(swigCPtr, this);
  }

  public void HttpEndSend(boolean success) {
    if (getClass() == CkHttpProgress.class) chilkatJNI.CkHttpProgress_HttpEndSend(swigCPtr, this, success); else chilkatJNI.CkHttpProgress_HttpEndSendSwigExplicitCkHttpProgress(swigCPtr, this, success);
  }

  public void ReceiveRate(long byteCount, long bytesPerSec) {
    if (getClass() == CkHttpProgress.class) chilkatJNI.CkHttpProgress_ReceiveRate(swigCPtr, this, byteCount, bytesPerSec); else chilkatJNI.CkHttpProgress_ReceiveRateSwigExplicitCkHttpProgress(swigCPtr, this, byteCount, bytesPerSec);
  }

  public void SendRate(long byteCount, long bytesPerSec) {
    if (getClass() == CkHttpProgress.class) chilkatJNI.CkHttpProgress_SendRate(swigCPtr, this, byteCount, bytesPerSec); else chilkatJNI.CkHttpProgress_SendRateSwigExplicitCkHttpProgress(swigCPtr, this, byteCount, bytesPerSec);
  }

}
