
with GNATCOM.Errors;

package body MSHTMLHST.IDocHostUIHandler_Interface is

   procedure Initialize (This : in out IDocHostUIHandler_Type) is
   begin
      Set_IID (This, IID_IDocHostUIHandler);
   end Initialize;

   function Pointer (This : IDocHostUIHandler_Type)
		     return Pointer_To_IDocHostUIHandler
   is
   begin
      return To_Pointer_To_IDocHostUIHandler (Address (This));
   end Pointer;

   procedure Attach (This    : in out IDocHostUIHandler_Type;
		     Pointer : in     Pointer_To_IDocHostUIHandler)
   is
   begin
      Attach (This, GNATCOM.Iinterface.To_Pointer_To_IUnknown
	      (Pointer.all'Address));
   end Attach;

   function ShowContextMenu(
			    This           : IDocHostUIHandler_Type;
			    dwID           : DWORD;
			    ppt            : access Point_Type;
			    pcmdtReserved  : access IUnknown;
			    pdispReserved  : access IDispatch
			   ) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.ShowContextMenu(
					       Pointer (This),
					       dwID,
					       ppt,
					       pcmdtReserved,
					       pdispReserved
					      );
      return hr;
   end ShowContextMenu;

   function GetHostInfo(
			 This           : IDocHostUIHandler_Type;
			 pInfo          : access DOCHOSTUIINFO
		       ) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.GetHostInfo(
					   Pointer (This),
					   pInfo
					  );
      return hr;
   end GetHostInfo;

   function ShowUI(
		    This           : IDocHostUIHandler_Type;
		    dwID           : DWORD;
		    pActiveObject  : access IOleInPlaceActiveObject;
		    pCommandTarget : access IOleCommandTarget;
		    pFrame         : access IOleInPlaceFrame;
		    pDoc           : access IOleInPlaceUIWindow
		  ) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.ShowUI(
				      Pointer (This),
				      dwID,
				      pActiveObject,
				      pCommandTarget,
				      pFrame,
				      pDoc
				     );
      return hr;
   end ShowUI;

   function HideUI(
		   This           : IDocHostUIHandler_Type
		  ) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.HideUI(
				      Pointer (This)
				     );
      return hr;
   end HideUI;

   function UpdateUI(
		     This           : IDocHostUIHandler_Type
		    ) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.UpdateUI(
					Pointer (This)
				       );
      return hr;
   end UpdateUI;

   function EnableModeless(
			    This           : IDocHostUIHandler_Type;
			    fEnable        : System.Win32.BOOL
			  ) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.EnableModeless(
					      Pointer (This),
					      fEnable
					     );
      return hr;
   end EnableModeless;

   function OnDocWindowActivate(
				 This           : IDocHostUIHandler_Type;
				 fActivate      : System.Win32.BOOL
			       ) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.OnDocWindowActivate(
						   Pointer (This),
						   fActivate
						  );
      return hr;
   end OnDocWindowActivate;

   function OnFrameWindowActivate(
				   This           : IDocHostUIHandler_Type;
				   fActivate      : System.Win32.BOOL
				 ) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.OnFrameWindowActivate(
						     Pointer (This),
						     fActivate
						    );
      return hr;
   end OnFrameWindowActivate;

   function ResizeBorder(
			  This           : IDocHostUIHandler_Type;
			  prcBorder      : access GNATOCX.RECT;
			  pUIWindow      : access IOleInPlaceUIWindow;
			  fRameWindow    : System.Win32.BOOL
			) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.ResizeBorder(
					    Pointer (This),
					    prcBorder,
					    pUIWindow,
					    fRameWindow
					   );
      return hr;
   end ResizeBorder;

   function TranslateAccelerator(
				 This           : IDocHostUIHandler_Type;
				 lpMsg          : access GNATOCX.MSG;
				 pguidCmdGroup  : access GNATCOM.Types.GUID;
				 nCmdID         : DWORD
				) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.TranslateAccelerator(
					    Pointer (This),
					    lpMsg,
					    pguidCmdGroup,
					    nCmdID
					   );
      return hr;
   end TranslateAccelerator;

   function GetOptionKeyPath(
			      This           : IDocHostUIHandler_Type;
			      pchKey         : access LPWSTR
			    ) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.GetOptionKeyPath(
					    Pointer (This),
					    pchKey
					   );
      return hr;
   end GetOptionKeyPath;

   function GetDropTarget(
			   This           : IDocHostUIHandler_Type;
			   pDropTarget    : access IDropTarget;
			   ppDropTarget   : access Pointer_To_IDropTarget
			 ) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.GetDropTarget(
					     Pointer (This),
					     pDropTarget,
					     ppDropTarget
					    );
      return hr;
   end GetDropTarget;

   function GetExternal(
			 This           : IDocHostUIHandler_Type;
			 ppDispatch     : access Pointer_To_IDispatch
		       ) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.GetExternal(
					   Pointer (This),
					   ppDispatch
					  );
      return hr;
   end GetExternal;

   function TranslateUrl(
			  This           : IDocHostUIHandler_Type;
			  dwTranslate    : DWORD;
			  pchURLIn       : LPWSTR;
			  ppchURLOut     : access LPWSTR
			) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.TranslateUrl(
					    Pointer (This),
					    dwTranslate,
					    pchURLIn,
					    ppchURLOut
					   );
      return hr;
   end TranslateUrl;

   function FilterDataObject(
			      This           : IDocHostUIHandler_Type;
			      pDO            : access IDataObject;
			      ppDORet        : access Pointer_TO_IDataObject
			    ) return HRESULT
   is
      hr : HRESULT;
   begin
      hr := Pointer(This).Vtbl.FilterDataObject(
						Pointer (This),
						pDO,
						ppDORet
					       );
      return hr;
   end FilterDataObject;

end MSHTMLHST.IDocHostUIHandler_Interface;
