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


using System;
using System.Runtime.InteropServices;

public class OBMessageHandler : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal OBMessageHandler(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new HandleRef(this, cPtr);
  }

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

  ~OBMessageHandler() {
    Dispose();
  }

  public virtual void Dispose() {
    lock(this) {
      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
        swigCMemOwn = false;
        openbabelPINVOKE.delete_OBMessageHandler(swigCPtr);
      }
      swigCPtr = new HandleRef(null, IntPtr.Zero);
      GC.SuppressFinalize(this);
    }
  }

  public OBMessageHandler() : this(openbabelPINVOKE.new_OBMessageHandler(), true) {
  }

  public void ThrowError(OBError err, errorQualifier qqualifier) {
    openbabelPINVOKE.OBMessageHandler_ThrowError__SWIG_0(swigCPtr, OBError.getCPtr(err), (int)qqualifier);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void ThrowError(OBError err) {
    openbabelPINVOKE.OBMessageHandler_ThrowError__SWIG_1(swigCPtr, OBError.getCPtr(err));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void ThrowError(string method, string errorMsg, obMessageLevel level, errorQualifier qualifier) {
    openbabelPINVOKE.OBMessageHandler_ThrowError__SWIG_2(swigCPtr, method, errorMsg, (int)level, (int)qualifier);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void ThrowError(string method, string errorMsg, obMessageLevel level) {
    openbabelPINVOKE.OBMessageHandler_ThrowError__SWIG_3(swigCPtr, method, errorMsg, (int)level);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void ThrowError(string method, string errorMsg) {
    openbabelPINVOKE.OBMessageHandler_ThrowError__SWIG_4(swigCPtr, method, errorMsg);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public vectorString GetMessagesOfLevel(obMessageLevel arg0) {
    vectorString ret = new vectorString(openbabelPINVOKE.OBMessageHandler_GetMessagesOfLevel(swigCPtr, (int)arg0), true);
    return ret;
  }

  public void StartLogging() {
    openbabelPINVOKE.OBMessageHandler_StartLogging(swigCPtr);
  }

  public void StopLogging() {
    openbabelPINVOKE.OBMessageHandler_StopLogging(swigCPtr);
  }

  public void SetMaxLogEntries(uint max) {
    openbabelPINVOKE.OBMessageHandler_SetMaxLogEntries(swigCPtr, max);
  }

  public uint GetMaxLogEntries() {
    uint ret = openbabelPINVOKE.OBMessageHandler_GetMaxLogEntries(swigCPtr);
    return ret;
  }

  public void ClearLog() {
    openbabelPINVOKE.OBMessageHandler_ClearLog(swigCPtr);
  }

  public void SetOutputLevel(obMessageLevel level) {
    openbabelPINVOKE.OBMessageHandler_SetOutputLevel(swigCPtr, (int)level);
  }

  public obMessageLevel GetOutputLevel() {
    obMessageLevel ret = (obMessageLevel)openbabelPINVOKE.OBMessageHandler_GetOutputLevel(swigCPtr);
    return ret;
  }

  public void SetOutputStream(SWIGTYPE_p_std__ostream os) {
    openbabelPINVOKE.OBMessageHandler_SetOutputStream(swigCPtr, SWIGTYPE_p_std__ostream.getCPtr(os));
  }

  public SWIGTYPE_p_std__ostream GetOutputStream() {
    IntPtr cPtr = openbabelPINVOKE.OBMessageHandler_GetOutputStream(swigCPtr);
    SWIGTYPE_p_std__ostream ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_std__ostream(cPtr, false);
    return ret;
  }

  public bool StartErrorWrap() {
    bool ret = openbabelPINVOKE.OBMessageHandler_StartErrorWrap(swigCPtr);
    return ret;
  }

  public bool StopErrorWrap() {
    bool ret = openbabelPINVOKE.OBMessageHandler_StopErrorWrap(swigCPtr);
    return ret;
  }

  public uint GetErrorMessageCount() {
    uint ret = openbabelPINVOKE.OBMessageHandler_GetErrorMessageCount(swigCPtr);
    return ret;
  }

  public uint GetWarningMessageCount() {
    uint ret = openbabelPINVOKE.OBMessageHandler_GetWarningMessageCount(swigCPtr);
    return ret;
  }

  public uint GetInfoMessageCount() {
    uint ret = openbabelPINVOKE.OBMessageHandler_GetInfoMessageCount(swigCPtr);
    return ret;
  }

  public uint GetAuditMessageCount() {
    uint ret = openbabelPINVOKE.OBMessageHandler_GetAuditMessageCount(swigCPtr);
    return ret;
  }

  public uint GetDebugMessageCount() {
    uint ret = openbabelPINVOKE.OBMessageHandler_GetDebugMessageCount(swigCPtr);
    return ret;
  }

  public string GetMessageSummary() {
    string ret = openbabelPINVOKE.OBMessageHandler_GetMessageSummary(swigCPtr);
    return ret;
  }

}
