SipCallback.cs 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.9
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. namespace org.doubango.tinyWRAP {
  9. using System;
  10. using System.Runtime.InteropServices;
  11. public class SipCallback : IDisposable {
  12. private HandleRef swigCPtr;
  13. protected bool swigCMemOwn;
  14. internal SipCallback(IntPtr cPtr, bool cMemoryOwn) {
  15. swigCMemOwn = cMemoryOwn;
  16. swigCPtr = new HandleRef(this, cPtr);
  17. }
  18. internal static HandleRef getCPtr(SipCallback obj) {
  19. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  20. }
  21. ~SipCallback() {
  22. Dispose();
  23. }
  24. public virtual void Dispose() {
  25. lock(this) {
  26. if (swigCPtr.Handle != IntPtr.Zero) {
  27. if (swigCMemOwn) {
  28. swigCMemOwn = false;
  29. tinyWRAPPINVOKE.delete_SipCallback(swigCPtr);
  30. }
  31. swigCPtr = new HandleRef(null, IntPtr.Zero);
  32. }
  33. GC.SuppressFinalize(this);
  34. }
  35. }
  36. public SipCallback() : this(tinyWRAPPINVOKE.new_SipCallback(), true) {
  37. SwigDirectorConnect();
  38. }
  39. public virtual int OnDialogEvent(DialogEvent e) {
  40. int ret = (SwigDerivedClassHasMethod("OnDialogEvent", swigMethodTypes0) ? tinyWRAPPINVOKE.SipCallback_OnDialogEventSwigExplicitSipCallback(swigCPtr, DialogEvent.getCPtr(e)) : tinyWRAPPINVOKE.SipCallback_OnDialogEvent(swigCPtr, DialogEvent.getCPtr(e)));
  41. return ret;
  42. }
  43. public virtual int OnStackEvent(StackEvent e) {
  44. int ret = (SwigDerivedClassHasMethod("OnStackEvent", swigMethodTypes1) ? tinyWRAPPINVOKE.SipCallback_OnStackEventSwigExplicitSipCallback(swigCPtr, StackEvent.getCPtr(e)) : tinyWRAPPINVOKE.SipCallback_OnStackEvent(swigCPtr, StackEvent.getCPtr(e)));
  45. return ret;
  46. }
  47. public virtual int OnInviteEvent(InviteEvent e) {
  48. int ret = (SwigDerivedClassHasMethod("OnInviteEvent", swigMethodTypes2) ? tinyWRAPPINVOKE.SipCallback_OnInviteEventSwigExplicitSipCallback(swigCPtr, InviteEvent.getCPtr(e)) : tinyWRAPPINVOKE.SipCallback_OnInviteEvent(swigCPtr, InviteEvent.getCPtr(e)));
  49. return ret;
  50. }
  51. public virtual int OnMessagingEvent(MessagingEvent e) {
  52. int ret = (SwigDerivedClassHasMethod("OnMessagingEvent", swigMethodTypes3) ? tinyWRAPPINVOKE.SipCallback_OnMessagingEventSwigExplicitSipCallback(swigCPtr, MessagingEvent.getCPtr(e)) : tinyWRAPPINVOKE.SipCallback_OnMessagingEvent(swigCPtr, MessagingEvent.getCPtr(e)));
  53. return ret;
  54. }
  55. public virtual int OnInfoEvent(InfoEvent e) {
  56. int ret = (SwigDerivedClassHasMethod("OnInfoEvent", swigMethodTypes4) ? tinyWRAPPINVOKE.SipCallback_OnInfoEventSwigExplicitSipCallback(swigCPtr, InfoEvent.getCPtr(e)) : tinyWRAPPINVOKE.SipCallback_OnInfoEvent(swigCPtr, InfoEvent.getCPtr(e)));
  57. return ret;
  58. }
  59. public virtual int OnOptionsEvent(OptionsEvent e) {
  60. int ret = (SwigDerivedClassHasMethod("OnOptionsEvent", swigMethodTypes5) ? tinyWRAPPINVOKE.SipCallback_OnOptionsEventSwigExplicitSipCallback(swigCPtr, OptionsEvent.getCPtr(e)) : tinyWRAPPINVOKE.SipCallback_OnOptionsEvent(swigCPtr, OptionsEvent.getCPtr(e)));
  61. return ret;
  62. }
  63. public virtual int OnPublicationEvent(PublicationEvent e) {
  64. int ret = (SwigDerivedClassHasMethod("OnPublicationEvent", swigMethodTypes6) ? tinyWRAPPINVOKE.SipCallback_OnPublicationEventSwigExplicitSipCallback(swigCPtr, PublicationEvent.getCPtr(e)) : tinyWRAPPINVOKE.SipCallback_OnPublicationEvent(swigCPtr, PublicationEvent.getCPtr(e)));
  65. return ret;
  66. }
  67. public virtual int OnRegistrationEvent(RegistrationEvent e) {
  68. int ret = (SwigDerivedClassHasMethod("OnRegistrationEvent", swigMethodTypes7) ? tinyWRAPPINVOKE.SipCallback_OnRegistrationEventSwigExplicitSipCallback(swigCPtr, RegistrationEvent.getCPtr(e)) : tinyWRAPPINVOKE.SipCallback_OnRegistrationEvent(swigCPtr, RegistrationEvent.getCPtr(e)));
  69. return ret;
  70. }
  71. public virtual int OnSubscriptionEvent(SubscriptionEvent e) {
  72. int ret = (SwigDerivedClassHasMethod("OnSubscriptionEvent", swigMethodTypes8) ? tinyWRAPPINVOKE.SipCallback_OnSubscriptionEventSwigExplicitSipCallback(swigCPtr, SubscriptionEvent.getCPtr(e)) : tinyWRAPPINVOKE.SipCallback_OnSubscriptionEvent(swigCPtr, SubscriptionEvent.getCPtr(e)));
  73. return ret;
  74. }
  75. private void SwigDirectorConnect() {
  76. if (SwigDerivedClassHasMethod("OnDialogEvent", swigMethodTypes0))
  77. swigDelegate0 = new SwigDelegateSipCallback_0(SwigDirectorOnDialogEvent);
  78. if (SwigDerivedClassHasMethod("OnStackEvent", swigMethodTypes1))
  79. swigDelegate1 = new SwigDelegateSipCallback_1(SwigDirectorOnStackEvent);
  80. if (SwigDerivedClassHasMethod("OnInviteEvent", swigMethodTypes2))
  81. swigDelegate2 = new SwigDelegateSipCallback_2(SwigDirectorOnInviteEvent);
  82. if (SwigDerivedClassHasMethod("OnMessagingEvent", swigMethodTypes3))
  83. swigDelegate3 = new SwigDelegateSipCallback_3(SwigDirectorOnMessagingEvent);
  84. if (SwigDerivedClassHasMethod("OnInfoEvent", swigMethodTypes4))
  85. swigDelegate4 = new SwigDelegateSipCallback_4(SwigDirectorOnInfoEvent);
  86. if (SwigDerivedClassHasMethod("OnOptionsEvent", swigMethodTypes5))
  87. swigDelegate5 = new SwigDelegateSipCallback_5(SwigDirectorOnOptionsEvent);
  88. if (SwigDerivedClassHasMethod("OnPublicationEvent", swigMethodTypes6))
  89. swigDelegate6 = new SwigDelegateSipCallback_6(SwigDirectorOnPublicationEvent);
  90. if (SwigDerivedClassHasMethod("OnRegistrationEvent", swigMethodTypes7))
  91. swigDelegate7 = new SwigDelegateSipCallback_7(SwigDirectorOnRegistrationEvent);
  92. if (SwigDerivedClassHasMethod("OnSubscriptionEvent", swigMethodTypes8))
  93. swigDelegate8 = new SwigDelegateSipCallback_8(SwigDirectorOnSubscriptionEvent);
  94. tinyWRAPPINVOKE.SipCallback_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7, swigDelegate8);
  95. }
  96. private bool SwigDerivedClassHasMethod(string methodName, Type[] methodTypes) {
  97. System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, methodTypes, null);
  98. bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(SipCallback));
  99. return hasDerivedMethod;
  100. }
  101. private int SwigDirectorOnDialogEvent(IntPtr e) {
  102. return OnDialogEvent((e == IntPtr.Zero) ? null : new DialogEvent(e, false));
  103. }
  104. private int SwigDirectorOnStackEvent(IntPtr e) {
  105. return OnStackEvent((e == IntPtr.Zero) ? null : new StackEvent(e, false));
  106. }
  107. private int SwigDirectorOnInviteEvent(IntPtr e) {
  108. return OnInviteEvent((e == IntPtr.Zero) ? null : new InviteEvent(e, false));
  109. }
  110. private int SwigDirectorOnMessagingEvent(IntPtr e) {
  111. return OnMessagingEvent((e == IntPtr.Zero) ? null : new MessagingEvent(e, false));
  112. }
  113. private int SwigDirectorOnInfoEvent(IntPtr e) {
  114. return OnInfoEvent((e == IntPtr.Zero) ? null : new InfoEvent(e, false));
  115. }
  116. private int SwigDirectorOnOptionsEvent(IntPtr e) {
  117. return OnOptionsEvent((e == IntPtr.Zero) ? null : new OptionsEvent(e, false));
  118. }
  119. private int SwigDirectorOnPublicationEvent(IntPtr e) {
  120. return OnPublicationEvent((e == IntPtr.Zero) ? null : new PublicationEvent(e, false));
  121. }
  122. private int SwigDirectorOnRegistrationEvent(IntPtr e) {
  123. return OnRegistrationEvent((e == IntPtr.Zero) ? null : new RegistrationEvent(e, false));
  124. }
  125. private int SwigDirectorOnSubscriptionEvent(IntPtr e) {
  126. return OnSubscriptionEvent((e == IntPtr.Zero) ? null : new SubscriptionEvent(e, false));
  127. }
  128. public delegate int SwigDelegateSipCallback_0(IntPtr e);
  129. public delegate int SwigDelegateSipCallback_1(IntPtr e);
  130. public delegate int SwigDelegateSipCallback_2(IntPtr e);
  131. public delegate int SwigDelegateSipCallback_3(IntPtr e);
  132. public delegate int SwigDelegateSipCallback_4(IntPtr e);
  133. public delegate int SwigDelegateSipCallback_5(IntPtr e);
  134. public delegate int SwigDelegateSipCallback_6(IntPtr e);
  135. public delegate int SwigDelegateSipCallback_7(IntPtr e);
  136. public delegate int SwigDelegateSipCallback_8(IntPtr e);
  137. private SwigDelegateSipCallback_0 swigDelegate0;
  138. private SwigDelegateSipCallback_1 swigDelegate1;
  139. private SwigDelegateSipCallback_2 swigDelegate2;
  140. private SwigDelegateSipCallback_3 swigDelegate3;
  141. private SwigDelegateSipCallback_4 swigDelegate4;
  142. private SwigDelegateSipCallback_5 swigDelegate5;
  143. private SwigDelegateSipCallback_6 swigDelegate6;
  144. private SwigDelegateSipCallback_7 swigDelegate7;
  145. private SwigDelegateSipCallback_8 swigDelegate8;
  146. private static Type[] swigMethodTypes0 = new Type[] { typeof(DialogEvent) };
  147. private static Type[] swigMethodTypes1 = new Type[] { typeof(StackEvent) };
  148. private static Type[] swigMethodTypes2 = new Type[] { typeof(InviteEvent) };
  149. private static Type[] swigMethodTypes3 = new Type[] { typeof(MessagingEvent) };
  150. private static Type[] swigMethodTypes4 = new Type[] { typeof(InfoEvent) };
  151. private static Type[] swigMethodTypes5 = new Type[] { typeof(OptionsEvent) };
  152. private static Type[] swigMethodTypes6 = new Type[] { typeof(PublicationEvent) };
  153. private static Type[] swigMethodTypes7 = new Type[] { typeof(RegistrationEvent) };
  154. private static Type[] swigMethodTypes8 = new Type[] { typeof(SubscriptionEvent) };
  155. }
  156. }