with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLStyleSheetRulesAppliedCollection_Interface is

   procedure Initialize (This : in out IHTMLStyleSheetRulesAppliedCollection_Type) is
   begin
      Set_IID (This, IID_IHTMLStyleSheetRulesAppliedCollection);
   end Initialize;

   function Pointer (This : IHTMLStyleSheetRulesAppliedCollection_Type)
     return Pointer_To_IHTMLStyleSheetRulesAppliedCollection
   is
   begin
      return To_Pointer_To_IHTMLStyleSheetRulesAppliedCollection (Address (This));
   end Pointer;

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

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

      return RetVal;
   end item;

   function Get_length
     (This : IHTMLStyleSheetRulesAppliedCollection_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 propertyAppliedBy
     (This   : IHTMLStyleSheetRulesAppliedCollection_Type;
      name   : GNATCOM.Types.BSTR;
      Free   : Boolean := True)
     return Pointer_To_IHTMLStyleSheetRule
   is
       RetVal : aliased Pointer_To_IHTMLStyleSheetRule;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.propertyAppliedBy
         (Pointer (This),
          name,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end propertyAppliedBy;

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

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

      return RetVal;
   end propertyAppliedTrace;

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

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

      return RetVal;
   end propertyAppliedTraceLength;

end MSHTML.IHTMLStyleSheetRulesAppliedCollection_Interface;

