// API.h : Declaration of the CAPI

#pragma once
#include "resource.h"       // main symbols


// IAPI
[
	object,
	uuid("31248F2F-268B-46F0-8808-5CCFEA979361"),
	dual,	helpstring("IAPI Interface"),
	pointer_default(unique)
]
__interface IAPI : IDispatch
{
  [id(1), helpstring("method Startup")] HRESULT Startup([in] BSTR BaseURL, [out,retval] LONG* pRetVal);
  [id(2), helpstring("method Shutdown")] HRESULT Shutdown([out,retval] LONG* pRetVal);
  [id(3), helpstring("method DisplayHelp")] HRESULT DisplayHelp([in] BSTR Context, [in] BSTR Topic, [out,retval] LONG* pRetVal);
  [id(4), helpstring("method DisplayHelpWithNavigation")] HRESULT DisplayHelpWithNavigation([in] BSTR Context, [in] BSTR Topic, [out,retval] LONG* pRetVal);
  [id(5), helpstring("method DisplayHelpWithContents")] HRESULT DisplayHelpWithContents([in] BSTR Context, [in] BSTR Topic, [out,retval] LONG* pRetVal);
  [id(6), helpstring("method DisplayHelpWithIndex")] HRESULT DisplayHelpWithIndex([in] BSTR Context, [in] BSTR Topic, [out,retval] LONG* pRetVal);
  [id(7), helpstring("method DisplayHelpWithSearch")] HRESULT DisplayHelpWithSearch([in] BSTR Context, [in] BSTR Topic, [out,retval] LONG* pRetVal);
  [id(8), helpstring("method DisplayHelpWithFavorites")] HRESULT DisplayHelpWithFavorites([in] BSTR Context, [in] BSTR Topic, [out,retval] LONG* pRetVal);
  [id(9), helpstring("method DisplayHelpNavigation")] HRESULT DisplayHelpNavigation([out,retval] LONG* pRetVal);
  [id(10), helpstring("method DisplayHelpContents")] HRESULT DisplayHelpContents([out,retval] LONG* pRetVal);
  [id(11), helpstring("method DisplayHelpIndex")] HRESULT DisplayHelpIndex([out,retval] LONG* pRetVal);
  [id(12), helpstring("method DisplayHelpSearch")] HRESULT DisplayHelpSearch([out,retval] LONG* pRetVal);
  [id(13), helpstring("method DisplayHelpFavorites")] HRESULT DisplayHelpFavorites([out,retval] LONG* pRetVal);
};



// CAPI

[
	coclass,
	threading("apartment"),
	vi_progid("WWHelp4v2.API"),
	progid("WWHelp4v2.API.1"),
	version(1.0),
	uuid("5F282A03-A5C4-4E98-A2FE-7D0DFCE98A2E"),
	helpstring("API Class")
]
class ATL_NO_VTABLE CAPI : 
	public IAPI,
	public IObjectSafetyImpl<CAPI, INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA>
{
public:
	CAPI()
	{
	}


	DECLARE_PROTECT_FINAL_CONSTRUCT()

	HRESULT FinalConstruct()
	{
		return S_OK;
	}
	
	void FinalRelease() 
	{
	}

public:

  STDMETHOD(Startup)(BSTR BaseURL, LONG* pRetVal);
  STDMETHOD(Shutdown)(LONG* pRetVal);
  STDMETHOD(DisplayHelp)(BSTR Context, BSTR Topic, LONG* pRetVal);
  STDMETHOD(DisplayHelpWithNavigation)(BSTR Context, BSTR Topic, LONG* pRetVal);
  STDMETHOD(DisplayHelpWithContents)(BSTR Context, BSTR Topic, LONG* pRetVal);
  STDMETHOD(DisplayHelpWithIndex)(BSTR Context, BSTR Topic, LONG* pRetVal);
  STDMETHOD(DisplayHelpWithSearch)(BSTR Context, BSTR Topic, LONG* pRetVal);
  STDMETHOD(DisplayHelpWithFavorites)(BSTR Context, BSTR Topic, LONG* pRetVal);
  STDMETHOD(DisplayHelpNavigation)(LONG* pRetVal);
  STDMETHOD(DisplayHelpContents)(LONG* pRetVal);
  STDMETHOD(DisplayHelpIndex)(LONG* pRetVal);
  STDMETHOD(DisplayHelpSearch)(LONG* pRetVal);
  STDMETHOD(DisplayHelpFavorites)(LONG* pRetVal);
};

