Source code of Windows XP (NT5)
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.

241 lines
7.5 KiB

  1. /******************************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. HelpHostProxy.h
  5. Abstract:
  6. This file contains the declaration of the classes for the IHelpHost*.
  7. Revision History:
  8. Davide Massarenti (dmassare) 11/03/2000
  9. modified
  10. ******************************************************************************/
  11. #if !defined(__INCLUDED___PCH___HELPHOSTPROXY_H___)
  12. #define __INCLUDED___PCH___HELPHOSTPROXY_H___
  13. /////////////////////////////////////////////////////////////////////////////
  14. #include <dispex.h>
  15. #include <ocmm.h>
  16. namespace HelpHostProxy
  17. {
  18. //
  19. // Forward declarations.
  20. //
  21. class Main;
  22. class Panes;
  23. class Pane;
  24. class Window;
  25. ////////////////////////////////////////////////////////////////////////////////
  26. class ATL_NO_VTABLE Main :
  27. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  28. public CComCoClass<Main, &CLSID_PCHHelpHost>,
  29. public IDispatchImpl<IHelpHost, &IID_IHelpHost, &LIBID_HCLaunchLIB>
  30. {
  31. public:
  32. CComPtr<IPCHHelpHost> m_real;
  33. CComPtr<Window> m_subWindow;
  34. CComPtr<Panes> m_subPanes;
  35. CComQIPtr<IPCHHelpHostEvents> m_Events;
  36. CComQIPtr<IPCHHelpHostNavEvents> m_EventsNav;
  37. public:
  38. DECLARE_REGISTRY_RESOURCEID(IDR_HCAPI)
  39. DECLARE_PROTECT_FINAL_CONSTRUCT()
  40. BEGIN_COM_MAP(Main)
  41. COM_INTERFACE_ENTRY(IDispatch)
  42. COM_INTERFACE_ENTRY(IHelpHost)
  43. END_COM_MAP()
  44. Main();
  45. virtual ~Main();
  46. HRESULT FinalConstruct();
  47. void FinalRelease ();
  48. HRESULT Initialize();
  49. void Passivate ();
  50. ////////////////////
  51. STDMETHOD(put_FilterName)( /*[in] */ BSTR Value );
  52. STDMETHOD(get_FilterName)( /*[out, retval]*/ BSTR *pValue );
  53. STDMETHOD(get_Namespace )( /*[out, retval]*/ BSTR *pValue );
  54. STDMETHOD(get_Session )( /*[out, retval]*/ IDispatch* *pValue );
  55. STDMETHOD(get_FilterExpression)( /*[out, retval]*/ BSTR *pValue );
  56. STDMETHOD(get_CurrentUrl )( /*[out, retval]*/ BSTR *pValue );
  57. STDMETHOD(get_Panes )( /*[out, retval]*/ IHelpHostPanes* *pValue );
  58. STDMETHOD(get_HelpHostWindow )( /*[out, retval]*/ IHelpHostWindow* *pValue );
  59. STDMETHOD(OpenNamespace)( /*[in]*/ BSTR newNamespace, /*[in]*/ BSTR filterName );
  60. STDMETHOD(DisplayTopicFromURL)( /*[in]*/ BSTR url, /*[in]*/ VARIANT options );
  61. STDMETHOD(DisplayResultsFromQuery)( /*[in]*/ BSTR query, /*[in]*/ BSTR navMoniker, /*[in]*/ VARIANT options );
  62. STDMETHOD(ShowPane)( /*[in]*/ BSTR paneName, /*[in]*/ BSTR query, /*[in]*/ BSTR navMoniker, /*[in]*/ VARIANT options );
  63. STDMETHOD(Terminate)();
  64. //
  65. // Methods on the stub.
  66. //
  67. //STDMETHOD(PRIV_Init)( /*[in]*/ IUnknown* pCaller );
  68. };
  69. ////////////////////////////////////////////////////////////////////////////////
  70. class ATL_NO_VTABLE Window :
  71. public CComObjectRootEx<CComSingleThreadModel>,
  72. public IDispatchImpl<IHelpHostWindow, &IID_IHelpHostWindow, &LIBID_HCLaunchLIB>
  73. {
  74. public:
  75. CComPtr<IPCHHelpHostWindow> m_real;
  76. Main* m_Main;
  77. long m_ParentWindow;
  78. public:
  79. BEGIN_COM_MAP(Window)
  80. COM_INTERFACE_ENTRY(IDispatch)
  81. COM_INTERFACE_ENTRY(IHelpHostWindow)
  82. END_COM_MAP()
  83. Window();
  84. virtual ~Window();
  85. HRESULT Initialize( /*[in]*/ Main* parent );
  86. void Passivate ( );
  87. ////////////////////
  88. STDMETHOD(put_ParentWindow)( /*[in ]*/ long hWND );
  89. STDMETHOD(get_ParentWindow)( /*[out, retval]*/ long *phWND );
  90. STDMETHOD(put_UILanguage)( /*[in ]*/ long LCID );
  91. STDMETHOD(get_UILanguage)( /*[out, retval]*/ long *pLCID );
  92. STDMETHOD(put_Visible )( /*[in ]*/ VARIANT_BOOL Value );
  93. STDMETHOD(get_Visible )( /*[out, retval]*/ VARIANT_BOOL *pValue );
  94. STDMETHOD(get_OriginX)( /*[out, retval]*/ long *pValue );
  95. STDMETHOD(get_OriginY)( /*[out, retval]*/ long *pValue );
  96. STDMETHOD(get_Width )( /*[out, retval]*/ long *pValue );
  97. STDMETHOD(get_Height )( /*[out, retval]*/ long *pValue );
  98. STDMETHOD(MoveWindow)( /*[in]*/ long originX, /*[in]*/ long originY, /*[in]*/ long width, /*[in]*/ long height );
  99. STDMETHOD(WaitForTermination)( /*[in]*/ long timeOut );
  100. //
  101. // Methods on the stub.
  102. //
  103. // STDMETHOD(get_PRIV_Window)( /*[out, retval]*/ long *phWND );
  104. };
  105. ////////////////////////////////////////////////////////////////////////////////
  106. typedef MPC::CComCollection<IHelpHostPanes, &LIBID_HCLaunchLIB, CComSingleThreadModel> BasePanes;
  107. class ATL_NO_VTABLE Panes :
  108. public BasePanes
  109. {
  110. public:
  111. typedef BasePanes super;
  112. typedef std::list< Pane* > List;
  113. typedef List::iterator Iter;
  114. typedef List::const_iterator IterConst;
  115. CComPtr<IPCHHelpHostPanes> m_real;
  116. Main* m_Main;
  117. List m_Panes;
  118. public:
  119. BEGIN_COM_MAP(Panes)
  120. COM_INTERFACE_ENTRY(IDispatch)
  121. COM_INTERFACE_ENTRY(IHelpHostPanes)
  122. END_COM_MAP()
  123. Panes();
  124. virtual ~Panes();
  125. HRESULT Initialize( /*[in]*/ Main* parent );
  126. void Passivate ( );
  127. HRESULT GetPane( /*[in]*/ LPCWSTR szName, /*[out]*/ Pane* *pVal );
  128. ////////////////////
  129. //
  130. // This is a trick!
  131. //
  132. // MPC::CComCollection defined a "get_Item" method that has a different signature from the
  133. // one in IHelpHostPanes, so it's not callable from scripting. Instead, this method will
  134. // be called.
  135. //
  136. STDMETHOD(get_Item)( /*[in]*/ VARIANT Index, /*[out]*/ VARIANT* pvar );
  137. };
  138. ////////////////////////////////////////////////////////////////////////////////
  139. class ATL_NO_VTABLE Pane :
  140. public CComObjectRootEx<CComSingleThreadModel>,
  141. public IDispatchImpl<IHelpHostPane, &IID_IHelpHostPane, &LIBID_HCLaunchLIB>
  142. {
  143. public:
  144. CComPtr<IPCHHelpHostPane> m_real;
  145. Main* m_Main;
  146. CComBSTR m_bstrName;
  147. CComBSTR m_bstrMoniker;
  148. VARIANT_BOOL m_fVisible;
  149. public:
  150. BEGIN_COM_MAP(Pane)
  151. COM_INTERFACE_ENTRY(IDispatch)
  152. COM_INTERFACE_ENTRY(IHelpHostPane)
  153. END_COM_MAP()
  154. Pane();
  155. virtual ~Pane();
  156. HRESULT Initialize( /*[in]*/ Main* parent );
  157. void Passivate ( );
  158. ////////////////////
  159. STDMETHOD(put_Visible )( /*[in ]*/ VARIANT_BOOL Value );
  160. STDMETHOD(get_Visible )( /*[out, retval]*/ VARIANT_BOOL *pValue );
  161. STDMETHOD(put_NavMoniker)( /*[in ]*/ BSTR Value );
  162. STDMETHOD(get_NavMoniker)( /*[out, retval]*/ BSTR *pValue );
  163. STDMETHOD(get_Name )( /*[out, retval]*/ BSTR *pValue );
  164. STDMETHOD(get_CurrentUrl)( /*[out, retval]*/ BSTR *pValue );
  165. STDMETHOD(get_WebBrowser)( /*[out, retval]*/ IDispatch* *pValue );
  166. STDMETHOD(DisplayTopicFromURL)( /*[in]*/ BSTR url, /*[in]*/ VARIANT options );
  167. STDMETHOD(DisplayResultsFromQuery)( /*[in]*/ BSTR query, /*[in]*/ VARIANT options );
  168. STDMETHOD(Sync)( /*[in]*/ BSTR url, /*[in]*/ VARIANT options );
  169. };
  170. };
  171. #endif // !defined(__INCLUDED___PCH___HELPHOSTPROXY_H___)