with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLDatabinding_Interface is

   procedure Initialize (This : in out IHTMLDatabinding_Type) is
   begin
      Set_IID (This, IID_IHTMLDatabinding);
   end Initialize;

   function Pointer (This : IHTMLDatabinding_Type)
     return Pointer_To_IHTMLDatabinding
   is
   begin
      return To_Pointer_To_IHTMLDatabinding (Address (This));
   end Pointer;

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

   procedure Put_dataFld
     (This : IHTMLDatabinding_Type;
      p    : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_dataFld
         (Pointer (This),
          p));

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

   end Put_dataFld;

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

      return RetVal;
   end Get_dataFld;

   procedure Put_dataSrc
     (This : IHTMLDatabinding_Type;
      p    : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_dataSrc
         (Pointer (This),
          p));

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

   end Put_dataSrc;

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

      return RetVal;
   end Get_dataSrc;

   procedure Put_dataFormatAs
     (This : IHTMLDatabinding_Type;
      p    : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_dataFormatAs
         (Pointer (This),
          p));

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

   end Put_dataFormatAs;

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

      return RetVal;
   end Get_dataFormatAs;

end MSHTML.IHTMLDatabinding_Interface;

