with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLElement4_Interface is

   procedure Initialize (This : in out IHTMLElement4_Type) is
   begin
      Set_IID (This, IID_IHTMLElement4);
   end Initialize;

   function Pointer (This : IHTMLElement4_Type)
     return Pointer_To_IHTMLElement4
   is
   begin
      return To_Pointer_To_IHTMLElement4 (Address (This));
   end Pointer;

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

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

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

   end Put_onmousewheel;

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

      return RetVal;
   end Get_onmousewheel;

   procedure normalize
     (This : IHTMLElement4_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.normalize
         (Pointer (This)));

   end normalize;

   function getAttributeNode
     (This        : IHTMLElement4_Type;
      bstrName    : GNATCOM.Types.BSTR;
      Free        : Boolean := True)
     return Pointer_To_IHTMLDOMAttribute
   is
       RetVal : aliased Pointer_To_IHTMLDOMAttribute;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.getAttributeNode
         (Pointer (This),
          bstrName,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end getAttributeNode;

   function setAttributeNode
     (This           : IHTMLElement4_Type;
      pattr          : Pointer_To_IHTMLDOMAttribute)
     return Pointer_To_IHTMLDOMAttribute
   is
       RetVal : aliased Pointer_To_IHTMLDOMAttribute;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.setAttributeNode
         (Pointer (This),
          pattr,
          RetVal'Unchecked_Access));

      return RetVal;
   end setAttributeNode;

   function removeAttributeNode
     (This           : IHTMLElement4_Type;
      pattr          : Pointer_To_IHTMLDOMAttribute)
     return Pointer_To_IHTMLDOMAttribute
   is
       RetVal : aliased Pointer_To_IHTMLDOMAttribute;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.removeAttributeNode
         (Pointer (This),
          pattr,
          RetVal'Unchecked_Access));

      return RetVal;
   end removeAttributeNode;

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

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

   end Put_onbeforeactivate;

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

      return RetVal;
   end Get_onbeforeactivate;

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

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

   end Put_onfocusin;

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

      return RetVal;
   end Get_onfocusin;

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

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

   end Put_onfocusout;

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

      return RetVal;
   end Get_onfocusout;

end MSHTML.IHTMLElement4_Interface;

