// This is a part of the Active Template Library.
// Copyright (C) Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Active Template Library Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Active Template Library product.

// atliface.idl : IDL source for atl.dll
//

cpp_quote("EXTERN_C const CLSID CLSID_Registrar;")

// This file will be processed by the MIDL tool to
// produce the type library (atl.tlb) and marshalling code.
import "oaidl.idl";
import "ocidl.idl";
#include <olectl.h>

[
	object,
	uuid(e21f8a85-b05d-4243-8183-c7cb405588f7),
	helpstring("IRegistrarBase Interface"),
	pointer_default(unique)
]
interface IRegistrarBase : IUnknown
{
	HRESULT AddReplacement([in] LPCOLESTR key, [in] LPCOLESTR item);
	HRESULT ClearReplacements();
};


[
	object,
	uuid(44EC053B-400F-11D0-9DCD-00A0C90391D3),
	helpstring("IRegistrar Interface"),
	pointer_default(unique)
]
interface IRegistrar : IRegistrarBase
{

//////////////////////////////////////////////////////////
// Script based methods
//////////////////////////////////////////////////////////
	HRESULT ResourceRegisterSz([in] LPCOLESTR resFileName, [in] LPCOLESTR szID, [in] LPCOLESTR szType);
	HRESULT ResourceUnregisterSz([in] LPCOLESTR resFileName, [in] LPCOLESTR szID, [in] LPCOLESTR szType);
	HRESULT FileRegister([in] LPCOLESTR fileName);
	HRESULT FileUnregister([in] LPCOLESTR fileName);
	HRESULT StringRegister([in] LPCOLESTR data);
	HRESULT StringUnregister([in] LPCOLESTR data);
	HRESULT ResourceRegister([in] LPCOLESTR resFileName, [in] UINT nID, [in] LPCOLESTR szType);
	HRESULT ResourceUnregister([in] LPCOLESTR resFileName, [in] UINT nID, [in] LPCOLESTR szType);
};


//////////////////////////////////////////////////////////
// Control hosting interfaces
//////////////////////////////////////////////////////////

[
	local,
	uuid(425B5AF0-65F1-11d1-9611-0000F81E0D0D),
	helpstring("IDocHostUIHandlerDispatch Interface"),
	pointer_default(unique)
]
interface IDocHostUIHandlerDispatch : IDispatch
{
	typedef enum tagDOCHOSTUIDBLCLKDispatch {
			docHostUIDblClkDEFAULT         = 0,
			docHostUIDblClkSHOWPROPERTIES  = 1,
			docHostUIDblClkSHOWCODE        = 2,
	} DOCHOSTUIDBLCLKDispatch ;

	typedef enum tagDocHostUIFlagDispatch {
			docHostUIFlagDIALOG            = 1,
			docHostUIFlagDISABLE_HELP_MENU = 2,
			docHostUIFlagNO3DBORDER        = 4,
			docHostUIFlagSCROLL_NO         = 8,
			docHostUIFlagDISABLE_SCRIPT_INACTIVE = 16,
			docHostUIFlagOPENNEWWIN        = 32,
			docHostUIFlagDISABLE_OFFSCREEN = 64,
			docHostUIFlagFLAT_SCROLLBAR = 128,
			docHostUIFlagDIV_BLOCKDEFAULT = 256,
			docHostUIFlagACTIVATE_CLIENTHIT_ONLY = 512,
	} DocHostUIFlagDispatch ;

    HRESULT ShowContextMenu(
            [in] DWORD dwID, 
            [in] DWORD x, 
            [in] DWORD y, 
            [in] IUnknown* pcmdtReserved,  
            [in] IDispatch* pdispReserved,
			[out, retval] HRESULT* dwRetVal);
    HRESULT GetHostInfo(
			[in, out] DWORD* pdwFlags,
			[in, out] DWORD* pdwDoubleClick);
    HRESULT ShowUI(
            [in] DWORD dwID,
            [in] IUnknown* pActiveObject,
            [in] IUnknown* pCommandTarget,
            [in] IUnknown* pFrame,
            [in] IUnknown* pDoc,
			[out, retval] HRESULT* dwRetVal);
    HRESULT HideUI();
    HRESULT UpdateUI();
    HRESULT EnableModeless(
			[in] VARIANT_BOOL fEnable);
    HRESULT OnDocWindowActivate(
			[in] VARIANT_BOOL fActivate);
    HRESULT OnFrameWindowActivate(
			[in] VARIANT_BOOL fActivate);
    HRESULT ResizeBorder(
			[in] long left,
            [in] long top,
			[in] long right,
			[in] long bottom,
            [in] IUnknown * pUIWindow,
            [in] VARIANT_BOOL fFrameWindow);
    HRESULT TranslateAccelerator(
			[in] DWORD_PTR hWnd,
			[in] DWORD nMessage,
			[in] DWORD_PTR wParam,
			[in] DWORD_PTR lParam,
            [in] BSTR bstrGuidCmdGroup, 
            [in] DWORD nCmdID,
			[out, retval] HRESULT* dwRetVal);
    HRESULT GetOptionKeyPath(
			[out] BSTR* pbstrKey,
			[in] DWORD dw);
    HRESULT GetDropTarget(
            [in] IUnknown* pDropTarget, 
            [out] IUnknown** ppDropTarget);
    HRESULT GetExternal(
			[out] IDispatch **ppDispatch);
    HRESULT TranslateUrl(
			[in] DWORD dwTranslate,
			[in] BSTR bstrURLIn,
			[out] BSTR* pbstrURLOut);
    HRESULT FilterDataObject(
			[in] IUnknown *pDO,
			[out] IUnknown **ppDORet);
};

[
	uuid(B6EA2050-048A-11d1-82B9-00C04FB9942E),
	helpstring("IAxWinHostWindow Interface"),
	pointer_default(unique)
]
interface IAxWinHostWindow : IUnknown
{
	HRESULT CreateControl([in] LPCOLESTR lpTricsData, [in] HWND hWnd, [in] IStream* pStream);
	HRESULT CreateControlEx([in] LPCOLESTR lpTricsData, [in] HWND hWnd, [in] IStream* pStream, [out]IUnknown** ppUnk, [in] REFIID riidAdvise, [in]IUnknown* punkAdvise);
	HRESULT AttachControl([in] IUnknown* pUnkControl, [in] HWND hWnd);
	HRESULT QueryControl([in] REFIID riid, [out, iid_is(riid)] void **ppvObject);
	HRESULT SetExternalDispatch([in] IDispatch* pDisp);
	HRESULT SetExternalUIHandler([in] IDocHostUIHandlerDispatch* pDisp);
};

[
	uuid(3935BDA8-4ED9-495c-8650-E01FC1E38A4B),
	helpstring("IAxWinHostWindowLic Interface"),
	pointer_default(unique)
]
interface IAxWinHostWindowLic : IAxWinHostWindow
{
	HRESULT CreateControlLic([in] LPCOLESTR lpTricsData, [in] HWND hWnd, [in] IStream* pStream, [in] BSTR bstrLic);
	HRESULT CreateControlLicEx([in] LPCOLESTR lpTricsData, [in] HWND hWnd, [in] IStream* pStream, [out]IUnknown** ppUnk, [in] REFIID riidAdvise, [in]IUnknown* punkAdvise, [in] BSTR bstrLic);
};


[
	object, dual,
	uuid(B6EA2051-048A-11d1-82B9-00C04FB9942E),
	helpstring("IAxWinAmbientDispatch Interface"),
	pointer_default(unique)
]
interface IAxWinAmbientDispatch : IDispatch
{
	[propput, helpstring("Enable or disable windowless activation")]
	HRESULT AllowWindowlessActivation([in]VARIANT_BOOL bCanWindowlessActivate);
	[propget, helpstring("Is windowless activation enabled")]
	HRESULT AllowWindowlessActivation([out,retval]VARIANT_BOOL* pbCanWindowlessActivate);

	// DISPID_AMBIENT_BACKCOLOR
	[propput, helpstring("Set the background color"), id(DISPID_AMBIENT_BACKCOLOR)]
	HRESULT BackColor([in]OLE_COLOR clrBackground);
	[propget, helpstring("Get the background color"), id(DISPID_AMBIENT_BACKCOLOR)]
	HRESULT BackColor([out,retval]OLE_COLOR* pclrBackground);

	// DISPID_AMBIENT_FORECOLOR
	[propput, helpstring("Set the ambient foreground color"), id(DISPID_AMBIENT_FORECOLOR)]
	HRESULT ForeColor([in]OLE_COLOR clrForeground);
	[propget, helpstring("Get the ambient foreground color"), id(DISPID_AMBIENT_FORECOLOR)]
	HRESULT ForeColor([out,retval]OLE_COLOR* pclrForeground);

	// DISPID_AMBIENT_LOCALEID
	[propput, helpstring("Set the ambient locale"), id(DISPID_AMBIENT_LOCALEID)]
	HRESULT LocaleID([in]LCID lcidLocaleID);
	[propget, helpstring("Get the ambient locale"), id(DISPID_AMBIENT_LOCALEID)]
	HRESULT LocaleID([out,retval]LCID* plcidLocaleID);

	// DISPID_AMBIENT_USERMODE
	[propput, helpstring("Set the ambient user mode"), id(DISPID_AMBIENT_USERMODE)]
	HRESULT UserMode([in]VARIANT_BOOL bUserMode);
	[propget, helpstring("Get the ambient user mode"), id(DISPID_AMBIENT_USERMODE)]
	HRESULT UserMode([out,retval]VARIANT_BOOL* pbUserMode);

	// DISPID_AMBIENT_DISPLAYASDEFAULT
	[propput, helpstring("Enable or disable the control as default"), id(DISPID_AMBIENT_DISPLAYASDEFAULT)]
	HRESULT DisplayAsDefault([in]VARIANT_BOOL bDisplayAsDefault);
	[propget, helpstring("Is the control the default"), id(DISPID_AMBIENT_DISPLAYASDEFAULT)]
	HRESULT DisplayAsDefault([out,retval]VARIANT_BOOL* pbDisplayAsDefault);

//midl_pragma warning(disable:2039)
	// DISPID_AMBIENT_FONT
	[propput, helpstring("Set the ambient font"), id(DISPID_AMBIENT_FONT)]
	HRESULT Font([in]IFontDisp* pFont);
	[propget, helpstring("Get the ambient font"), id(DISPID_AMBIENT_FONT)]
	HRESULT Font([out,retval]IFontDisp** pFont);
//midl_pragma warning(enable:2039)

	// DISPID_AMBIENT_SUPPORTSMNEMONICS
	// DISPID_AMBIENT_AUTOCLIP
	// DISPID_AMBIENT_APPEARANCE
	// DISPID_AMBIENT_PALETTE
	// DISPID_AMBIENT_TRANSFERPRIORITY
	// DISPID_AMBIENT_DISPLAYNAME
	// DISPID_AMBIENT_UIDEAD

	// DISPID_AMBIENT_MESSAGEREFLECT
	[propput, helpstring("Enable or disable message reflection"), id(DISPID_AMBIENT_MESSAGEREFLECT)]
	HRESULT MessageReflect([in]VARIANT_BOOL bMsgReflect);
	[propget, helpstring("Is message reflection enabled"), id(DISPID_AMBIENT_MESSAGEREFLECT)]
	HRESULT MessageReflect([out,retval]VARIANT_BOOL* pbMsgReflect);

	// DISPID_AMBIENT_SHOWGRABHANDLES
	[propget, helpstring("Show or hide grab handles"), id(DISPID_AMBIENT_SHOWGRABHANDLES)]
	HRESULT ShowGrabHandles([out,retval]VARIANT_BOOL* pbShowGrabHandles);
	// DISPID_AMBIENT_SHOWHATCHING
	[propget, helpstring("Are grab handles enabled"), id(DISPID_AMBIENT_SHOWHATCHING)]
	HRESULT ShowHatching([out,retval]VARIANT_BOOL* pbShowHatching);

	// DISPID_AMBIENT_SCALEUNITS
	// DISPID_AMBIENT_TEXTALIGN

	// IDocHostUIHandler Defaults
	[propput, helpstring("Set the DOCHOSTUIFLAG flags")]
	HRESULT DocHostFlags([in]DWORD dwDocHostFlags);
	[propget, helpstring("Get the DOCHOSTUIFLAG flags")]
	HRESULT DocHostFlags([out,retval]DWORD* pdwDocHostFlags);
	[propput, helpstring("Set the DOCHOSTUIDBLCLK flags")]
	HRESULT DocHostDoubleClickFlags([in]DWORD dwDocHostDoubleClickFlags);
	[propget, helpstring("Get the DOCHOSTUIDBLCLK flags")]
	HRESULT DocHostDoubleClickFlags([out,retval]DWORD* pdwDocHostDoubleClickFlags);
	[propput, helpstring("Enable or disable context menus")]
	HRESULT AllowContextMenu([in]VARIANT_BOOL bAllowContextMenu);
	[propget, helpstring("Are context menus enabled")]
	HRESULT AllowContextMenu([out,retval]VARIANT_BOOL* pbAllowContextMenu);
	[propput, helpstring("Enable or disable UI")]
	HRESULT AllowShowUI([in]VARIANT_BOOL bAllowShowUI);
	[propget, helpstring("Is UI enabled")]
	HRESULT AllowShowUI([out,retval]VARIANT_BOOL* pbAllowShowUI);
	[propput, helpstring("Set the option key path")]
	HRESULT OptionKeyPath([in]BSTR bstrOptionKeyPath);
	[propget, helpstring("Get the option key path")]
	HRESULT OptionKeyPath([out,retval]BSTR* pbstrOptionKeyPath);
};

[
	object, dual,
	uuid(B2D0778B-AC99-4c58-A5C8-E7724E5316B5),
	helpstring("IAxWinAmbientDispatch Interface"),
	pointer_default(unique)
]
interface IAxWinAmbientDispatchEx : IAxWinAmbientDispatch
{
	[ id(100) ] HRESULT SetAmbientDispatch([in] IDispatch* pDispatch);
};
	

[
	uuid(72AD0770-6A9F-11d1-BCEC-0060088F444E),
	helpstring("IInternalConnection Interface"),
	pointer_default(unique)
]
interface IInternalConnection : IUnknown
{
	HRESULT AddConnection();
	HRESULT ReleaseConnection();
};

cpp_quote("namespace ATL")
cpp_quote("{")
cpp_quote("#ifdef __cplusplus")
cpp_quote("#include <atldef.h>")
cpp_quote("#else")
cpp_quote("#define ATLAPI EXTERN_C HRESULT __declspec(dllimport) __stdcall")
cpp_quote("#define ATLAPI_(x) EXTERN_C __declspec(dllimport) x __stdcall")
cpp_quote("#define ATLINLINE")
cpp_quote("#endif	// __cplusplus")
cpp_quote("")
cpp_quote("ATLAPI_(INT_PTR) AtlAxDialogBoxW(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogProc, LPARAM dwInitParam);")
cpp_quote("ATLAPI_(INT_PTR) AtlAxDialogBoxA(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogProc, LPARAM dwInitParam);")
cpp_quote("#ifdef UNICODE")
cpp_quote("#define AtlAxDialogBox AtlAxDialogBoxW")
cpp_quote("#else")
cpp_quote("#define AtlAxDialogBox AtlAxDialogBoxA")
cpp_quote("#endif")
cpp_quote("")
cpp_quote("ATLAPI_(HWND) AtlAxCreateDialogW(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogProc, LPARAM dwInitParam);")
cpp_quote("ATLAPI_(HWND) AtlAxCreateDialogA(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogProc, LPARAM dwInitParam);")
cpp_quote("#ifdef UNICODE")
cpp_quote("#define AtlAxCreateDialog AtlAxCreateDialogW")
cpp_quote("#else")
cpp_quote("#define AtlAxCreateDialog AtlAxCreateDialogA")
cpp_quote("#endif")
cpp_quote("")
cpp_quote("ATLAPI AtlAxCreateControl(LPCOLESTR lpszName, HWND hWnd, IStream* pStream, IUnknown** ppUnkContainer);")
cpp_quote("#ifdef __cplusplus")
cpp_quote("ATLAPI AtlAxCreateControlEx(LPCOLESTR lpszName, HWND hWnd, IStream* pStream, ")
cpp_quote("		IUnknown** ppUnkContainer, IUnknown** ppUnkControl, ")
cpp_quote("		REFIID iidSink=IID_NULL, IUnknown* punkSink=NULL);")
cpp_quote("ATLAPI AtlAxCreateControlLic(LPCOLESTR lpszName, HWND hWnd, IStream* pStream, IUnknown** ppUnkContainer, BSTR bstrLic = NULL);")
cpp_quote("ATLAPI AtlAxCreateControlLicEx(LPCOLESTR lpszName, HWND hWnd, IStream* pStream, ")
cpp_quote("		IUnknown** ppUnkContainer, IUnknown** ppUnkControl, ")
cpp_quote("		REFIID iidSink=IID_NULL, IUnknown* punkSink=NULL, BSTR bstrLic = NULL);")
cpp_quote("#else")
cpp_quote("ATLAPI AtlAxCreateControlEx(LPCOLESTR lpszName, HWND hWnd, IStream* pStream, ")
cpp_quote("		IUnknown** ppUnkContainer, IUnknown** ppUnkControl, ")
cpp_quote("		REFIID iidSink, IUnknown* punkSink);")
cpp_quote("ATLAPI AtlAxCreateControlLic(LPCOLESTR lpszName, HWND hWnd, IStream* pStream, IUnknown** ppUnkContainer, BSTR bstrLic);")
cpp_quote("ATLAPI AtlAxCreateControlLicEx(LPCOLESTR lpszName, HWND hWnd, IStream* pStream, ")
cpp_quote("		IUnknown** ppUnkContainer, IUnknown** ppUnkControl, ")
cpp_quote("		REFIID iidSink, IUnknown* punkSink, BSTR bstrLic);")
cpp_quote("#endif	// __cplusplus")
cpp_quote("ATLAPI AtlAxAttachControl(IUnknown* pControl, HWND hWnd, IUnknown** ppUnkContainer);")
cpp_quote("ATLAPI_(BOOL) AtlAxWinInit();")
cpp_quote("")
cpp_quote("ATLAPI AtlAxGetHost(HWND h, IUnknown** pp);")
cpp_quote("ATLAPI AtlAxGetControl(HWND h, IUnknown** pp);")
cpp_quote("")
cpp_quote("}; //namespace ATL")


import "oleacc.idl";
interface IAccessibleServer;
[
	object,
	uuid(7A7D9DCF-B7A1-4019-9031-258268846980),
	dual,
	helpstring("IAccessibleProxy Interface"),
	pointer_default(unique)
]
interface IAccessibleProxy : IUnknown
{
	HRESULT SetServer([in]IAccessible* pAccessible, [in]IAccessibleServer* pServer);
};
[
	object,
	uuid(52C8FB5E-D779-4e77-AE9F-F611FA7E9D7A),
	helpstring("IAccessibleServer Interface"),
	pointer_default(unique)
]
interface IAccessibleServer : IUnknown
{
	HRESULT SetProxy([in]IAccessibleProxy* pUnknown);
	HRESULT GetHWND([out]HWND* phWnd);
	HRESULT GetEnumVariant([out]IEnumVARIANT** ppEnumVariant);
};
