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

namespace libsbml {

using System;
using System.Runtime.InteropServices;

public class Event : SBase {
	private HandleRef swigCPtr;
	
	internal Event(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.EventUpcast(cPtr), cMemoryOwn)
	{
		//super(libsbmlPINVOKE.EventUpcast(cPtr), cMemoryOwn);
		swigCPtr = new HandleRef(this, cPtr);
	}
	
	internal static HandleRef getCPtr(Event obj)
	{
		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
	}
	
	internal static HandleRef getCPtrAndDisown (Event obj)
	{
		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
		
		if (obj != null)
		{
			ptr             = obj.swigCPtr;
			obj.swigCMemOwn = false;
		}
		
		return ptr;
	}

  ~Event() {
    Dispose();
  }

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

  public Event(string id, string name) : this(libsbmlPINVOKE.new_Event__SWIG_0(id, name), true) {
  }

  public Event(string id) : this(libsbmlPINVOKE.new_Event__SWIG_1(id), true) {
  }

  public Event() : this(libsbmlPINVOKE.new_Event__SWIG_2(), true) {
  }

  public Event(long level, long version, XMLNamespaces xmlns) : this(libsbmlPINVOKE.new_Event__SWIG_3(level, version, XMLNamespaces.getCPtr(xmlns)), true) {
  }

  public Event(long level, long version) : this(libsbmlPINVOKE.new_Event__SWIG_4(level, version), true) {
  }

  public Event(Event orig) : this(libsbmlPINVOKE.new_Event__SWIG_5(Event.getCPtr(orig)), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public new Event clone() {
    IntPtr cPtr = libsbmlPINVOKE.Event_clone(swigCPtr);
    Event ret = (cPtr == IntPtr.Zero) ? null : new Event(cPtr, true);
    return ret;
  }

  public Trigger getTrigger() {
    IntPtr cPtr = libsbmlPINVOKE.Event_getTrigger__SWIG_0(swigCPtr);
    Trigger ret = (cPtr == IntPtr.Zero) ? null : new Trigger(cPtr, false);
    return ret;
  }

  public Delay getDelay() {
    IntPtr cPtr = libsbmlPINVOKE.Event_getDelay__SWIG_0(swigCPtr);
    Delay ret = (cPtr == IntPtr.Zero) ? null : new Delay(cPtr, false);
    return ret;
  }

  public string getTimeUnits() {
    string ret = libsbmlPINVOKE.Event_getTimeUnits(swigCPtr);
    return ret;
  }

  public bool getUseValuesFromTriggerTime() {
    bool ret = libsbmlPINVOKE.Event_getUseValuesFromTriggerTime(swigCPtr);
    return ret;
  }

  public bool isSetTrigger() {
    bool ret = libsbmlPINVOKE.Event_isSetTrigger(swigCPtr);
    return ret;
  }

  public bool isSetDelay() {
    bool ret = libsbmlPINVOKE.Event_isSetDelay(swigCPtr);
    return ret;
  }

  public bool isSetTimeUnits() {
    bool ret = libsbmlPINVOKE.Event_isSetTimeUnits(swigCPtr);
    return ret;
  }

  public void setTrigger(Trigger trigger) {
    libsbmlPINVOKE.Event_setTrigger(swigCPtr, Trigger.getCPtr(trigger));
  }

  public void setDelay(Delay delay) {
    libsbmlPINVOKE.Event_setDelay(swigCPtr, Delay.getCPtr(delay));
  }

  public void setTimeUnits(string sid) {
    libsbmlPINVOKE.Event_setTimeUnits(swigCPtr, sid);
  }

  public void setUseValuesFromTriggerTime(bool value) {
    libsbmlPINVOKE.Event_setUseValuesFromTriggerTime(swigCPtr, value);
  }

  public void unsetDelay() {
    libsbmlPINVOKE.Event_unsetDelay(swigCPtr);
  }

  public void unsetTimeUnits() {
    libsbmlPINVOKE.Event_unsetTimeUnits(swigCPtr);
  }

  public void addEventAssignment(EventAssignment ea) {
    libsbmlPINVOKE.Event_addEventAssignment(swigCPtr, EventAssignment.getCPtr(ea));
  }

  public EventAssignment createEventAssignment() {
    IntPtr cPtr = libsbmlPINVOKE.Event_createEventAssignment(swigCPtr);
    EventAssignment ret = (cPtr == IntPtr.Zero) ? null : new EventAssignment(cPtr, false);
    return ret;
  }

  public ListOfEventAssignments getListOfEventAssignments() {
    IntPtr cPtr = libsbmlPINVOKE.Event_getListOfEventAssignments__SWIG_0(swigCPtr);
    ListOfEventAssignments ret = (cPtr == IntPtr.Zero) ? null : new ListOfEventAssignments(cPtr, false);
    return ret;
  }

  public EventAssignment getEventAssignment(long n) {
    IntPtr cPtr = libsbmlPINVOKE.Event_getEventAssignment__SWIG_0(swigCPtr, n);
    EventAssignment ret = (cPtr == IntPtr.Zero) ? null : new EventAssignment(cPtr, false);
    return ret;
  }

  public EventAssignment getEventAssignment(string variable) {
    IntPtr cPtr = libsbmlPINVOKE.Event_getEventAssignment__SWIG_2(swigCPtr, variable);
    EventAssignment ret = (cPtr == IntPtr.Zero) ? null : new EventAssignment(cPtr, false);
    return ret;
  }

  public long getNumEventAssignments() { return (long)libsbmlPINVOKE.Event_getNumEventAssignments(swigCPtr); }

  public override void setSBMLDocument(SBMLDocument d) {
    libsbmlPINVOKE.Event_setSBMLDocument(swigCPtr, SBMLDocument.getCPtr(d));
  }

  public override void setParentSBMLObject(SBase sb) {
    libsbmlPINVOKE.Event_setParentSBMLObject(swigCPtr, SBase.getCPtr(sb));
  }

  public override int getTypeCode() {
    int ret = libsbmlPINVOKE.Event_getTypeCode(swigCPtr);
    return ret;
  }

  public override string getElementName() {
    string ret = libsbmlPINVOKE.Event_getElementName(swigCPtr);
    return ret;
  }

  public void setInternalIdOnly() {
    libsbmlPINVOKE.Event_setInternalIdOnly(swigCPtr);
  }

}

}
