with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLTextContainer_Interface is

   procedure Initialize (This : in out IHTMLTextContainer_Type) is
   begin
      Set_IID (This, IID_IHTMLTextContainer);
   end Initialize;

   function Pointer (This : IHTMLTextContainer_Type)
     return Pointer_To_IHTMLTextContainer
   is
   begin
      return To_Pointer_To_IHTMLTextContainer (Address (This));
   end Pointer;

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

   function createControlRange
     (This   : IHTMLTextContainer_Type)
     return GNATCOM.Types.Pointer_To_IDispatch
   is
       RetVal : aliased GNATCOM.Types.Pointer_To_IDispatch;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.createControlRange
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end createControlRange;

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

      return RetVal;
   end Get_scrollHeight;

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

      return RetVal;
   end Get_scrollWidth;

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

   end Put_scrollTop;

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

      return RetVal;
   end Get_scrollTop;

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

   end Put_scrollLeft;

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

      return RetVal;
   end Get_scrollLeft;

   procedure Put_onscroll
     (This : IHTMLTextContainer_Type;
      p    : GNATCOM.Types.VARIANT;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_onscroll
         (Pointer (This),
          p));

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

   end Put_onscroll;

   function Get_onscroll
     (This : IHTMLTextContainer_Type)
     return GNATCOM.Types.VARIANT
   is
       RetVal : aliased GNATCOM.Types.VARIANT;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_onscroll
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_onscroll;

end MSHTML.IHTMLTextContainer_Interface;

