with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IDOMMouseWheelEvent_Interface is

   procedure Initialize (This : in out IDOMMouseWheelEvent_Type) is
   begin
      Set_IID (This, IID_IDOMMouseWheelEvent);
   end Initialize;

   function Pointer (This : IDOMMouseWheelEvent_Type)
     return Pointer_To_IDOMMouseWheelEvent
   is
   begin
      return To_Pointer_To_IDOMMouseWheelEvent (Address (This));
   end Pointer;

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

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

      return RetVal;
   end Get_wheelDelta;

   procedure initMouseWheelEvent
     (This             : IDOMMouseWheelEvent_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;
      buttonArg        : Interfaces.C.unsigned_short;
      relatedTargetArg : Pointer_To_IEventTarget;
      modifiersListArg : GNATCOM.Types.BSTR;
      wheelDeltaArg    : Interfaces.C.long;
      Free             : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.initMouseWheelEvent
         (Pointer (This),
          eventType,
          canBubble,
          cancelable,
          viewArg,
          detailArg,
          screenXArg,
          screenYArg,
          clientXArg,
          clientYArg,
          buttonArg,
          relatedTargetArg,
          modifiersListArg,
          wheelDeltaArg));

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

   end initMouseWheelEvent;

end MSHTML.IDOMMouseWheelEvent_Interface;

