with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLTextRangeMetrics2_Interface is

   procedure Initialize (This : in out IHTMLTextRangeMetrics2_Type) is
   begin
      Set_IID (This, IID_IHTMLTextRangeMetrics2);
   end Initialize;

   function Pointer (This : IHTMLTextRangeMetrics2_Type)
     return Pointer_To_IHTMLTextRangeMetrics2
   is
   begin
      return To_Pointer_To_IHTMLTextRangeMetrics2 (Address (This));
   end Pointer;

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

   function getClientRects
     (This     : IHTMLTextRangeMetrics2_Type)
     return Pointer_To_IHTMLRectCollection
   is
       RetVal : aliased Pointer_To_IHTMLRectCollection;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.getClientRects
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end getClientRects;

   function getBoundingClientRect
     (This  : IHTMLTextRangeMetrics2_Type)
     return Pointer_To_IHTMLRect
   is
       RetVal : aliased Pointer_To_IHTMLRect;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.getBoundingClientRect
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end getBoundingClientRect;

end MSHTML.IHTMLTextRangeMetrics2_Interface;

