with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IDOMMSManipulationEvent_Interface is

   procedure Initialize (This : in out IDOMMSManipulationEvent_Type) is
   begin
      Set_IID (This, IID_IDOMMSManipulationEvent);
   end Initialize;

   function Pointer (This : IDOMMSManipulationEvent_Type)
     return Pointer_To_IDOMMSManipulationEvent
   is
   begin
      return To_Pointer_To_IDOMMSManipulationEvent (Address (This));
   end Pointer;

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

   function Get_lastState
     (This : IDOMMSManipulationEvent_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_lastState
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_lastState;

   function Get_currentState
     (This : IDOMMSManipulationEvent_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_currentState
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_currentState;

   procedure initMSManipulationEvent
     (This         : IDOMMSManipulationEvent_Type;
      eventType    : GNATCOM.Types.BSTR;
      canBubble    : GNATCOM.Types.VARIANT_BOOL;
      cancelable   : GNATCOM.Types.VARIANT_BOOL;
      viewArg      : Pointer_To_IHTMLWindow2;
      detailArg    : Interfaces.C.long;
      lastState    : Interfaces.C.long;
      currentState : Interfaces.C.long;
      Free         : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.initMSManipulationEvent
         (Pointer (This),
          eventType,
          canBubble,
          cancelable,
          viewArg,
          detailArg,
          lastState,
          currentState));

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

   end initMSManipulationEvent;

end MSHTML.IDOMMSManipulationEvent_Interface;

