with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLPopup_Interface is

   procedure Initialize (This : in out IHTMLPopup_Type) is
   begin
      Set_IID (This, IID_IHTMLPopup);
   end Initialize;

   function Pointer (This : IHTMLPopup_Type)
     return Pointer_To_IHTMLPopup
   is
   begin
      return To_Pointer_To_IHTMLPopup (Address (This));
   end Pointer;

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

   procedure Show
     (This     : IHTMLPopup_Type;
      x        : Interfaces.C.long;
      y        : Interfaces.C.long;
      w        : Interfaces.C.long;
      h        : Interfaces.C.long;
      pElement : access GNATCOM.Types.VARIANT :=
        GNATCOM.Types.PVARIANT_MISSING)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Show
         (Pointer (This),
          x,
          y,
          w,
          h,
          pElement));

   end Show;

   procedure Hide
     (This : IHTMLPopup_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Hide
         (Pointer (This)));

   end Hide;

   function Get_document
     (This : IHTMLPopup_Type)
     return Pointer_To_IHTMLDocument
   is
       RetVal : aliased Pointer_To_IHTMLDocument;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_document
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_document;

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

      return RetVal;
   end Get_isOpen;

end MSHTML.IHTMLPopup_Interface;

