with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLEventObj_Interface is

   procedure Initialize (This : in out IHTMLEventObj_Type) is
   begin
      Set_IID (This, IID_IHTMLEventObj);
   end Initialize;

   function Pointer (This : IHTMLEventObj_Type)
     return Pointer_To_IHTMLEventObj
   is
   begin
      return To_Pointer_To_IHTMLEventObj (Address (This));
   end Pointer;

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

   function Get_srcElement
     (This : IHTMLEventObj_Type)
     return Pointer_To_IHTMLElement
   is
       RetVal : aliased Pointer_To_IHTMLElement;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_srcElement
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_srcElement;

   function Get_altKey
     (This : IHTMLEventObj_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_altKey
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_altKey;

   function Get_ctrlKey
     (This : IHTMLEventObj_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_ctrlKey
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_ctrlKey;

   function Get_shiftKey
     (This : IHTMLEventObj_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_shiftKey
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_shiftKey;

   procedure Put_returnValue
     (This : IHTMLEventObj_Type;
      p    : GNATCOM.Types.VARIANT;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_returnValue
         (Pointer (This),
          p));

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

   end Put_returnValue;

   function Get_returnValue
     (This : IHTMLEventObj_Type)
     return GNATCOM.Types.VARIANT
   is
       RetVal : aliased GNATCOM.Types.VARIANT;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_returnValue
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_returnValue;

   procedure Put_cancelBubble
     (This : IHTMLEventObj_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_cancelBubble
         (Pointer (This),
          p));

   end Put_cancelBubble;

   function Get_cancelBubble
     (This : IHTMLEventObj_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_cancelBubble
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_cancelBubble;

   function Get_fromElement
     (This : IHTMLEventObj_Type)
     return Pointer_To_IHTMLElement
   is
       RetVal : aliased Pointer_To_IHTMLElement;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_fromElement
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_fromElement;

   function Get_toElement
     (This : IHTMLEventObj_Type)
     return Pointer_To_IHTMLElement
   is
       RetVal : aliased Pointer_To_IHTMLElement;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_toElement
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_toElement;

   procedure Put_keyCode
     (This : IHTMLEventObj_Type;
      p    : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_keyCode
         (Pointer (This),
          p));

   end Put_keyCode;

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

      return RetVal;
   end Get_keyCode;

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

      return RetVal;
   end Get_button;

   function Get_type
     (This : IHTMLEventObj_Type)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_type
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_type;

   function Get_qualifier
     (This : IHTMLEventObj_Type)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_qualifier
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_qualifier;

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

      return RetVal;
   end Get_reason;

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

      return RetVal;
   end Get_x;

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

      return RetVal;
   end Get_y;

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

      return RetVal;
   end Get_clientX;

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

      return RetVal;
   end Get_clientY;

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

      return RetVal;
   end Get_offsetX;

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

      return RetVal;
   end Get_offsetY;

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

      return RetVal;
   end Get_screenX;

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

      return RetVal;
   end Get_screenY;

   function Get_srcFilter
     (This : IHTMLEventObj_Type)
     return GNATCOM.Types.Pointer_To_IDispatch
   is
       RetVal : aliased GNATCOM.Types.Pointer_To_IDispatch;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_srcFilter
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_srcFilter;

end MSHTML.IHTMLEventObj_Interface;

