with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLElement2_Interface is

   procedure Initialize (This : in out IHTMLElement2_Type) is
   begin
      Set_IID (This, IID_IHTMLElement2);
   end Initialize;

   function Pointer (This : IHTMLElement2_Type)
     return Pointer_To_IHTMLElement2
   is
   begin
      return To_Pointer_To_IHTMLElement2 (Address (This));
   end Pointer;

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

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

      return RetVal;
   end Get_scopeName;

   procedure setCapture
     (This             : IHTMLElement2_Type;
      containerCapture : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.setCapture
         (Pointer (This),
          containerCapture));

   end setCapture;

   procedure releaseCapture
     (This : IHTMLElement2_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.releaseCapture
         (Pointer (This)));

   end releaseCapture;

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

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

   end Put_onlosecapture;

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

      return RetVal;
   end Get_onlosecapture;

   function componentFromPoint
     (This      : IHTMLElement2_Type;
      x         : Interfaces.C.long;
      y         : Interfaces.C.long)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.componentFromPoint
         (Pointer (This),
          x,
          y,
          RetVal'Unchecked_Access));

      return RetVal;
   end componentFromPoint;

   procedure doScroll
     (This      : IHTMLElement2_Type;
      component : GNATCOM.Types.VARIANT  := GNATCOM.Types.VARIANT_MISSING;
      Free      : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.doScroll
         (Pointer (This),
          component));

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

   end doScroll;

   procedure Put_onscroll
     (This : IHTMLElement2_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 : IHTMLElement2_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;

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

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

   end Put_ondrag;

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

      return RetVal;
   end Get_ondrag;

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

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

   end Put_ondragend;

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

      return RetVal;
   end Get_ondragend;

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

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

   end Put_ondragenter;

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

      return RetVal;
   end Get_ondragenter;

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

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

   end Put_ondragover;

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

      return RetVal;
   end Get_ondragover;

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

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

   end Put_ondragleave;

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

      return RetVal;
   end Get_ondragleave;

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

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

   end Put_ondrop;

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

      return RetVal;
   end Get_ondrop;

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

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

   end Put_onbeforecut;

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

      return RetVal;
   end Get_onbeforecut;

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

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

   end Put_oncut;

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

      return RetVal;
   end Get_oncut;

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

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

   end Put_onbeforecopy;

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

      return RetVal;
   end Get_onbeforecopy;

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

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

   end Put_oncopy;

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

      return RetVal;
   end Get_oncopy;

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

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

   end Put_onbeforepaste;

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

      return RetVal;
   end Get_onbeforepaste;

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

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

   end Put_onpaste;

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

      return RetVal;
   end Get_onpaste;

   function Get_currentStyle
     (This : IHTMLElement2_Type)
     return Pointer_To_IHTMLCurrentStyle
   is
       RetVal : aliased Pointer_To_IHTMLCurrentStyle;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_currentStyle
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_currentStyle;

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

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

   end Put_onpropertychange;

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

      return RetVal;
   end Get_onpropertychange;

   function getClientRects
     (This     : IHTMLElement2_Type)
     return Pointer_To_IHTMLRectCollection
   is
       RetVal : aliased Pointer_To_IHTMLRectCollection;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.getClientRects
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end getClientRects;

   function getBoundingClientRect
     (This  : IHTMLElement2_Type)
     return Pointer_To_IHTMLRect
   is
       RetVal : aliased Pointer_To_IHTMLRect;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.getBoundingClientRect
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end getBoundingClientRect;

   procedure setExpression
     (This       : IHTMLElement2_Type;
      propname   : GNATCOM.Types.BSTR;
      expression : GNATCOM.Types.BSTR;
      language   : GNATCOM.Types.BSTR;
      Free       : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.setExpression
         (Pointer (This),
          propname,
          expression,
          language));

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

   end setExpression;

   function getExpression
     (This       : IHTMLElement2_Type;
      propname   : GNATCOM.Types.BSTR;
      Free       : Boolean := True)
     return GNATCOM.Types.VARIANT
   is
       RetVal : aliased GNATCOM.Types.VARIANT;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.getExpression
         (Pointer (This),
          propname,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end getExpression;

   function removeExpression
     (This      : IHTMLElement2_Type;
      propname  : 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.removeExpression
         (Pointer (This),
          propname,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end removeExpression;

   procedure Put_tabIndex
     (This : IHTMLElement2_Type;
      p    : Interfaces.C.short)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_tabIndex
         (Pointer (This),
          p));

   end Put_tabIndex;

   function Get_tabIndex
     (This : IHTMLElement2_Type)
     return Interfaces.C.short
   is
       RetVal : aliased Interfaces.C.short;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_tabIndex
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_tabIndex;

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

   end focus;

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

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

   end Put_accessKey;

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

      return RetVal;
   end Get_accessKey;

   procedure Put_onblur
     (This : IHTMLElement2_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 : IHTMLElement2_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_onfocus
     (This : IHTMLElement2_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 : IHTMLElement2_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_onresize
     (This : IHTMLElement2_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 : IHTMLElement2_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 blur
     (This : IHTMLElement2_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.blur
         (Pointer (This)));

   end blur;

   procedure addFilter
     (This : IHTMLElement2_Type;
      pUnk : GNATCOM.Types.Pointer_To_IUnknown)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.addFilter
         (Pointer (This),
          pUnk));

   end addFilter;

   procedure removeFilter
     (This : IHTMLElement2_Type;
      pUnk : GNATCOM.Types.Pointer_To_IUnknown)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.removeFilter
         (Pointer (This),
          pUnk));

   end removeFilter;

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

      return RetVal;
   end Get_clientHeight;

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

      return RetVal;
   end Get_clientWidth;

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

      return RetVal;
   end Get_clientTop;

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

      return RetVal;
   end Get_clientLeft;

   function attachEvent
     (This     : IHTMLElement2_Type;
      event    : GNATCOM.Types.BSTR;
      pdisp    : GNATCOM.Types.Pointer_To_IDispatch;
      Free     : Boolean := True)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.attachEvent
         (Pointer (This),
          event,
          pdisp,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end attachEvent;

   procedure detachEvent
     (This  : IHTMLElement2_Type;
      event : GNATCOM.Types.BSTR;
      pdisp : GNATCOM.Types.Pointer_To_IDispatch;
      Free  : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.detachEvent
         (Pointer (This),
          event,
          pdisp));

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

   end detachEvent;

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

      return RetVal;
   end Get_readyState;

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

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

   end Put_onreadystatechange;

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

      return RetVal;
   end Get_onreadystatechange;

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

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

   end Put_onrowsdelete;

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

      return RetVal;
   end Get_onrowsdelete;

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

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

   end Put_onrowsinserted;

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

      return RetVal;
   end Get_onrowsinserted;

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

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

   end Put_oncellchange;

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

      return RetVal;
   end Get_oncellchange;

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

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

   end Put_dir;

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

      return RetVal;
   end Get_dir;

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

      return RetVal;
   end createControlRange;

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

      return RetVal;
   end Get_scrollHeight;

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

      return RetVal;
   end Get_scrollWidth;

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

   end Put_scrollTop;

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

      return RetVal;
   end Get_scrollTop;

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

   end Put_scrollLeft;

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

      return RetVal;
   end Get_scrollLeft;

   procedure clearAttributes
     (This : IHTMLElement2_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.clearAttributes
         (Pointer (This)));

   end clearAttributes;

   procedure mergeAttributes
     (This      : IHTMLElement2_Type;
      mergeThis : Pointer_To_IHTMLElement)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.mergeAttributes
         (Pointer (This),
          mergeThis));

   end mergeAttributes;

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

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

   end Put_oncontextmenu;

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

      return RetVal;
   end Get_oncontextmenu;

   function insertAdjacentElement
     (This            : IHTMLElement2_Type;
      where           : GNATCOM.Types.BSTR;
      insertedElement : Pointer_To_IHTMLElement;
      Free            : Boolean := True)
     return Pointer_To_IHTMLElement
   is
       RetVal : aliased Pointer_To_IHTMLElement;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.insertAdjacentElement
         (Pointer (This),
          where,
          insertedElement,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end insertAdjacentElement;

   function applyElement
     (This    : IHTMLElement2_Type;
      apply   : Pointer_To_IHTMLElement;
      where   : GNATCOM.Types.BSTR;
      Free    : Boolean := True)
     return Pointer_To_IHTMLElement
   is
       RetVal : aliased Pointer_To_IHTMLElement;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.applyElement
         (Pointer (This),
          apply,
          where,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end applyElement;

   function getAdjacentText
     (This  : IHTMLElement2_Type;
      where : GNATCOM.Types.BSTR;
      Free  : Boolean := True)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.getAdjacentText
         (Pointer (This),
          where,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end getAdjacentText;

   function replaceAdjacentText
     (This    : IHTMLElement2_Type;
      where   : GNATCOM.Types.BSTR;
      newText : GNATCOM.Types.BSTR;
      Free    : Boolean := True)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.replaceAdjacentText
         (Pointer (This),
          where,
          newText,
          RetVal'Unchecked_Access));

      if Free then
               GNATCOM.IInterface.Free (where);
               GNATCOM.IInterface.Free (newText);
      
      end if;

      return RetVal;
   end replaceAdjacentText;

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

      return RetVal;
   end Get_canHaveChildren;

   function addBehavior
     (This        : IHTMLElement2_Type;
      bstrURL     : GNATCOM.Types.BSTR;
      pvarFactory : 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.addBehavior
         (Pointer (This),
          bstrURL,
          pvarFactory,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end addBehavior;

   function removeBehavior
     (This     : IHTMLElement2_Type;
      cookie   : Interfaces.C.long)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.removeBehavior
         (Pointer (This),
          cookie,
          RetVal'Unchecked_Access));

      return RetVal;
   end removeBehavior;

   function Get_runtimeStyle
     (This : IHTMLElement2_Type)
     return Pointer_To_IHTMLStyle
   is
       RetVal : aliased Pointer_To_IHTMLStyle;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_runtimeStyle
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_runtimeStyle;

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

      return RetVal;
   end Get_behaviorUrns;

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

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

   end Put_tagUrn;

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

      return RetVal;
   end Get_tagUrn;

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

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

   end Put_onbeforeeditfocus;

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

      return RetVal;
   end Get_onbeforeeditfocus;

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

      return RetVal;
   end Get_readyStateValue;

   function getElementsByTagName
     (This    : IHTMLElement2_Type;
      v       : GNATCOM.Types.BSTR;
      Free    : Boolean := True)
     return Pointer_To_IHTMLElementCollection
   is
       RetVal : aliased Pointer_To_IHTMLElementCollection;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.getElementsByTagName
         (Pointer (This),
          v,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end getElementsByTagName;

end MSHTML.IHTMLElement2_Interface;

