with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IRulesApplied_Interface is

   procedure Initialize (This : in out IRulesApplied_Type) is
   begin
      Set_IID (This, IID_IRulesApplied);
   end Initialize;

   function Pointer (This : IRulesApplied_Type)
     return Pointer_To_IRulesApplied
   is
   begin
      return To_Pointer_To_IRulesApplied (Address (This));
   end Pointer;

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

   function Get_element
     (This : IRulesApplied_Type)
     return Pointer_To_IHTMLElement
   is
       RetVal : aliased Pointer_To_IHTMLElement;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_element
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_element;

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

      return RetVal;
   end Get_inlineStyles;

   function Get_appliedRules
     (This : IRulesApplied_Type)
     return Pointer_To_IHTMLStyleSheetRulesAppliedCollection
   is
       RetVal : aliased Pointer_To_IHTMLStyleSheetRulesAppliedCollection;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_appliedRules
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_appliedRules;

   function propertyIsInline
     (This : IRulesApplied_Type;
      name : 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.propertyIsInline
         (Pointer (This),
          name,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end propertyIsInline;

   function propertyIsInheritable
     (This : IRulesApplied_Type;
      name : 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.propertyIsInheritable
         (Pointer (This),
          name,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end propertyIsInheritable;

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

      return RetVal;
   end hasInheritableProperty;

end MSHTML.IRulesApplied_Interface;

