with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLWindow2_Interface is

   procedure Initialize (This : in out IHTMLWindow2_Type) is
   begin
      Set_IID (This, IID_IHTMLWindow2);
   end Initialize;

   function Pointer (This : IHTMLWindow2_Type)
     return Pointer_To_IHTMLWindow2
   is
   begin
      return To_Pointer_To_IHTMLWindow2 (Address (This));
   end Pointer;

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

   function item
     (This       : IHTMLWindow2_Type;
      pvarIndex  : access GNATCOM.Types.VARIANT :=
        GNATCOM.Types.PVARIANT_MISSING)
     return GNATCOM.Types.VARIANT
   is
       RetVal : aliased GNATCOM.Types.VARIANT;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.item
         (Pointer (This),
          pvarIndex,
          RetVal'Unchecked_Access));

      return RetVal;
   end item;

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

      return RetVal;
   end Get_length;

   function Get_frames
     (This : IHTMLWindow2_Type)
     return Pointer_To_IHTMLFramesCollection2
   is
       RetVal : aliased Pointer_To_IHTMLFramesCollection2;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_frames
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_frames;

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

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

   end Put_defaultStatus;

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

      return RetVal;
   end Get_defaultStatus;

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

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

   end Put_status;

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

      return RetVal;
   end Get_status;

   function setTimeout
     (This       : IHTMLWindow2_Type;
      expression : GNATCOM.Types.BSTR;
      msec       : Interfaces.C.long;
      language   : access GNATCOM.Types.VARIANT :=
        GNATCOM.Types.PVARIANT_MISSING;
      Free       : Boolean := True)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.setTimeout
         (Pointer (This),
          expression,
          msec,
          language,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end setTimeout;

   procedure clearTimeout
     (This    : IHTMLWindow2_Type;
      timerID : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.clearTimeout
         (Pointer (This),
          timerID));

   end clearTimeout;

   procedure alert
     (This    : IHTMLWindow2_Type;
      message : GNATCOM.Types.BSTR;
      Free    : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.alert
         (Pointer (This),
          message));

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

   end alert;

   function confirm
     (This      : IHTMLWindow2_Type;
      message   : GNATCOM.Types.BSTR;
      Free      : Boolean := True)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.confirm
         (Pointer (This),
          message,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end confirm;

   function prompt
     (This     : IHTMLWindow2_Type;
      message  : GNATCOM.Types.BSTR;
      defstr   : GNATCOM.Types.BSTR;
      Free     : Boolean := True)
     return GNATCOM.Types.VARIANT
   is
       RetVal : aliased GNATCOM.Types.VARIANT;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.prompt
         (Pointer (This),
          message,
          defstr,
          RetVal'Unchecked_Access));

      if Free then
               GNATCOM.IInterface.Free (message);
               GNATCOM.IInterface.Free (defstr);
      
      end if;

      return RetVal;
   end prompt;

   function Get_Image
     (This : IHTMLWindow2_Type)
     return Pointer_To_IHTMLImageElementFactory
   is
       RetVal : aliased Pointer_To_IHTMLImageElementFactory;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_Image
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_Image;

   function Get_location
     (This : IHTMLWindow2_Type)
     return Pointer_To_IHTMLLocation
   is
       RetVal : aliased Pointer_To_IHTMLLocation;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_location
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_location;

   function Get_history
     (This : IHTMLWindow2_Type)
     return Pointer_To_IOmHistory
   is
       RetVal : aliased Pointer_To_IOmHistory;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_history
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_history;

   procedure close
     (This : IHTMLWindow2_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.close
         (Pointer (This)));

   end close;

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

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

   end Put_opener;

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

      return RetVal;
   end Get_opener;

   function Get_navigator
     (This : IHTMLWindow2_Type)
     return Pointer_To_IOmNavigator
   is
       RetVal : aliased Pointer_To_IOmNavigator;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_navigator
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_navigator;

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

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

   end Put_name;

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

      return RetVal;
   end Get_name;

   function Get_parent
     (This : IHTMLWindow2_Type)
     return Pointer_To_IHTMLWindow2
   is
       RetVal : aliased Pointer_To_IHTMLWindow2;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_parent
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_parent;

   function open
     (This            : IHTMLWindow2_Type;
      url             : GNATCOM.Types.BSTR;
      name            : GNATCOM.Types.BSTR;
      features        : GNATCOM.Types.BSTR;
      replace         : GNATCOM.Types.VARIANT_BOOL;
      Free            : Boolean := True)
     return Pointer_To_IHTMLWindow2
   is
       RetVal : aliased Pointer_To_IHTMLWindow2;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.open
         (Pointer (This),
          url,
          name,
          features,
          replace,
          RetVal'Unchecked_Access));

      if Free then
               GNATCOM.IInterface.Free (url);
               GNATCOM.IInterface.Free (name);
               GNATCOM.IInterface.Free (features);
      
      end if;

      return RetVal;
   end open;

   function Get_self
     (This : IHTMLWindow2_Type)
     return Pointer_To_IHTMLWindow2
   is
       RetVal : aliased Pointer_To_IHTMLWindow2;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_self
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_self;

   function Get_top
     (This : IHTMLWindow2_Type)
     return Pointer_To_IHTMLWindow2
   is
       RetVal : aliased Pointer_To_IHTMLWindow2;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_top
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_top;

   function Get_window
     (This : IHTMLWindow2_Type)
     return Pointer_To_IHTMLWindow2
   is
       RetVal : aliased Pointer_To_IHTMLWindow2;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_window
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_window;

   procedure navigate
     (This : IHTMLWindow2_Type;
      url  : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.navigate
         (Pointer (This),
          url));

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

   end navigate;

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

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

   end Put_onfocus;

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

      return RetVal;
   end Get_onfocus;

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

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

   end Put_onblur;

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

      return RetVal;
   end Get_onblur;

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

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

   end Put_onload;

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

      return RetVal;
   end Get_onload;

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

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

   end Put_onbeforeunload;

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

      return RetVal;
   end Get_onbeforeunload;

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

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

   end Put_onunload;

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

      return RetVal;
   end Get_onunload;

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

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

   end Put_onhelp;

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

      return RetVal;
   end Get_onhelp;

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

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

   end Put_onerror;

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

      return RetVal;
   end Get_onerror;

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

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

   end Put_onresize;

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

      return RetVal;
   end Get_onresize;

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

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

   end Put_onscroll;

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

      return RetVal;
   end Get_onscroll;

   function Get_document
     (This : IHTMLWindow2_Type)
     return Pointer_To_IHTMLDocument2
   is
       RetVal : aliased Pointer_To_IHTMLDocument2;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_document
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_document;

   function Get_event
     (This : IHTMLWindow2_Type)
     return Pointer_To_IHTMLEventObj
   is
       RetVal : aliased Pointer_To_IHTMLEventObj;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_event
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_event;

   function Getu_newEnum
     (This : IHTMLWindow2_Type)
     return GNATCOM.Types.Pointer_To_IUnknown
   is
       RetVal : aliased GNATCOM.Types.Pointer_To_IUnknown;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Getu_newEnum
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Getu_newEnum;

   function showModalDialog
     (This       : IHTMLWindow2_Type;
      dialog     : GNATCOM.Types.BSTR;
      varArgIn   : access GNATCOM.Types.VARIANT :=
        GNATCOM.Types.PVARIANT_MISSING;
      varOptions : access GNATCOM.Types.VARIANT :=
        GNATCOM.Types.PVARIANT_MISSING;
      Free       : Boolean := True)
     return GNATCOM.Types.VARIANT
   is
       RetVal : aliased GNATCOM.Types.VARIANT;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.showModalDialog
         (Pointer (This),
          dialog,
          varArgIn,
          varOptions,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end showModalDialog;

   procedure showHelp
     (This     : IHTMLWindow2_Type;
      helpURL  : GNATCOM.Types.BSTR;
      helpArg  : GNATCOM.Types.VARIANT  := GNATCOM.Types.VARIANT_MISSING;
      features : GNATCOM.Types.BSTR;
      Free     : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.showHelp
         (Pointer (This),
          helpURL,
          helpArg,
          features));

      if Free then
               GNATCOM.IInterface.Free (helpURL);
               GNATCOM.IInterface.Free (helpArg);
               GNATCOM.IInterface.Free (features);
      
      end if;

   end showHelp;

   function Get_screen
     (This : IHTMLWindow2_Type)
     return Pointer_To_IHTMLScreen
   is
       RetVal : aliased Pointer_To_IHTMLScreen;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_screen
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_screen;

   function Get_Option
     (This : IHTMLWindow2_Type)
     return Pointer_To_IHTMLOptionElementFactory
   is
       RetVal : aliased Pointer_To_IHTMLOptionElementFactory;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_Option
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_Option;

   procedure focus
     (This : IHTMLWindow2_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.focus
         (Pointer (This)));

   end focus;

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

      return RetVal;
   end Get_closed;

   procedure blur
     (This : IHTMLWindow2_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.blur
         (Pointer (This)));

   end blur;

   procedure scroll
     (This : IHTMLWindow2_Type;
      x    : Interfaces.C.long;
      y    : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.scroll
         (Pointer (This),
          x,
          y));

   end scroll;

   function Get_clientInformation
     (This : IHTMLWindow2_Type)
     return Pointer_To_IOmNavigator
   is
       RetVal : aliased Pointer_To_IOmNavigator;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_clientInformation
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_clientInformation;

   function setInterval
     (This       : IHTMLWindow2_Type;
      expression : GNATCOM.Types.BSTR;
      msec       : Interfaces.C.long;
      language   : access GNATCOM.Types.VARIANT :=
        GNATCOM.Types.PVARIANT_MISSING;
      Free       : Boolean := True)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.setInterval
         (Pointer (This),
          expression,
          msec,
          language,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end setInterval;

   procedure clearInterval
     (This    : IHTMLWindow2_Type;
      timerID : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.clearInterval
         (Pointer (This),
          timerID));

   end clearInterval;

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

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

   end Put_offscreenBuffering;

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

      return RetVal;
   end Get_offscreenBuffering;

   function execScript
     (This     : IHTMLWindow2_Type;
      code     : GNATCOM.Types.BSTR;
      language : GNATCOM.Types.BSTR;
      Free     : Boolean := True)
     return GNATCOM.Types.VARIANT
   is
       RetVal : aliased GNATCOM.Types.VARIANT;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.execScript
         (Pointer (This),
          code,
          language,
          RetVal'Unchecked_Access));

      if Free then
               GNATCOM.IInterface.Free (code);
               GNATCOM.IInterface.Free (language);
      
      end if;

      return RetVal;
   end execScript;

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

      return RetVal;
   end toString;

   procedure scrollBy
     (This : IHTMLWindow2_Type;
      x    : Interfaces.C.long;
      y    : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.scrollBy
         (Pointer (This),
          x,
          y));

   end scrollBy;

   procedure scrollTo
     (This : IHTMLWindow2_Type;
      x    : Interfaces.C.long;
      y    : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.scrollTo
         (Pointer (This),
          x,
          y));

   end scrollTo;

   procedure moveTo
     (This : IHTMLWindow2_Type;
      x    : Interfaces.C.long;
      y    : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.moveTo
         (Pointer (This),
          x,
          y));

   end moveTo;

   procedure moveBy
     (This : IHTMLWindow2_Type;
      x    : Interfaces.C.long;
      y    : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.moveBy
         (Pointer (This),
          x,
          y));

   end moveBy;

   procedure resizeTo
     (This : IHTMLWindow2_Type;
      x    : Interfaces.C.long;
      y    : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.resizeTo
         (Pointer (This),
          x,
          y));

   end resizeTo;

   procedure resizeBy
     (This : IHTMLWindow2_Type;
      x    : Interfaces.C.long;
      y    : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.resizeBy
         (Pointer (This),
          x,
          y));

   end resizeBy;

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

      return RetVal;
   end Get_external;

end MSHTML.IHTMLWindow2_Interface;

