with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IWebBridge_Interface is

   procedure Initialize (This : in out IWebBridge_Type) is
   begin
      Set_IID (This, IID_IWebBridge);
   end Initialize;

   function Pointer (This : IWebBridge_Type)
     return Pointer_To_IWebBridge
   is
   begin
      return To_Pointer_To_IWebBridge (Address (This));
   end Pointer;

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

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

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

   end Put_url;

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

      return RetVal;
   end Get_url;

   procedure Put_Scrollbar
     (This : IWebBridge_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_Scrollbar
         (Pointer (This),
          p));

   end Put_Scrollbar;

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

      return RetVal;
   end Get_Scrollbar;

   procedure Put_embed
     (This : IWebBridge_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_embed
         (Pointer (This),
          p));

   end Put_embed;

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

      return RetVal;
   end Get_embed;

   function Get_event
     (This : IWebBridge_Type)
     return GNATCOM.Types.Pointer_To_IDispatch
   is
       RetVal : aliased GNATCOM.Types.Pointer_To_IDispatch;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_event
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_event;

   function Get_readyState
     (This : IWebBridge_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_readyState
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_readyState;

   procedure AboutBox
     (This : IWebBridge_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.AboutBox
         (Pointer (This)));

   end AboutBox;

end MSHTML.IWebBridge_Interface;

