with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.ISVGStringList_Interface is

   procedure Initialize (This : in out ISVGStringList_Type) is
   begin
      Set_IID (This, IID_ISVGStringList);
   end Initialize;

   function Pointer (This : ISVGStringList_Type)
     return Pointer_To_ISVGStringList
   is
   begin
      return To_Pointer_To_ISVGStringList (Address (This));
   end Pointer;

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

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

   end Put_numberOfItems;

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

      return RetVal;
   end Get_numberOfItems;

   procedure clear
     (This : ISVGStringList_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.clear
         (Pointer (This)));

   end clear;

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

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

      return RetVal;
   end initialize;

   function getItem
     (This     : ISVGStringList_Type;
      index    : Interfaces.C.long)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.getItem
         (Pointer (This),
          index,
          RetVal'Unchecked_Access));

      return RetVal;
   end getItem;

   function insertItemBefore
     (This     : ISVGStringList_Type;
      newItem  : GNATCOM.Types.BSTR;
      index    : Interfaces.C.long;
      Free     : Boolean := True)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.insertItemBefore
         (Pointer (This),
          newItem,
          index,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end insertItemBefore;

   function replaceItem
     (This     : ISVGStringList_Type;
      newItem  : GNATCOM.Types.BSTR;
      index    : Interfaces.C.long;
      Free     : Boolean := True)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.replaceItem
         (Pointer (This),
          newItem,
          index,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end replaceItem;

   function removeItem
     (This     : ISVGStringList_Type;
      index    : Interfaces.C.long)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.removeItem
         (Pointer (This),
          index,
          RetVal'Unchecked_Access));

      return RetVal;
   end removeItem;

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

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

      return RetVal;
   end appendItem;

end MSHTML.ISVGStringList_Interface;

