with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLDialog_Interface is

   procedure Initialize (This : in out IHTMLDialog_Type) is
   begin
      Set_IID (This, IID_IHTMLDialog);
   end Initialize;

   function Pointer (This : IHTMLDialog_Type)
     return Pointer_To_IHTMLDialog
   is
   begin
      return To_Pointer_To_IHTMLDialog (Address (This));
   end Pointer;

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

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

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

   end Put_dialogTop;

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

      return RetVal;
   end Get_dialogTop;

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

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

   end Put_dialogLeft;

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

      return RetVal;
   end Get_dialogLeft;

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

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

   end Put_dialogWidth;

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

      return RetVal;
   end Get_dialogWidth;

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

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

   end Put_dialogHeight;

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

      return RetVal;
   end Get_dialogHeight;

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

      return RetVal;
   end Get_dialogArguments;

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

      return RetVal;
   end Get_menuArguments;

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

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

   end Put_returnValue;

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

      return RetVal;
   end Get_returnValue;

   procedure close
     (This : IHTMLDialog_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.close
         (Pointer (This)));

   end close;

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

      return RetVal;
   end toString;

end MSHTML.IHTMLDialog_Interface;

