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.

83 lines
2.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: helpdoc.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _HELPDOC_H
  11. #define _HELPDOC_H
  12. #pragma warning(disable:4786)
  13. #include "tstring.h"
  14. #include "hcolwrap.h"
  15. #include "collect.h"
  16. using namespace std;
  17. DEFINE_COM_SMARTPTR(IHHCollectionWrapper); // IHHCollectionWrapperPtr
  18. class CHelpCollectionEntry
  19. {
  20. public:
  21. wstring m_strHelpFile;
  22. wstring m_strCLSID;
  23. CHelpCollectionEntry() {}
  24. CHelpCollectionEntry(LPOLESTR pwzHelpFile, const CLSID& clsid);
  25. bool operator==(const CHelpCollectionEntry& other) const
  26. { return (m_strHelpFile == other.m_strHelpFile); }
  27. bool operator< (const CHelpCollectionEntry& other) const
  28. { return (m_strHelpFile < other.m_strHelpFile); }
  29. };
  30. typedef map<CLSID, wstring> EntryMap;
  31. typedef pair<const CLSID, wstring> EntryPair;
  32. typedef vector<EntryPair*> EntryPtrList;
  33. typedef set<CHelpCollectionEntry> HelpCollectionEntrySet;
  34. class CHelpDoc
  35. {
  36. public:
  37. CHelpDoc() {};
  38. HRESULT Initialize(HELPDOCINFO* pDocInfo);
  39. BOOL IsHelpFileValid();
  40. HRESULT CreateHelpFile();
  41. void DeleteHelpFile();
  42. HRESULT UpdateHelpFile(HELPDOCINFO* pNewDocInfo);
  43. LPCTSTR GetFilePath() { return m_szFilePath; }
  44. private:
  45. IHHCollectionWrapperPtr m_spCollection;
  46. HELPDOCINFO* m_pDocInfo;
  47. EntryMap m_entryMap;
  48. EntryPtrList m_entryList;
  49. MMC_ATL::CRegKey m_keySnapIns;
  50. TCHAR m_szFilePath[MAX_PATH];
  51. private:
  52. HRESULT BuildFilePath();
  53. HRESULT CreateSnapInList();
  54. HRESULT AddFileToCollection(
  55. LPCWSTR pszTitle,
  56. LPCWSTR pszFilePath,
  57. BOOL bAddFolder );
  58. void AddSnapInToList(const CLSID& rclsid);
  59. SC CHelpDoc::ScRedirectHelpFile (
  60. WTL::CString& strHelpFile, /* I/O:help file (maybe redirected) */
  61. LANGID& langid); /* O:language ID of output help file */
  62. };
  63. #endif //_HELPDOC_H