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.

132 lines
4.7 KiB

  1. /******************************************************************************
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. Options.h
  5. Abstract:
  6. This file contains the declaration of the class used to implement
  7. the Options inside the Help Center Application.
  8. Revision History:
  9. Davide Massarenti (dmassare) 04/08/2001
  10. created
  11. ******************************************************************************/
  12. #if !defined(__INCLUDED___PCH___OPTIONS_H___)
  13. #define __INCLUDED___PCH___OPTIONS_H___
  14. /////////////////////////////////////////////////////////////////////////////
  15. //
  16. // From HelpServiceTypeLib.idl
  17. //
  18. #include <HelpServiceTypeLib.h>
  19. //
  20. // From HelpCenterTypeLib.idl
  21. //
  22. #include <HelpCenterTypeLib.h>
  23. #include <TaxonomyDatabase.h>
  24. class ATL_NO_VTABLE CPCHOptions : // Hungarian: pcho
  25. public CComObjectRootEx<CComSingleThreadModel>,
  26. public IDispatchImpl<IPCHOptions, &IID_IPCHOptions, &LIBID_HelpCenterTypeLib>
  27. {
  28. typedef enum
  29. {
  30. c_Type_bool ,
  31. c_Type_long ,
  32. c_Type_DWORD ,
  33. c_Type_VARIANT_BOOL,
  34. c_Type_STRING ,
  35. c_Type_FONTSIZE ,
  36. c_Type_TEXTLABELS ,
  37. } OptType;
  38. struct OptionsDef
  39. {
  40. LPCWSTR szKey;
  41. LPCWSTR szValue;
  42. size_t iOffset;
  43. size_t iOffsetFlag;
  44. OptType iType;
  45. bool fSaveAlways;
  46. };
  47. static const OptionsDef c_tbl [];
  48. static const OptionsDef c_tbl_TS[];
  49. bool m_fLoaded;
  50. bool m_fDirty;
  51. bool m_fNoSave;
  52. Taxonomy::HelpSet m_ths;
  53. Taxonomy::HelpSet m_ths_TS;
  54. VARIANT_BOOL m_ShowFavorites; bool m_flag_ShowFavorites;
  55. VARIANT_BOOL m_ShowHistory; bool m_flag_ShowHistory;
  56. OPT_FONTSIZE m_FontSize; bool m_flag_FontSize;
  57. TB_MODE m_TextLabels; bool m_flag_TextLabels;
  58. DWORD m_DisableScriptDebugger; bool m_flag_DisableScriptDebugger;
  59. void ReadTable ( /*[in]*/ const OptionsDef* tbl, /*[in]*/ int len, /*[in]*/ MPC::RegKey& rk );
  60. void WriteTable( /*[in]*/ const OptionsDef* tbl, /*[in]*/ int len, /*[in]*/ MPC::RegKey& rk );
  61. public:
  62. BEGIN_COM_MAP(CPCHOptions)
  63. COM_INTERFACE_ENTRY(IDispatch)
  64. COM_INTERFACE_ENTRY(IPCHOptions)
  65. END_COM_MAP()
  66. CPCHOptions();
  67. ////////////////////////////////////////////////////////////////////////////////
  68. static CPCHOptions* s_GLOBAL;
  69. static HRESULT InitializeSystem();
  70. static void FinalizeSystem ();
  71. ////////////////////////////////////////////////////////////////////////////////
  72. HRESULT Load( /*[in]*/ bool fForce = false );
  73. HRESULT Save( /*[in]*/ bool fForce = false );
  74. void DontPersistSKU() { m_fNoSave = true; }
  75. Taxonomy::HelpSet& CurrentHelpSet () { return m_ths ; }
  76. Taxonomy::HelpSet& TerminalServerHelpSet() { return m_ths_TS ; }
  77. VARIANT_BOOL ShowFavorites () { return m_ShowFavorites ; }
  78. VARIANT_BOOL ShowHistory () { return m_ShowHistory ; }
  79. OPT_FONTSIZE FontSize () { return m_FontSize ; }
  80. TB_MODE TextLabels () { return m_TextLabels ; }
  81. VARIANT_BOOL DisableScriptDebugger() { return m_DisableScriptDebugger ? VARIANT_TRUE : VARIANT_FALSE; }
  82. HRESULT ApplySettings( /*[in]*/ CPCHHelpCenterExternal* ext, /*[in]*/ IUnknown* unk );
  83. public:
  84. // IPCHOptions
  85. STDMETHOD(get_ShowFavorites )( /*[out, retval]*/ VARIANT_BOOL * pVal );
  86. STDMETHOD(put_ShowFavorites )( /*[in ]*/ VARIANT_BOOL newVal );
  87. STDMETHOD(get_ShowHistory )( /*[out, retval]*/ VARIANT_BOOL * pVal );
  88. STDMETHOD(put_ShowHistory )( /*[in ]*/ VARIANT_BOOL newVal );
  89. STDMETHOD(get_FontSize )( /*[out, retval]*/ OPT_FONTSIZE * pVal );
  90. STDMETHOD(put_FontSize )( /*[in ]*/ OPT_FONTSIZE newVal );
  91. STDMETHOD(get_TextLabels )( /*[out, retval]*/ TB_MODE * pVal );
  92. STDMETHOD(put_TextLabels )( /*[in ]*/ TB_MODE newVal );
  93. STDMETHOD(get_DisableScriptDebugger)( /*[out, retval]*/ VARIANT_BOOL * pVal );
  94. STDMETHOD(put_DisableScriptDebugger)( /*[in ]*/ VARIANT_BOOL newVal );
  95. STDMETHOD(Apply)();
  96. HRESULT put_CurrentHelpSet( /*[in]*/ Taxonomy::HelpSet& ths ); // INTERNAL_METHOD
  97. };
  98. /////////////////////////////////////////////////////////////////////////////
  99. #endif // !defined(__INCLUDED___PCH___OPTIONS_H___)