with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLEventObj5_Interface is

   procedure Initialize (This : in out IHTMLEventObj5_Type) is
   begin
      Set_IID (This, IID_IHTMLEventObj5);
   end Initialize;

   function Pointer (This : IHTMLEventObj5_Type)
     return Pointer_To_IHTMLEventObj5
   is
   begin
      return To_Pointer_To_IHTMLEventObj5 (Address (This));
   end Pointer;

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

   procedure Put_url
     (This : IHTMLEventObj5_Type;
      p    : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_url
         (Pointer (This),
          p));

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

   end Put_url;

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

      return RetVal;
   end Get_url;

   procedure Put_data
     (This : IHTMLEventObj5_Type;
      p    : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_data
         (Pointer (This),
          p));

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

   end Put_data;

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

      return RetVal;
   end Get_data;

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

      return RetVal;
   end Get_source;

   procedure Put_origin
     (This : IHTMLEventObj5_Type;
      p    : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_origin
         (Pointer (This),
          p));

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

   end Put_origin;

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

      return RetVal;
   end Get_origin;

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

   end Put_issession;

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

      return RetVal;
   end Get_issession;

end MSHTML.IHTMLEventObj5_Interface;

