with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLAttributeCollection4_Interface is

   procedure Initialize (This : in out IHTMLAttributeCollection4_Type) is
   begin
      Set_IID (This, IID_IHTMLAttributeCollection4);
   end Initialize;

   function Pointer (This : IHTMLAttributeCollection4_Type)
     return Pointer_To_IHTMLAttributeCollection4
   is
   begin
      return To_Pointer_To_IHTMLAttributeCollection4 (Address (This));
   end Pointer;

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

   function getNamedItemNS
     (This      : IHTMLAttributeCollection4_Type;
      pvarNS    : access GNATCOM.Types.VARIANT :=
        GNATCOM.Types.PVARIANT_MISSING;
      bstrName  : GNATCOM.Types.BSTR;
      Free      : Boolean := True)
     return Pointer_To_IHTMLDOMAttribute2
   is
       RetVal : aliased Pointer_To_IHTMLDOMAttribute2;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.getNamedItemNS
         (Pointer (This),
          pvarNS,
          bstrName,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end getNamedItemNS;

   function setNamedItemNS
     (This      : IHTMLAttributeCollection4_Type;
      pNodeIn   : Pointer_To_IHTMLDOMAttribute2)
     return Pointer_To_IHTMLDOMAttribute2
   is
       RetVal : aliased Pointer_To_IHTMLDOMAttribute2;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.setNamedItemNS
         (Pointer (This),
          pNodeIn,
          RetVal'Unchecked_Access));

      return RetVal;
   end setNamedItemNS;

   function removeNamedItemNS
     (This      : IHTMLAttributeCollection4_Type;
      pvarNS    : access GNATCOM.Types.VARIANT :=
        GNATCOM.Types.PVARIANT_MISSING;
      bstrName  : GNATCOM.Types.BSTR;
      Free      : Boolean := True)
     return Pointer_To_IHTMLDOMAttribute2
   is
       RetVal : aliased Pointer_To_IHTMLDOMAttribute2;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.removeNamedItemNS
         (Pointer (This),
          pvarNS,
          bstrName,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end removeNamedItemNS;

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

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

      return RetVal;
   end getNamedItem;

   function setNamedItem
     (This      : IHTMLAttributeCollection4_Type;
      pNodeIn   : Pointer_To_IHTMLDOMAttribute2)
     return Pointer_To_IHTMLDOMAttribute2
   is
       RetVal : aliased Pointer_To_IHTMLDOMAttribute2;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.setNamedItem
         (Pointer (This),
          pNodeIn,
          RetVal'Unchecked_Access));

      return RetVal;
   end setNamedItem;

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

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

      return RetVal;
   end removeNamedItem;

   function item
     (This      : IHTMLAttributeCollection4_Type;
      index     : Interfaces.C.long)
     return Pointer_To_IHTMLDOMAttribute2
   is
       RetVal : aliased Pointer_To_IHTMLDOMAttribute2;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.item
         (Pointer (This),
          index,
          RetVal'Unchecked_Access));

      return RetVal;
   end item;

   function Get_length
     (This : IHTMLAttributeCollection4_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;

end MSHTML.IHTMLAttributeCollection4_Interface;

