/* ----------------------------------------------------------------------------
 * 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 CkEmailBundle {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected CkEmailBundle(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

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

  protected static long swigRelease(CkEmailBundle 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_CkEmailBundle(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CkEmailBundle() {
    this(chilkatJNI.new_CkEmailBundle(), true);
  }

  public void LastErrorXml(CkString str) {
    chilkatJNI.CkEmailBundle_LastErrorXml(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public void LastErrorHtml(CkString str) {
    chilkatJNI.CkEmailBundle_LastErrorHtml(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public void LastErrorText(CkString str) {
    chilkatJNI.CkEmailBundle_LastErrorText(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public void get_DebugLogFilePath(CkString str) {
    chilkatJNI.CkEmailBundle_get_DebugLogFilePath(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String debugLogFilePath() {
    return chilkatJNI.CkEmailBundle_debugLogFilePath(swigCPtr, this);
  }

  public void put_DebugLogFilePath(String newVal) {
    chilkatJNI.CkEmailBundle_put_DebugLogFilePath(swigCPtr, this, newVal);
  }

  public void get_LastErrorHtml(CkString str) {
    chilkatJNI.CkEmailBundle_get_LastErrorHtml(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String lastErrorHtml() {
    return chilkatJNI.CkEmailBundle_lastErrorHtml(swigCPtr, this);
  }

  public void get_LastErrorText(CkString str) {
    chilkatJNI.CkEmailBundle_get_LastErrorText(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String lastErrorText() {
    return chilkatJNI.CkEmailBundle_lastErrorText(swigCPtr, this);
  }

  public void get_LastErrorXml(CkString str) {
    chilkatJNI.CkEmailBundle_get_LastErrorXml(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String lastErrorXml() {
    return chilkatJNI.CkEmailBundle_lastErrorXml(swigCPtr, this);
  }

  public boolean get_LastMethodSuccess() {
    return chilkatJNI.CkEmailBundle_get_LastMethodSuccess(swigCPtr, this);
  }

  public void put_LastMethodSuccess(boolean newVal) {
    chilkatJNI.CkEmailBundle_put_LastMethodSuccess(swigCPtr, this, newVal);
  }

  public int get_MessageCount() {
    return chilkatJNI.CkEmailBundle_get_MessageCount(swigCPtr, this);
  }

  public boolean get_VerboseLogging() {
    return chilkatJNI.CkEmailBundle_get_VerboseLogging(swigCPtr, this);
  }

  public void put_VerboseLogging(boolean newVal) {
    chilkatJNI.CkEmailBundle_put_VerboseLogging(swigCPtr, this, newVal);
  }

  public void get_Version(CkString str) {
    chilkatJNI.CkEmailBundle_get_Version(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String version() {
    return chilkatJNI.CkEmailBundle_version(swigCPtr, this);
  }

  public boolean AddEmail(CkEmail email) {
    return chilkatJNI.CkEmailBundle_AddEmail(swigCPtr, this, CkEmail.getCPtr(email), email);
  }

  public void Clear() {
    chilkatJNI.CkEmailBundle_Clear(swigCPtr, this);
  }

  public boolean EmailAt(int index, CkEmail email) {
    return chilkatJNI.CkEmailBundle_EmailAt(swigCPtr, this, index, CkEmail.getCPtr(email), email);
  }

  public CkEmail FindByHeader(String headerFieldName, String headerFieldValue) {
    long cPtr = chilkatJNI.CkEmailBundle_FindByHeader(swigCPtr, this, headerFieldName, headerFieldValue);
    return (cPtr == 0) ? null : new CkEmail(cPtr, true);
  }

  public boolean FindEmail(CkJsonObject json, CkEmail email) {
    return chilkatJNI.CkEmailBundle_FindEmail(swigCPtr, this, CkJsonObject.getCPtr(json), json, CkEmail.getCPtr(email), email);
  }

  public CkEmail GetEmail(int index) {
    long cPtr = chilkatJNI.CkEmailBundle_GetEmail(swigCPtr, this, index);
    return (cPtr == 0) ? null : new CkEmail(cPtr, true);
  }

  public CkStringArray GetUidls() {
    long cPtr = chilkatJNI.CkEmailBundle_GetUidls(swigCPtr, this);
    return (cPtr == 0) ? null : new CkStringArray(cPtr, true);
  }

  public boolean GetXml(CkString outXml) {
    return chilkatJNI.CkEmailBundle_GetXml(swigCPtr, this, CkString.getCPtr(outXml), outXml);
  }

  public String getXml() {
    return chilkatJNI.CkEmailBundle_getXml(swigCPtr, this);
  }

  public String xml() {
    return chilkatJNI.CkEmailBundle_xml(swigCPtr, this);
  }

  public boolean LoadTaskResult(CkTask task) {
    return chilkatJNI.CkEmailBundle_LoadTaskResult(swigCPtr, this, CkTask.getCPtr(task), task);
  }

  public boolean LoadXml(String filename) {
    return chilkatJNI.CkEmailBundle_LoadXml(swigCPtr, this, filename);
  }

  public boolean LoadXmlString(String xmlStr) {
    return chilkatJNI.CkEmailBundle_LoadXmlString(swigCPtr, this, xmlStr);
  }

  public boolean RemoveEmail(CkEmail email) {
    return chilkatJNI.CkEmailBundle_RemoveEmail(swigCPtr, this, CkEmail.getCPtr(email), email);
  }

  public boolean RemoveEmailByIndex(int index) {
    return chilkatJNI.CkEmailBundle_RemoveEmailByIndex(swigCPtr, this, index);
  }

  public boolean SaveXml(String filename) {
    return chilkatJNI.CkEmailBundle_SaveXml(swigCPtr, this, filename);
  }

  public void SortByDate(boolean ascending) {
    chilkatJNI.CkEmailBundle_SortByDate(swigCPtr, this, ascending);
  }

  public void SortByRecipient(boolean ascending) {
    chilkatJNI.CkEmailBundle_SortByRecipient(swigCPtr, this, ascending);
  }

  public void SortBySender(boolean ascending) {
    chilkatJNI.CkEmailBundle_SortBySender(swigCPtr, this, ascending);
  }

  public void SortBySubject(boolean ascending) {
    chilkatJNI.CkEmailBundle_SortBySubject(swigCPtr, this, ascending);
  }

}
