/******************************************************************************

Copyright (c) 1999 Microsoft Corporation

Module Name:
    SlaveProcess.idl

Abstract:
    This file contains the declaration of the set of coclasses and interfaces
    implemented by the Help Center Service, for spawning objects under a
    different user account.

Revision History:
    Davide Massarenti   (Dmassare)  03/28/2000
        created

******************************************************************************/

//
// We should import "activscp.idl", but this way we would import the interfaces in the TLB, things like IXMLDOM* will be included...
//
// Including the couple #if/#endif, we make the MIDL happy, but don't put the declaration in the header file.
// This prevents a redeclaration error when including "activscp.h" from C++.
//
////////////////////////////////////////////////////////////////////////////////

cpp_quote( "#include <activscp.h>" )
cpp_quote( "#if 0" )

typedef
enum tagSCRIPTSTATE
    {   SCRIPTSTATE_UNINITIALIZED   = 0,
    SCRIPTSTATE_INITIALIZED = 5,
    SCRIPTSTATE_STARTED = 1,
    SCRIPTSTATE_CONNECTED   = 2,
    SCRIPTSTATE_DISCONNECTED    = 3,
    SCRIPTSTATE_CLOSED  = 4
    }   SCRIPTSTATE;


/* script thread state values */

typedef
enum tagSCRIPTTHREADSTATE
    {   SCRIPTTHREADSTATE_NOTINSCRIPT   = 0,
    SCRIPTTHREADSTATE_RUNNING   = 1
    }   SCRIPTTHREADSTATE;


/* Thread IDs */

typedef DWORD SCRIPTTHREADID;

cpp_quote( "#endif" )

////////////////////////////////////////////////////////////////////////////////

[
    object,
    uuid(833E4280-AFF7-4AC3-AAC2-9F24C1457BCE),
    dual,
    oleautomation,
    helpstring("IPCHSlaveProcess Interface"),
    pointer_default(unique)
]
interface IPCHSlaveProcess : IDispatch
{
    HRESULT Initialize( [in] BSTR bstrVendorID, [in] BSTR bstrPublicKey );

    HRESULT CreateInstance( [in] REFCLSID rclsid, [in] IUnknown* pUnkOuter, [out] IUnknown* *ppvObject );

    HRESULT CreateScriptWrapper( [in] REFCLSID rclsid, [in] BSTR bstrCode, [in] BSTR bstrURL, [out] IUnknown* *ppvObject );

    HRESULT OpenBlockingStream( [in] BSTR bstrURL, [out] IUnknown* *ppvObject );

    HRESULT IsNetworkAlive( [out] VARIANT_BOOL* pfRetVal );

	HRESULT IsDestinationReachable( [in] BSTR bstrDestination, [out] VARIANT_BOOL *pfRetVal );
};

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

[
    object,
    uuid(833E4281-AFF7-4AC3-AAC2-9F24C1457BCE),
    dual,
    oleautomation,
    helpstring("IPCHActiveScript Interface"),
    pointer_default(unique)
]
interface IPCHActiveScript : IDispatch
{
    HRESULT Remote_SetScriptSite( [in] IPCHActiveScriptSite* pass );

    HRESULT Remote_SetScriptState( [in]  SCRIPTSTATE   ss );
    HRESULT Remote_GetScriptState( [out] SCRIPTSTATE *pss );

    HRESULT Remote_Close();

    HRESULT Remote_AddNamedItem( [in] BSTR  pstrName ,
                                 [in] DWORD dwFlags  );

    HRESULT Remote_AddTypeLib( [in]  BSTR  bstrTypeLib ,
                               [in]  DWORD dwMajor     ,
                               [in]  DWORD dwMinor     ,
                               [in]  DWORD dwFlags     );

    HRESULT Remote_GetScriptDispatch( [in]  BSTR        pstrItemName ,
                                      [out] IDispatch* *ppdisp       );

    HRESULT Remote_GetCurrentScriptThreadID( [out] SCRIPTTHREADID *pstidThread );

    HRESULT Remote_GetScriptThreadID( [in]  DWORD           dwWin32ThreadId ,
                                      [out] SCRIPTTHREADID *pstidThread     );

    HRESULT Remote_GetScriptThreadState( [in]  SCRIPTTHREADID     stidThread ,
                                         [out] SCRIPTTHREADSTATE *pstsState  );

    HRESULT Remote_InterruptScriptThread( [in] SCRIPTTHREADID  stidThread ,
                                          [in] DWORD           dwFlags    );

    HRESULT Remote_InitNew();

    HRESULT Remote_AddScriptlet( [in]  BSTR       bstrDefaultName       ,
                                 [in]  BSTR       bstrCode              ,
                                 [in]  BSTR       bstrItemName          ,
                                 [in]  BSTR       bstrSubItemName       ,
                                 [in]  BSTR       bstrEventName         ,
                                 [in]  BSTR       bstrDelimiter         ,
                                 [in]  DWORD_PTR  dwSourceContextCookie ,
                                 [in]  ULONG      ulStartingLineNumber  ,
                                 [in]  DWORD      dwFlags               ,
                                 [out] BSTR      *pbstrName             );

    HRESULT Remote_ParseScriptText( [in]  BSTR       bstrCode              ,
                                    [in]  BSTR       bstrItemName          ,
                                    [in]  IUnknown  *punkContext           ,
                                    [in]  BSTR       bstrDelimiter         ,
                                    [in]  DWORD_PTR  dwSourceContextCookie ,
                                    [in]  ULONG      ulStartingLineNumber  ,
                                    [in]  DWORD      dwFlags               ,
                                    [out] VARIANT   *pvarResult            );
};

[
    object,
    uuid(833E4282-AFF7-4AC3-AAC2-9F24C1457BCE),
    dual,
    oleautomation,
    helpstring("IPCHActiveScriptSite Interface"),
    pointer_default(unique)
]
interface IPCHActiveScriptSite : IDispatch
{
    HRESULT Remote_GetLCID( [out] BSTR *plcid );

    HRESULT Remote_GetItemInfo( [in]  BSTR        bstrName    ,
                                [in]  DWORD       dwReturnMask,
                                [out] IUnknown  **ppiunkItem  ,
                                [out] ITypeInfo **ppti        );

    HRESULT Remote_GetDocVersionString( [out] BSTR *pbstrVersion );

    HRESULT Remote_OnScriptTerminate( [in] VARIANT* varResult );

    HRESULT Remote_OnStateChange( [in] SCRIPTSTATE ssScriptState );

    HRESULT Remote_OnScriptError( [in] IUnknown* pscripterror );

    HRESULT Remote_OnEnterScript();

    HRESULT Remote_OnLeaveScript();
};