with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLDataTransfer_Interface is

   procedure Initialize (This : in out IHTMLDataTransfer_Type) is
   begin
      Set_IID (This, IID_IHTMLDataTransfer);
   end Initialize;

   function Pointer (This : IHTMLDataTransfer_Type)
     return Pointer_To_IHTMLDataTransfer
   is
   begin
      return To_Pointer_To_IHTMLDataTransfer (Address (This));
   end Pointer;

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

   function setData
     (This   : IHTMLDataTransfer_Type;
      format : GNATCOM.Types.BSTR;
      data   : access GNATCOM.Types.VARIANT :=
        GNATCOM.Types.PVARIANT_MISSING;
      Free   : Boolean := True)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.setData
         (Pointer (This),
          format,
          data,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end setData;

   function getData
     (This    : IHTMLDataTransfer_Type;
      format  : GNATCOM.Types.BSTR;
      Free    : Boolean := True)
     return GNATCOM.Types.VARIANT
   is
       RetVal : aliased GNATCOM.Types.VARIANT;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.getData
         (Pointer (This),
          format,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end getData;

   function clearData
     (This   : IHTMLDataTransfer_Type;
      format : 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.clearData
         (Pointer (This),
          format,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end clearData;

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

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

   end Put_dropEffect;

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

      return RetVal;
   end Get_dropEffect;

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

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

   end Put_effectAllowed;

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

      return RetVal;
   end Get_effectAllowed;

end MSHTML.IHTMLDataTransfer_Interface;

