/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.40
 *
 * 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 SipDebugCallback : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

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

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

  ~SipDebugCallback() {
    Dispose();
  }

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

  public SipDebugCallback() : this(tinyWRAPPINVOKE.new_SipDebugCallback(), true) {
    SwigDirectorConnect();
  }

  public virtual int OnDebugInfo(string message) {
    int ret = ((this.GetType() == typeof(SipDebugCallback)) ? tinyWRAPPINVOKE.SipDebugCallback_OnDebugInfo(swigCPtr, message) : tinyWRAPPINVOKE.SipDebugCallback_OnDebugInfoSwigExplicitSipDebugCallback(swigCPtr, message));
    return ret;
  }

  public virtual int OnDebugWarn(string message) {
    int ret = ((this.GetType() == typeof(SipDebugCallback)) ? tinyWRAPPINVOKE.SipDebugCallback_OnDebugWarn(swigCPtr, message) : tinyWRAPPINVOKE.SipDebugCallback_OnDebugWarnSwigExplicitSipDebugCallback(swigCPtr, message));
    return ret;
  }

  public virtual int OnDebugError(string message) {
    int ret = ((this.GetType() == typeof(SipDebugCallback)) ? tinyWRAPPINVOKE.SipDebugCallback_OnDebugError(swigCPtr, message) : tinyWRAPPINVOKE.SipDebugCallback_OnDebugErrorSwigExplicitSipDebugCallback(swigCPtr, message));
    return ret;
  }

  public virtual int OnDebugFatal(string message) {
    int ret = ((this.GetType() == typeof(SipDebugCallback)) ? tinyWRAPPINVOKE.SipDebugCallback_OnDebugFatal(swigCPtr, message) : tinyWRAPPINVOKE.SipDebugCallback_OnDebugFatalSwigExplicitSipDebugCallback(swigCPtr, message));
    return ret;
  }

  private void SwigDirectorConnect() {
    if (SwigDerivedClassHasMethod("OnDebugInfo", swigMethodTypes0))
      swigDelegate0 = new SwigDelegateSipDebugCallback_0(SwigDirectorOnDebugInfo);
    if (SwigDerivedClassHasMethod("OnDebugWarn", swigMethodTypes1))
      swigDelegate1 = new SwigDelegateSipDebugCallback_1(SwigDirectorOnDebugWarn);
    if (SwigDerivedClassHasMethod("OnDebugError", swigMethodTypes2))
      swigDelegate2 = new SwigDelegateSipDebugCallback_2(SwigDirectorOnDebugError);
    if (SwigDerivedClassHasMethod("OnDebugFatal", swigMethodTypes3))
      swigDelegate3 = new SwigDelegateSipDebugCallback_3(SwigDirectorOnDebugFatal);
    tinyWRAPPINVOKE.SipDebugCallback_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3);
  }

  private bool SwigDerivedClassHasMethod(string methodName, Type[] methodTypes) {
    System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, methodTypes, null);
    bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(SipDebugCallback));
    return hasDerivedMethod;
  }

  private int SwigDirectorOnDebugInfo(string message) {
    return OnDebugInfo(message);
  }

  private int SwigDirectorOnDebugWarn(string message) {
    return OnDebugWarn(message);
  }

  private int SwigDirectorOnDebugError(string message) {
    return OnDebugError(message);
  }

  private int SwigDirectorOnDebugFatal(string message) {
    return OnDebugFatal(message);
  }

  public delegate int SwigDelegateSipDebugCallback_0(string message);
  public delegate int SwigDelegateSipDebugCallback_1(string message);
  public delegate int SwigDelegateSipDebugCallback_2(string message);
  public delegate int SwigDelegateSipDebugCallback_3(string message);

  private SwigDelegateSipDebugCallback_0 swigDelegate0;
  private SwigDelegateSipDebugCallback_1 swigDelegate1;
  private SwigDelegateSipDebugCallback_2 swigDelegate2;
  private SwigDelegateSipDebugCallback_3 swigDelegate3;

  private static Type[] swigMethodTypes0 = new Type[] { typeof(string) };
  private static Type[] swigMethodTypes1 = new Type[] { typeof(string) };
  private static Type[] swigMethodTypes2 = new Type[] { typeof(string) };
  private static Type[] swigMethodTypes3 = new Type[] { typeof(string) };
}
