with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLDOMTextNode3_Interface is

   procedure Initialize (This : in out IHTMLDOMTextNode3_Type) is
   begin
      Set_IID (This, IID_IHTMLDOMTextNode3);
   end Initialize;

   function Pointer (This : IHTMLDOMTextNode3_Type)
     return Pointer_To_IHTMLDOMTextNode3
   is
   begin
      return To_Pointer_To_IHTMLDOMTextNode3 (Address (This));
   end Pointer;

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

   function substringData
     (This           : IHTMLDOMTextNode3_Type;
      offset         : Interfaces.C.long;
      Count          : Interfaces.C.long)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.substringData
         (Pointer (This),
          offset,
          Count,
          RetVal'Unchecked_Access));

      return RetVal;
   end substringData;

   procedure insertData
     (This       : IHTMLDOMTextNode3_Type;
      offset     : Interfaces.C.long;
      bstrstring : GNATCOM.Types.BSTR;
      Free       : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.insertData
         (Pointer (This),
          offset,
          bstrstring));

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

   end insertData;

   procedure deleteData
     (This   : IHTMLDOMTextNode3_Type;
      offset : Interfaces.C.long;
      Count  : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.deleteData
         (Pointer (This),
          offset,
          Count));

   end deleteData;

   procedure replaceData
     (This       : IHTMLDOMTextNode3_Type;
      offset     : Interfaces.C.long;
      Count      : Interfaces.C.long;
      bstrstring : GNATCOM.Types.BSTR;
      Free       : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.replaceData
         (Pointer (This),
          offset,
          Count,
          bstrstring));

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

   end replaceData;

   function splitText
     (This     : IHTMLDOMTextNode3_Type;
      offset   : Interfaces.C.long)
     return Pointer_To_IHTMLDOMNode
   is
       RetVal : aliased Pointer_To_IHTMLDOMNode;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.splitText
         (Pointer (This),
          offset,
          RetVal'Unchecked_Access));

      return RetVal;
   end splitText;

   function Get_wholeText
     (This : IHTMLDOMTextNode3_Type)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_wholeText
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_wholeText;

   function replaceWholeText
     (This      : IHTMLDOMTextNode3_Type;
      bstrText  : GNATCOM.Types.BSTR;
      Free      : Boolean := True)
     return Pointer_To_IHTMLDOMNode
   is
       RetVal : aliased Pointer_To_IHTMLDOMNode;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.replaceWholeText
         (Pointer (This),
          bstrText,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end replaceWholeText;

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

      return RetVal;
   end hasAttributes;

   procedure normalize
     (This : IHTMLDOMTextNode3_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.normalize
         (Pointer (This)));

   end normalize;

end MSHTML.IHTMLDOMTextNode3_Interface;

