with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IDOMDragEvent_Interface is

   procedure Initialize (This : in out IDOMDragEvent_Type) is
   begin
      Set_IID (This, IID_IDOMDragEvent);
   end Initialize;

   function Pointer (This : IDOMDragEvent_Type)
     return Pointer_To_IDOMDragEvent
   is
   begin
      return To_Pointer_To_IDOMDragEvent (Address (This));
   end Pointer;

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

   function Get_dataTransfer
     (This : IDOMDragEvent_Type)
     return Pointer_To_IHTMLDataTransfer
   is
       RetVal : aliased Pointer_To_IHTMLDataTransfer;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_dataTransfer
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_dataTransfer;

   procedure initDragEvent
     (This             : IDOMDragEvent_Type;
      eventType        : GNATCOM.Types.BSTR;
      canBubble        : GNATCOM.Types.VARIANT_BOOL;
      cancelable       : GNATCOM.Types.VARIANT_BOOL;
      viewArg          : Pointer_To_IHTMLWindow2;
      detailArg        : Interfaces.C.long;
      screenXArg       : Interfaces.C.long;
      screenYArg       : Interfaces.C.long;
      clientXArg       : Interfaces.C.long;
      clientYArg       : Interfaces.C.long;
      ctrlKeyArg       : GNATCOM.Types.VARIANT_BOOL;
      altKeyArg        : GNATCOM.Types.VARIANT_BOOL;
      shiftKeyArg      : GNATCOM.Types.VARIANT_BOOL;
      metaKeyArg       : GNATCOM.Types.VARIANT_BOOL;
      buttonArg        : Interfaces.C.unsigned_short;
      relatedTargetArg : Pointer_To_IEventTarget;
      dataTransferArg  : Pointer_To_IHTMLDataTransfer;
      Free             : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.initDragEvent
         (Pointer (This),
          eventType,
          canBubble,
          cancelable,
          viewArg,
          detailArg,
          screenXArg,
          screenYArg,
          clientXArg,
          clientYArg,
          ctrlKeyArg,
          altKeyArg,
          shiftKeyArg,
          metaKeyArg,
          buttonArg,
          relatedTargetArg,
          dataTransferArg));

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

   end initDragEvent;

end MSHTML.IDOMDragEvent_Interface;

