with GNATCOM.Errors;

package body MSHTML.IDebugCallbackNotificationHandler_Interface is

   procedure Initialize (This : in out IDebugCallbackNotificationHandler_Type) is
   begin
      Set_IID (This, IID_IDebugCallbackNotificationHandler);
   end Initialize;

   function Pointer (This : IDebugCallbackNotificationHandler_Type)
     return Pointer_To_IDebugCallbackNotificationHandler
   is
   begin
      return To_Pointer_To_IDebugCallbackNotificationHandler (Address (This));
   end Pointer;

   procedure Attach (This    : in out IDebugCallbackNotificationHandler_Type;
                     Pointer : in     Pointer_To_IDebugCallbackNotificationHandler)
   is
   begin
      Attach (This, GNATCOM.IInterface.To_Pointer_To_IUnknown
              (Pointer.all'Address));
   end Attach;

   procedure RequestedCallbackTypes
     (This          : IDebugCallbackNotificationHandler_Type;
      pCallbackMask : GNATCOM.Types.Pointer_To_unsigned_long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.RequestedCallbackTypes
         (Pointer (This),
          pCallbackMask));

   end RequestedCallbackTypes;

   procedure BeforeDispatchEvent
     (This   : IDebugCallbackNotificationHandler_Type;
      pEvent : GNATCOM.Types.Pointer_To_IUnknown)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.BeforeDispatchEvent
         (Pointer (This),
          pEvent));

   end BeforeDispatchEvent;

   procedure DispatchEventComplete
     (This              : IDebugCallbackNotificationHandler_Type;
      pEvent            : GNATCOM.Types.Pointer_To_IUnknown;
      propagationStatus : Interfaces.C.unsigned_long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.DispatchEventComplete
         (Pointer (This),
          pEvent,
          propagationStatus));

   end DispatchEventComplete;

   procedure BeforeInvokeDomCallback
     (This              : IDebugCallbackNotificationHandler_Type;
      pEvent            : GNATCOM.Types.Pointer_To_IUnknown;
      pCallback         : Pointer_To_IScriptEventHandler;
      eStage            : uDOM_EVENT_PHASE;
      propagationStatus : Interfaces.C.unsigned_long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.BeforeInvokeDomCallback
         (Pointer (This),
          pEvent,
          pCallback,
          eStage,
          propagationStatus));

   end BeforeInvokeDomCallback;

   procedure InvokeDomCallbackComplete
     (This              : IDebugCallbackNotificationHandler_Type;
      pEvent            : GNATCOM.Types.Pointer_To_IUnknown;
      pCallback         : Pointer_To_IScriptEventHandler;
      eStage            : uDOM_EVENT_PHASE;
      propagationStatus : Interfaces.C.unsigned_long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.InvokeDomCallbackComplete
         (Pointer (This),
          pEvent,
          pCallback,
          eStage,
          propagationStatus));

   end InvokeDomCallbackComplete;

   procedure BeforeInvokeCallback
     (This                  : IDebugCallbackNotificationHandler_Type;
      eCallbackType         : uSCRIPT_TIMER_TYPE;
      callbackCookie        : Interfaces.C.unsigned_long;
      pdispHandler          : GNATCOM.Types.Pointer_To_IDispatch;
      ullHandlerCookie      : GNATCOM.Types.DWORDLONG;
      FunctionName          : GNATCOM.Types.BSTR;
      line                  : Interfaces.C.unsigned;
      column                : Interfaces.C.unsigned;
      cchLength             : Interfaces.C.unsigned;
      pDebugDocumentContext : GNATCOM.Types.Pointer_To_IUnknown;
      Free                  : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.BeforeInvokeCallback
         (Pointer (This),
          eCallbackType,
          callbackCookie,
          pdispHandler,
          ullHandlerCookie,
          FunctionName,
          line,
          column,
          cchLength,
          pDebugDocumentContext));

      if Free then
               GNATCOM.IInterface.Free (FunctionName);
      
      end if;

   end BeforeInvokeCallback;

   procedure InvokeCallbackComplete
     (This                  : IDebugCallbackNotificationHandler_Type;
      eCallbackType         : uSCRIPT_TIMER_TYPE;
      callbackCookie        : Interfaces.C.unsigned_long;
      pdispHandler          : GNATCOM.Types.Pointer_To_IDispatch;
      ullHandlerCookie      : GNATCOM.Types.DWORDLONG;
      FunctionName          : GNATCOM.Types.BSTR;
      line                  : Interfaces.C.unsigned;
      column                : Interfaces.C.unsigned;
      cchLength             : Interfaces.C.unsigned;
      pDebugDocumentContext : GNATCOM.Types.Pointer_To_IUnknown;
      Free                  : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.InvokeCallbackComplete
         (Pointer (This),
          eCallbackType,
          callbackCookie,
          pdispHandler,
          ullHandlerCookie,
          FunctionName,
          line,
          column,
          cchLength,
          pDebugDocumentContext));

      if Free then
               GNATCOM.IInterface.Free (FunctionName);
      
      end if;

   end InvokeCallbackComplete;

end MSHTML.IDebugCallbackNotificationHandler_Interface;

