with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IWebGeolocation_Interface is

   procedure Initialize (This : in out IWebGeolocation_Type) is
   begin
      Set_IID (This, IID_IWebGeolocation);
   end Initialize;

   function Pointer (This : IWebGeolocation_Type)
     return Pointer_To_IWebGeolocation
   is
   begin
      return To_Pointer_To_IWebGeolocation (Address (This));
   end Pointer;

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

   procedure getCurrentPosition
     (This            : IWebGeolocation_Type;
      successCallback : GNATCOM.Types.Pointer_To_IDispatch;
      errorCallback   : GNATCOM.Types.Pointer_To_IDispatch;
      options         : GNATCOM.Types.Pointer_To_IDispatch)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.getCurrentPosition
         (Pointer (This),
          successCallback,
          errorCallback,
          options));

   end getCurrentPosition;

   function watchPosition
     (This            : IWebGeolocation_Type;
      successCallback : GNATCOM.Types.Pointer_To_IDispatch;
      errorCallback   : GNATCOM.Types.Pointer_To_IDispatch;
      options         : GNATCOM.Types.Pointer_To_IDispatch)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.watchPosition
         (Pointer (This),
          successCallback,
          errorCallback,
          options,
          RetVal'Unchecked_Access));

      return RetVal;
   end watchPosition;

   procedure clearWatch
     (This    : IWebGeolocation_Type;
      watchId : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.clearWatch
         (Pointer (This),
          watchId));

   end clearWatch;

end MSHTML.IWebGeolocation_Interface;

