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.

210 lines
6.2 KiB

  1. /******************************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. Context.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___CONTEXT_H___)
  12. #define __INCLUDED___PCH___CONTEXT_H___
  13. /////////////////////////////////////////////////////////////////////////////
  14. #include <dispex.h>
  15. #include <ocmm.h>
  16. //
  17. // Forward declarations.
  18. //
  19. class CPCHHelpCenterExternal;
  20. namespace HelpHost
  21. {
  22. //
  23. // Forward declarations.
  24. //
  25. class Main;
  26. class Panes;
  27. class Pane;
  28. class Window;
  29. ////////////////////////////////////////////////////////////////////////////////
  30. typedef enum
  31. {
  32. COMPID_NAVBAR = 0,
  33. COMPID_MININAVBAR ,
  34. COMPID_CONTEXT ,
  35. COMPID_CONTENTS ,
  36. COMPID_HHWINDOW ,
  37. COMPID_FIRSTPAGE ,
  38. COMPID_HOMEPAGE ,
  39. COMPID_SUBSITE ,
  40. COMPID_SEARCH ,
  41. COMPID_INDEX ,
  42. COMPID_FAVORITES ,
  43. COMPID_HISTORY ,
  44. COMPID_CHANNELS ,
  45. COMPID_OPTIONS ,
  46. COMPID_MAX ,
  47. } CompId;
  48. ////////////////////////////////////////////////////////////////////////////////
  49. class ATL_NO_VTABLE Main :
  50. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  51. public IDispatchImpl<IPCHHelpHost, &IID_IPCHHelpHost, &LIBID_HelpCenterTypeLib>
  52. {
  53. public:
  54. CComPtr<IRunningObjectTable> m_rt;
  55. CComPtr<IMoniker> m_moniker;
  56. DWORD m_dwRegister;
  57. CPCHHelpCenterExternal* m_External;
  58. HANDLE m_hEvent;
  59. bool m_comps[COMPID_MAX];
  60. public:
  61. BEGIN_COM_MAP(Main)
  62. COM_INTERFACE_ENTRY(IDispatch)
  63. COM_INTERFACE_ENTRY(IPCHHelpHost)
  64. END_COM_MAP()
  65. Main();
  66. virtual ~Main();
  67. HRESULT Initialize( /*[in]*/ CPCHHelpCenterExternal* external );
  68. void Passivate ( );
  69. HRESULT Locate ( /*[in]*/ CLSID& clsid, /*[out]*/ CComPtr<IPCHHelpHost>& pVal );
  70. HRESULT Register( /*[in]*/ CLSID& clsid );
  71. ////////////////////
  72. void ChangeStatus ( /*[in]*/ LPCWSTR szComp, /*[in]*/ bool fStatus );
  73. void ChangeStatus ( /*[in]*/ CompId idComp, /*[in]*/ bool fStatus );
  74. bool GetStatus ( /*[in]*/ CompId idComp );
  75. bool WaitUntilLoaded( /*[in]*/ CompId idComp, /*[in]*/ DWORD dwTimeout = 5000 ); // 5 seconds wait for page load.
  76. ////////////////////
  77. STDMETHOD(DisplayTopicFromURL)( /*[in]*/ BSTR url, /*[in]*/ VARIANT options );
  78. };
  79. ////////////////////////////////////////////////////////////////////////////////
  80. class XMLConfig : public MPC::Config::TypeConstructor
  81. {
  82. DECLARE_CONFIG_MAP(XMLConfig);
  83. public:
  84. class Context : public MPC::Config::TypeConstructor
  85. {
  86. DECLARE_CONFIG_MAP(Context);
  87. public:
  88. CComBSTR m_bstrID;
  89. CComBSTR m_bstrTaxonomyPath;
  90. CComBSTR m_bstrNodeToHighlight;
  91. CComBSTR m_bstrTopicToHighlight;
  92. CComBSTR m_bstrQuery;
  93. ////////////////////////////////////////
  94. //
  95. // MPC::Config::TypeConstructor
  96. //
  97. DEFINE_CONFIG_DEFAULTTAG();
  98. DECLARE_CONFIG_METHODS();
  99. //
  100. ////////////////////////////////////////
  101. Context();
  102. };
  103. class WindowSettings : public MPC::Config::TypeConstructor
  104. {
  105. DECLARE_CONFIG_MAP(WindowSettings);
  106. public:
  107. CComBSTR m_bstrLayout;
  108. bool m_fNoResize ; bool m_fPresence_NoResize;
  109. bool m_fMaximized; bool m_fPresence_Maximized;
  110. CComBSTR m_bstrTitle ; bool m_fPresence_Title;
  111. CComBSTR m_bstrLeft ; bool m_fPresence_Left;
  112. CComBSTR m_bstrTop ; bool m_fPresence_Top;
  113. CComBSTR m_bstrWidth ; bool m_fPresence_Width;
  114. CComBSTR m_bstrHeight; bool m_fPresence_Height;
  115. ////////////////////////////////////////
  116. //
  117. // MPC::Config::TypeConstructor
  118. //
  119. DEFINE_CONFIG_DEFAULTTAG();
  120. DECLARE_CONFIG_METHODS();
  121. //
  122. ////////////////////////////////////////
  123. WindowSettings();
  124. };
  125. class ApplyTo : public MPC::Config::TypeConstructor
  126. {
  127. DECLARE_CONFIG_MAP(ApplyTo);
  128. public:
  129. CComBSTR m_bstrSKU;
  130. CComBSTR m_bstrLanguage;
  131. CComBSTR m_bstrTopicToDisplay;
  132. CComBSTR m_bstrApplication;
  133. WindowSettings* m_WindowSettings;
  134. Context* m_Context;
  135. ////////////////////////////////////////
  136. //
  137. // MPC::Config::TypeConstructor
  138. //
  139. DEFINE_CONFIG_DEFAULTTAG();
  140. DECLARE_CONFIG_METHODS();
  141. //
  142. ////////////////////////////////////////
  143. ApplyTo();
  144. ~ApplyTo();
  145. bool MatchSystem( /*[in]*/ CPCHHelpCenterExternal* external ,
  146. /*[out]*/ Taxonomy::HelpSet& ths );
  147. };
  148. typedef std::list< ApplyTo > ApplyToList;
  149. typedef ApplyToList::iterator ApplyToIter;
  150. typedef ApplyToList::const_iterator ApplyToIterConst;
  151. ApplyToList m_lstSessions;
  152. ////////////////////////////////////////
  153. //
  154. // MPC::Config::TypeConstructor
  155. //
  156. DEFINE_CONFIG_DEFAULTTAG();
  157. DECLARE_CONFIG_METHODS();
  158. //
  159. ////////////////////////////////////////
  160. };
  161. };
  162. #endif // !defined(__INCLUDED___PCH___CONTEXT_H___)