Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

640 lines
27 KiB

  1. /******************************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. HelpCenterExternal.h
  5. Abstract:
  6. This file contains the declaration of the class exposed as the "pchealth" object.
  7. Revision History:
  8. Ghim-Sim Chua (gschua) 07/23/99
  9. created
  10. Davide Massarenti (dmassare) 07/25/99
  11. modified
  12. ******************************************************************************/
  13. #if !defined(__INCLUDED___PCH___HELPCENTEREXTERNAL_H___)
  14. #define __INCLUDED___PCH___HELPCENTEREXTERNAL_H___
  15. #include <MPC_COM.h>
  16. #include <MPC_HTML2.h>
  17. #include <marscore.h>
  18. #include <Debug.h>
  19. #include <ServiceProxy.h>
  20. #include <Events.h>
  21. #include <HelpSession.h>
  22. #include <Context.h>
  23. #include <Behaviors.h>
  24. #include <ConnectivityLib.h>
  25. #include <HyperLinksLib.h>
  26. #include <OfflineCache.h>
  27. /////////////////////////////////////////////////////////////////////////////
  28. //
  29. // From RDSHost.idl
  30. //
  31. #include <RDSHost.h>
  32. //
  33. // From RDCHost.idl
  34. //
  35. #include <RDCHost.h>
  36. //
  37. // From RDSChan.idl
  38. //
  39. #include <RDSChan.h>
  40. //
  41. // From SAFRDM.idl
  42. //
  43. #include <SAFRDM.h>
  44. /////////////////////////////////////////////////////////////////////////////
  45. class CPCHHelpCenterExternal;
  46. class ATL_NO_VTABLE CPCHSecurityManager : // Hungarian: hcsm
  47. public MPC::Thread<CPCHSecurityManager,IUnknown>,
  48. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  49. public IServiceProvider,
  50. public IInternetSecurityManager
  51. {
  52. CPCHHelpCenterExternal* m_parent;
  53. bool m_fActivated;
  54. HRESULT ActivateService();
  55. public:
  56. BEGIN_COM_MAP(CPCHSecurityManager)
  57. COM_INTERFACE_ENTRY(IServiceProvider)
  58. COM_INTERFACE_ENTRY(IInternetSecurityManager)
  59. END_COM_MAP()
  60. CPCHSecurityManager();
  61. void Initialize( /*[in]*/ CPCHHelpCenterExternal* parent );
  62. //////////////////////////////////////////////////////////////////////
  63. //
  64. // IServiceProvider
  65. //
  66. STDMETHOD(QueryService)( REFGUID guidService, REFIID riid, void **ppv );
  67. //
  68. // IInternetSecurityManager
  69. //
  70. // The only two methods implemented are: MapUrlToZone and ProcessUrlAction.
  71. //
  72. STDMETHOD(SetSecuritySite)( /*[unique][in]*/ IInternetSecurityMgrSite* pSite ) { return INET_E_DEFAULT_ACTION; }
  73. STDMETHOD(GetSecuritySite)( /*[out] */ IInternetSecurityMgrSite* *ppSite ) { return INET_E_DEFAULT_ACTION; }
  74. STDMETHOD(MapUrlToZone )( /*[in] */ LPCWSTR pwszUrl ,
  75. /*[out]*/ DWORD *pdwZone ,
  76. /*[in] */ DWORD dwFlags );
  77. STDMETHOD(GetSecurityId)( /*[in] */ LPCWSTR pwszUrl ,
  78. /*[out] */ BYTE *pbSecurityId ,
  79. /*[in/out]*/ DWORD *pcbSecurityId,
  80. /*[in] */ DWORD_PTR dwReserved ) { return INET_E_DEFAULT_ACTION; }
  81. STDMETHOD(ProcessUrlAction)( /*[in] */ LPCWSTR pwszUrl ,
  82. /*[in] */ DWORD dwAction ,
  83. /*[out]*/ BYTE *pPolicy ,
  84. /*[in] */ DWORD cbPolicy ,
  85. /*[in] */ BYTE *pContext ,
  86. /*[in] */ DWORD cbContext ,
  87. /*[in] */ DWORD dwFlags ,
  88. /*[in] */ DWORD dwReserved );
  89. STDMETHOD(QueryCustomPolicy)( /*[in] */ LPCWSTR pwszUrl ,
  90. /*[in] */ REFGUID guidKey ,
  91. /*[out]*/ BYTE* *ppPolicy ,
  92. /*[out]*/ DWORD *pcbPolicy ,
  93. /*[in] */ BYTE* pContext ,
  94. /*[in] */ DWORD cbContext ,
  95. /*[in] */ DWORD dwReserved ) { return INET_E_DEFAULT_ACTION; }
  96. STDMETHOD(SetZoneMapping )( /*[in]*/ DWORD dwZone ,
  97. /*[in]*/ LPCWSTR lpszPattern ,
  98. /*[in]*/ DWORD dwFlags ) { return INET_E_DEFAULT_ACTION; }
  99. STDMETHOD(GetZoneMappings)( /*[in] */ DWORD dwZone ,
  100. /*[out]*/ IEnumString* *ppenumString,
  101. /*[in] */ DWORD dwFlags ) { return INET_E_DEFAULT_ACTION; }
  102. bool IsUrlTrusted( /*[in]*/ LPCWSTR pwszURL, /*[in]*/ bool *pfSystem = NULL );
  103. };
  104. ////////////////////////////////////////////////////////////////////////////////
  105. class ATL_NO_VTABLE CPCHHelper_IDocHostUIHandler :
  106. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  107. public IServiceProvider,
  108. public IDocHostUIHandler
  109. {
  110. CPCHHelpCenterExternal* m_parent;
  111. public:
  112. BEGIN_COM_MAP(CPCHHelper_IDocHostUIHandler)
  113. COM_INTERFACE_ENTRY(IServiceProvider)
  114. COM_INTERFACE_ENTRY(IDocHostUIHandler)
  115. END_COM_MAP()
  116. CPCHHelper_IDocHostUIHandler();
  117. void Initialize( /*[in]*/ CPCHHelpCenterExternal* parent );
  118. //////////////////////////////////////////////////////////////////////
  119. //
  120. // IServiceProvider
  121. //
  122. STDMETHOD(QueryService)( REFGUID guidService, REFIID riid, void **ppv );
  123. //
  124. // IDocHostUIHandler
  125. //
  126. STDMETHOD(ShowContextMenu)( DWORD dwID, POINT* pptPosition, IUnknown* pCommandTarget, IDispatch* pDispatchObjectHit );
  127. STDMETHOD(GetHostInfo)(DOCHOSTUIINFO* pInfo);
  128. STDMETHOD(ShowUI)(DWORD dwID, IOleInPlaceActiveObject* pActiveObject, IOleCommandTarget* pCommandTarget, IOleInPlaceFrame* pFrame, IOleInPlaceUIWindow* pDoc);
  129. STDMETHOD(HideUI)();
  130. STDMETHOD(UpdateUI)();
  131. STDMETHOD(EnableModeless)(BOOL fEnable);
  132. STDMETHOD(OnDocWindowActivate)(BOOL fActivate);
  133. STDMETHOD(OnFrameWindowActivate)(BOOL fActivate);
  134. STDMETHOD(ResizeBorder)(LPCRECT prcBorder, IOleInPlaceUIWindow* pUIWindow, BOOL fFrameWindow);
  135. STDMETHOD(TranslateAccelerator)(LPMSG lpMsg, const GUID* pguidCmdGroup, DWORD nCmdID);
  136. STDMETHOD(GetOptionKeyPath)(BSTR* pbstrKey, DWORD dwReserved);
  137. STDMETHOD(GetDropTarget)(IDropTarget* pDropTarget, IDropTarget** ppDropTarget);
  138. STDMETHOD(GetExternal)(IDispatch** ppDispatch);
  139. STDMETHOD(TranslateUrl)(DWORD dwTranslate, OLECHAR* pchURLIn, OLECHAR** ppchURLOut);
  140. STDMETHOD(FilterDataObject)(IDataObject* pDO, IDataObject** ppDORet);
  141. };
  142. ////////////////////////////////////////////////////////////////////////////////
  143. MIDL_INTERFACE("FC7D9EA0-3F9E-11d3-93C0-00C04F72DAF7")
  144. IPCHHelpCenterExternalPrivate : public IUnknown
  145. {
  146. public:
  147. STDMETHOD(RegisterForMessages)( /*[in]*/ IOleInPlaceObjectWindowless* ptr, /*[in]*/ bool fRemove );
  148. STDMETHOD(ProcessMessage)( /*[in]*/ MSG* msg );
  149. };
  150. class ATL_NO_VTABLE CPCHHelpCenterExternal :
  151. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  152. public MPC::IDispatchExImpl<IPCHHelpCenterExternal, &IID_IPCHHelpCenterExternal, &LIBID_HelpCenterTypeLib>,
  153. public IPCHHelpCenterExternalPrivate
  154. {
  155. public:
  156. typedef enum
  157. {
  158. DELAYMODE_INVALID ,
  159. DELAYMODE_NAVIGATEWEB ,
  160. DELAYMODE_NAVIGATEHH ,
  161. DELAYMODE_CHANGECONTEXT,
  162. DELAYMODE_REFRESHLAYOUT,
  163. } DelayedExecutionMode;
  164. struct DelayedExecution
  165. {
  166. DelayedExecutionMode mode;
  167. HscContext iVal;
  168. CComBSTR bstrInfo;
  169. CComBSTR bstrURL;
  170. bool fAlsoContent;
  171. DelayedExecution();
  172. };
  173. typedef std::list<DelayedExecution> DelayedExecList;
  174. typedef DelayedExecList::iterator DelayedExecIter;
  175. typedef DelayedExecList::const_iterator DelayedExecIterConst;
  176. typedef std::list<IOleInPlaceObjectWindowless*> MsgProcList;
  177. typedef MsgProcList::iterator MsgProcIter;
  178. typedef MsgProcList::const_iterator MsgProcIterConst;
  179. class TLS
  180. {
  181. public:
  182. bool m_fTrusted;
  183. bool m_fSystem;
  184. CComPtr<IHTMLDocument2> m_Doc;
  185. CComPtr<IWebBrowser2> m_WB;
  186. TLS()
  187. {
  188. m_fTrusted = false;
  189. m_fSystem = false;
  190. }
  191. };
  192. private:
  193. bool m_fFromStartHelp;
  194. bool m_fLayout;
  195. bool m_fWindowVisible;
  196. bool m_fControlled;
  197. bool m_fPersistSettings;
  198. bool m_fHidden;
  199. CComBSTR m_bstrExtraArgument;
  200. HelpHost::XMLConfig* m_HelpHostCfg;
  201. CComBSTR m_bstrStartURL;
  202. CComBSTR m_bstrCurrentPlace;
  203. MARSTHREADPARAM* m_pMTP;
  204. MPC::CComConstantHolder m_constHELPCTR;
  205. MPC::CComConstantHolder m_constHELPSVC;
  206. ////////////////////////////////////////
  207. CPCHSecurityHandle m_SecurityHandle;
  208. DWORD m_tlsID;
  209. bool m_fShuttingDown;
  210. bool m_fPassivated;
  211. CComPtr<HelpHost::Main> m_HelpHost;
  212. CComPtr<CPCHHelpSession> m_hs;
  213. CComPtr<CPCHSecurityManager> m_SECMGR;
  214. CComPtr<CPCHElementBehaviorFactory> m_BEHAV;
  215. CComPtr<CPCHHelper_IDocHostUIHandler> m_DOCUI;
  216. CPCHProxy_IPCHService* m_Service;
  217. CPCHProxy_IPCHUtility* m_Utility;
  218. CPCHProxy_IPCHUserSettings2* m_UserSettings;
  219. CComPtr<CPCHTextHelpers> m_TextHelpers;
  220. //
  221. // Unfortunately, up to now IMarsPanel is not a registered interface, so no proxy available.
  222. //
  223. DWORD m_panel_ThreadID;
  224. CComPtr<IMarsPanel> m_panel_NAVBAR;
  225. CComPtr<IMarsPanel> m_panel_MININAVBAR;
  226. CComPtr<IMarsPanel> m_panel_CONTEXT;
  227. MPC::CComPtrThreadNeutral<IWebBrowser2> m_panel_CONTEXT_WebBrowser;
  228. CPCHWebBrowserEvents m_panel_CONTEXT_Events;
  229. CComPtr<IMarsPanel> m_panel_CONTENTS;
  230. MPC::CComPtrThreadNeutral<IWebBrowser2> m_panel_CONTENTS_WebBrowser;
  231. CPCHWebBrowserEvents m_panel_CONTENTS_Events;
  232. CComPtr<IMarsPanel> m_panel_HHWINDOW;
  233. CComPtr<IPCHHelpViewerWrapper> m_panel_HHWINDOW_Wrapper;
  234. MPC::CComPtrThreadNeutral<IWebBrowser2> m_panel_HHWINDOW_WebBrowser;
  235. CPCHWebBrowserEvents m_panel_HHWINDOW_Events;
  236. CComPtr<IMarsWindowOM> m_shell;
  237. CComPtr<ITimer> m_timer;
  238. CPCHTimerHandle m_DisplayTimer;
  239. DWORD m_dwInBeforeNavigate;
  240. DelayedExecList m_DelayedActions;
  241. CPCHTimerHandle m_ActionsTimer;
  242. HWND m_hwnd;
  243. CPCHEvents m_Events;
  244. MsgProcList m_lstMessageCrackers;
  245. void Passivate();
  246. HRESULT TimerCallback_DisplayNormal ( /*[in]*/ VARIANT );
  247. HRESULT TimerCallback_DisplayHTMLHELP( /*[in]*/ VARIANT );
  248. HRESULT TimerCallback_DelayedActions ( /*[in]*/ VARIANT );
  249. ////////////////////
  250. DelayedExecution& DelayedExecutionAlloc();
  251. HRESULT DelayedExecutionStart();
  252. public:
  253. BEGIN_COM_MAP(CPCHHelpCenterExternal)
  254. COM_INTERFACE_ENTRY2(IDispatch, IDispatchEx)
  255. COM_INTERFACE_ENTRY(IDispatchEx)
  256. COM_INTERFACE_ENTRY(IPCHHelpCenterExternal)
  257. COM_INTERFACE_ENTRY(IPCHHelpCenterExternalPrivate)
  258. END_COM_MAP()
  259. CPCHHelpCenterExternal();
  260. virtual ~CPCHHelpCenterExternal();
  261. INTERNETSECURITY__INVOKEEX();
  262. ////////////////////////////////////////////////////////////////////////////////
  263. static CPCHHelpCenterExternal* s_GLOBAL;
  264. static HRESULT InitializeSystem();
  265. static void FinalizeSystem ();
  266. ////////////////////////////////////////////////////////////////////////////////
  267. bool IsServiceRunning();
  268. bool IsFromStartHelp () { return m_fFromStartHelp; }
  269. bool HasLayoutDefinition() { return m_fLayout; }
  270. bool CanDisplayWindow () { return m_fWindowVisible; }
  271. bool IsControlled () { return m_fControlled; }
  272. bool DoesPersistSettings() { return m_fPersistSettings; }
  273. bool IsHidden () { return m_fHidden; }
  274. HRESULT Initialize();
  275. bool ProcessNavigation( /*[in]*/ HscPanel idPanel, /*[in]*/ BSTR bstrURL, /*[in]*/ BSTR bstrFrame, /*[in]*/ bool fLoading, /*[in/out]*/ VARIANT_BOOL& Cancel );
  276. ////////////////////////////////////////
  277. TLS* GetTLS( );
  278. void SetTLS( TLS* tls );
  279. HRESULT SetTLSAndInvoke( /*[in] */ IDispatch* obj ,
  280. /*[in] */ DISPID id ,
  281. /*[in] */ LCID lcid ,
  282. /*[in] */ WORD wFlags ,
  283. /*[in] */ DISPPARAMS* pdp ,
  284. /*[out]*/ VARIANT* pvarRes ,
  285. /*[out]*/ EXCEPINFO* pei ,
  286. /*[in] */ IServiceProvider* pspCaller );
  287. HRESULT IsTrusted();
  288. HRESULT IsSystem ();
  289. ////////////////////////////////////////
  290. HWND Window ( ) const;
  291. ITimer* Timer ( ) const;
  292. IMarsWindowOM* Shell ( ) const;
  293. IMarsPanel* Panel ( /*[in]*/ HscPanel id ) const;
  294. LPCWSTR PanelName ( /*[in]*/ HscPanel id ) const;
  295. IWebBrowser2* Context ( );
  296. IWebBrowser2* Contents ( );
  297. IWebBrowser2* HHWindow ( );
  298. HelpHost::Main* HelpHost ( ) { return m_HelpHost; }
  299. CPCHHelpSession* HelpSession ( ) { return m_hs ; }
  300. CPCHSecurityManager* SecurityManager ( ) { return m_SECMGR ; }
  301. CPCHElementBehaviorFactory* BehaviorFactory ( ) { return m_BEHAV ; }
  302. CPCHHelper_IDocHostUIHandler* DocHostUIHandler( ) { return m_DOCUI ; }
  303. CPCHEvents& Events ( ) { return m_Events ; }
  304. bool IsHHWindowVisible();
  305. ////////////////////////////////////////
  306. CPCHProxy_IPCHService* Service () { return m_Service; }
  307. CPCHProxy_IPCHUtility* Utility () { return m_Utility; }
  308. CPCHProxy_IPCHUserSettings2* UserSettings() { return m_UserSettings; }
  309. ////////////////////////////////////////
  310. HRESULT NavigateHH ( /*[in ]*/ LPCWSTR szURL );
  311. HRESULT SetPanelUrl ( /*[in]*/ HscPanel id, /*[in ]*/ LPCWSTR szURL );
  312. HRESULT GetPanel ( /*[in]*/ HscPanel id, /*[out]*/ IMarsPanel* *pVal, /*[in]*/ bool fEnsurePresence = false );
  313. HRESULT GetPanelWindowObject( /*[in]*/ HscPanel id, /*[out]*/ IHTMLWindow2* *pVal, /*[in]*/ LPCWSTR szFrame = NULL );
  314. void GetPanelDirect( /*[in]*/ HscPanel id, /*[out]*/ CComPtr<IMarsPanel>& pVal );
  315. ////////////////////////////////////////
  316. HRESULT ProcessLayoutXML( /*[in]*/ LPCWSTR szURL );
  317. HRESULT ProcessArgument( /*[in]*/ int& pos, /*[in]*/ LPCWSTR szArg, /*[in]*/ const int argc, /*[in]*/ LPCWSTR* const argv );
  318. bool DoWeNeedUI( );
  319. HRESULT RunUI ( /*[in]*/ const MPC::wstring& szTitle, /*[in]*/ PFNMARSTHREADPROC pMarsThreadProc );
  320. ////////////////////////////////////////
  321. HRESULT OnHostNotify ( /*[in]*/ MARSHOSTEVENT event, /*[in]*/ IUnknown *punk, /*[in]*/ LPARAM lParam );
  322. HRESULT PreTranslateMessage( /*[in]*/ MSG* msg );
  323. HRESULT SetHelpViewer( /*[in]*/ IPCHHelpViewerWrapper* pWrapper );
  324. HRESULT CreateScriptWrapper( /*[in]*/ REFCLSID rclsid, /*[in]*/ BSTR bstrCode, /*[in]*/ BSTR bstrURL, /*[out]*/ IUnknown* *ppObj );
  325. HRESULT RequestShutdown();
  326. //////////////////////////////////////////////////////////////////////
  327. HRESULT CallFunctionOnPanel( /*[in] */ HscPanel id ,
  328. /*[in] */ LPCWSTR szFrame ,
  329. /*[in] */ BSTR bstrName ,
  330. /*[in] */ VARIANT* pvarParams ,
  331. /*[in] */ int nParams ,
  332. /*[out]*/ VARIANT* pvarRet = NULL );
  333. HRESULT ReadVariableFromPanel( /*[in] */ HscPanel id ,
  334. /*[in] */ LPCWSTR szFrame ,
  335. /*[in] */ BSTR bstrVariable ,
  336. /*[out]*/ CComVariant& varRet );
  337. HRESULT ChangeContext( /*[in]*/ HscContext iVal, /*[in]*/ BSTR bstrInfo = NULL, /*[in]*/ BSTR bstrURL = NULL, /*[in]*/ bool fAlsoContent = true );
  338. HRESULT SetCorrectContentView ( /*[in]*/ bool fShrinked );
  339. HRESULT SetCorrectContentPanel( /*[in]*/ bool fShowNormal, /*[in]*/ bool fShowHTMLHELP, /*[in]*/ bool fNow );
  340. HRESULT RefreshLayout ( );
  341. HRESULT EnsurePlace ( );
  342. HRESULT TransitionToPlace( /*[in]*/ LPCWSTR szMode );
  343. HRESULT ExtendNavigation();
  344. //////////////////////////////////////////////////////////////////////
  345. //
  346. // IDispatch
  347. //
  348. STDMETHOD(GetIDsOfNames)( REFIID riid ,
  349. LPOLESTR* rgszNames ,
  350. UINT cNames ,
  351. LCID lcid ,
  352. DISPID* rgdispid );
  353. STDMETHOD(Invoke)( DISPID dispidMember ,
  354. REFIID riid ,
  355. LCID lcid ,
  356. WORD wFlags ,
  357. DISPPARAMS* pdispparams ,
  358. VARIANT* pvarResult ,
  359. EXCEPINFO* pexcepinfo ,
  360. UINT* puArgErr );
  361. //
  362. // IPCHHelpCenterExternal
  363. //
  364. STDMETHOD(get_HelpSession )( /*[out, retval]*/ IPCHHelpSession* *pVal );
  365. STDMETHOD(get_Channels )( /*[out, retval]*/ ISAFReg* *pVal );
  366. STDMETHOD(get_UserSettings )( /*[out, retval]*/ IPCHUserSettings2* *pVal );
  367. STDMETHOD(get_Security )( /*[out, retval]*/ IPCHSecurity* *pVal );
  368. STDMETHOD(get_Connectivity )( /*[out, retval]*/ IPCHConnectivity* *pVal );
  369. STDMETHOD(get_Database )( /*[out, retval]*/ IPCHTaxonomyDatabase* *pVal );
  370. STDMETHOD(get_TextHelpers )( /*[out, retval]*/ IPCHTextHelpers* *pVal );
  371. STDMETHOD(get_ExtraArgument )( /*[out, retval]*/ BSTR *pVal );
  372. STDMETHOD(get_HelpViewer )( /*[out, retval]*/ IUnknown* *pVal );
  373. HRESULT get_UI_Panel ( /*[out, retval]*/ IUnknown* *pVal, /*[in]*/ HscPanel id ); // Internal method.
  374. STDMETHOD(get_UI_NavBar )( /*[out, retval]*/ IUnknown* *pVal );
  375. STDMETHOD(get_UI_MiniNavBar )( /*[out, retval]*/ IUnknown* *pVal );
  376. STDMETHOD(get_UI_Context )( /*[out, retval]*/ IUnknown* *pVal );
  377. STDMETHOD(get_UI_Contents )( /*[out, retval]*/ IUnknown* *pVal );
  378. STDMETHOD(get_UI_HHWindow )( /*[out, retval]*/ IUnknown* *pVal );
  379. HRESULT get_WEB_Panel ( /*[out, retval]*/ IUnknown* *pVal, /*[in]*/ HscPanel id ); // Internal method.
  380. STDMETHOD(get_WEB_Context )( /*[out, retval]*/ IUnknown* *pVal );
  381. STDMETHOD(get_WEB_Contents )( /*[out, retval]*/ IUnknown* *pVal );
  382. STDMETHOD(get_WEB_HHWindow )( /*[out, retval]*/ IUnknown* *pVal );
  383. STDMETHOD(RegisterEvents )( /*[in]*/ BSTR id, /*[in]*/ long pri, /*[in]*/ IDispatch* function, /*[out,retval]*/ long *cookie );
  384. STDMETHOD(UnregisterEvents)( /*[in]*/ long cookie );
  385. ////////////////////////////////////////
  386. STDMETHOD(CreateObject_SearchEngineMgr )( /*[out, retval]*/ IPCHSEManager* *ppSE );
  387. STDMETHOD(CreateObject_DataCollection )( /*[out, retval]*/ ISAFDataCollection* *ppDC );
  388. STDMETHOD(CreateObject_Cabinet )( /*[out, retval]*/ ISAFCabinet* *ppCB );
  389. STDMETHOD(CreateObject_Channel )( /*[in ]*/ BSTR bstrVendorID ,
  390. /*[in ]*/ BSTR bstrProductID ,
  391. /*[out, retval]*/ ISAFChannel* *ppCh );
  392. STDMETHOD(CreateObject_Incident )( /*[out, retval]*/ ISAFIncident* *ppIn );
  393. STDMETHOD(CreateObject_Encryption )( /*[out, retval]*/ ISAFEncrypt* *ppEn );
  394. STDMETHOD(CreateObject_RemoteDesktopSession )(
  395. /*[in ]*/ long lTimeout ,
  396. /*[in ]*/ BSTR bstrConnectionParms ,
  397. /*[in ]*/ BSTR bstrUserHelpBlob ,
  398. /*[out, retval]*/ ISAFRemoteDesktopSession* *ppRCS );
  399. STDMETHOD(ConnectToExpert )( /* [in] */ BSTR bstrExpertConnectParm,
  400. /* [in] */ LONG lTimeout,
  401. /* [retval][out] */ LONG *lSafErrorCode);
  402. STDMETHOD(CreateObject_RemoteAssistanceIncident)( /* [in] */ BSTR bstrRCTicket,
  403. /* [in] */ long lTimeout,
  404. /* [in] */ BSTR bstrUserName,
  405. /* [in] */ BSTR bstrMessage,
  406. /* [in] */ BSTR bstrPassword,
  407. /* [out,retval] */ ISAFIncident* *ppIn);
  408. STDMETHOD(CreateObject_RemoteDesktopManager )( /*[out, retval]*/ ISAFRemoteDesktopManager* *ppRDM );
  409. STDMETHOD(CreateObject_RemoteDesktopConnection)( /*[out, retval]*/ ISAFRemoteDesktopConnection* *ppRDC );
  410. STDMETHOD(CreateObject_IntercomClient )( /*[out, retval]*/ ISAFIntercomClient* *ppI );
  411. STDMETHOD(CreateObject_IntercomServer )( /*[out, retval]*/ ISAFIntercomServer* *ppI );
  412. STDMETHOD(CreateObject_ContextMenu )( /*[out, retval]*/ IPCHContextMenu* *ppCM );
  413. STDMETHOD(CreateObject_PrintEngine )( /*[out, retval]*/ IPCHPrintEngine* *ppPE );
  414. ////////////////////////////////////////
  415. STDMETHOD(OpenFileAsStream )( /*[in]*/ BSTR bstrFilename, /*[out, retval]*/ IUnknown* *stream );
  416. STDMETHOD(CreateFileAsStream)( /*[in]*/ BSTR bstrFilename, /*[out, retval]*/ IUnknown* *stream );
  417. STDMETHOD(CopyStreamToFile )( /*[in]*/ BSTR bstrFilename, /*[in] */ IUnknown* stream );
  418. STDMETHOD(NetworkAlive )( /*[out, retval]*/ VARIANT_BOOL *pVal );
  419. STDMETHOD(DestinationReachable)( /*[in]*/ BSTR bstrURL, /*[out, retval]*/ VARIANT_BOOL *pVal );
  420. STDMETHOD(FormatError)( /*[in]*/ VARIANT vError, /*[out, retval]*/ BSTR *pVal );
  421. HRESULT RegInit ( /*[in]*/ BSTR bstrKey, /*[in]*/ bool fRead, /*[out]*/ MPC::RegKey& rk, /*[out]*/ MPC::wstring& strValue ); // Internal method.
  422. STDMETHOD(RegRead )( /*[in]*/ BSTR bstrKey, /*[out, retval]*/ VARIANT *pVal );
  423. STDMETHOD(RegWrite )( /*[in]*/ BSTR bstrKey, /*[in ]*/ VARIANT newVal, /*[in,optional]*/ VARIANT vKind );
  424. STDMETHOD(RegDelete)( /*[in]*/ BSTR bstrKey );
  425. ////////////////////////////////////////////////////////////////////////////////
  426. STDMETHOD(Close)();
  427. STDMETHOD(RefreshUI)();
  428. STDMETHOD(Print)( /*[in]*/ VARIANT window, /*[in]*/ VARIANT_BOOL fEvent, /*[out, retval]*/ VARIANT_BOOL *pVal );
  429. STDMETHOD(HighlightWords)( /*[in]*/ VARIANT window, /*[in]*/ VARIANT words );
  430. STDMETHOD(MessageBox )( /*[in]*/ BSTR bstrText , /*[in]*/ BSTR bstrKind , /*[out, retval]*/ BSTR *pVal );
  431. STDMETHOD(SelectFolder)( /*[in]*/ BSTR bstrTitle, /*[in]*/ BSTR bstrDefault, /*[out, retval]*/ BSTR *pVal );
  432. //
  433. // IPCHHelpCenterExternalPrivate
  434. //
  435. STDMETHOD(RegisterForMessages)( /*[in]*/ IOleInPlaceObjectWindowless* ptr, /*[in]*/ bool fRemove );
  436. STDMETHOD(ProcessMessage)( /*[in]*/ MSG* msg );
  437. };
  438. ////////////////////////////////////////////////////////////////////////////////
  439. ////////////////////////////////////////////////////////////////////////////////
  440. class ATL_NO_VTABLE CPCHContextMenu :
  441. public CComObjectRootEx<CComSingleThreadModel>,
  442. public IDispatchImpl<IPCHContextMenu, &IID_IPCHContextMenu, &LIBID_HelpCenterTypeLib>
  443. {
  444. struct Entry
  445. {
  446. CComBSTR bstrText;
  447. CComBSTR bstrID;
  448. int iID;
  449. UINT uFlags;
  450. };
  451. typedef std::list<Entry> List;
  452. typedef List::iterator Iter;
  453. typedef List::const_iterator IterConst;
  454. CPCHHelpCenterExternal* m_parent;
  455. List m_lstItems;
  456. int m_iLastItem;
  457. public:
  458. BEGIN_COM_MAP(CPCHContextMenu)
  459. COM_INTERFACE_ENTRY(IDispatch)
  460. COM_INTERFACE_ENTRY(IPCHContextMenu)
  461. END_COM_MAP()
  462. CPCHContextMenu();
  463. virtual ~CPCHContextMenu();
  464. void Initialize( /*[in]*/ CPCHHelpCenterExternal* parent );
  465. // IPCHContextMenu
  466. STDMETHOD(AddItem )( /*[in]*/ BSTR bstrText, /*[in]*/ BSTR bstrID, /*[in, optional]*/ VARIANT vFlags );
  467. STDMETHOD(AddSeparator)( );
  468. STDMETHOD(Display )( /*[out,retval]*/ BSTR *pVal );
  469. };
  470. #endif // !defined(__INCLUDED___PCH___HELPCENTEREXTERNAL_H___)