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.

109 lines
3.7 KiB

  1. // Copyright (C) 1996-1997 Microsoft Corporation. All rights reserved.
  2. #if _MSC_VER > 1000
  3. #pragma once
  4. #endif
  5. #ifndef __CTOC_H__
  6. #define __CTOC_H__
  7. #ifndef __SITEMAP_H__
  8. #include "sitemap.h"
  9. #endif
  10. #include "stdio.h"
  11. #include "parserhh.h"
  12. #include "collect.h"
  13. #include "hhtypes.h"
  14. #include "toc.h"
  15. #include "navui.h" // Cleanup headers.
  16. class CHtmlHelpControl; // forward reference
  17. class CHHWinType; // forward reference
  18. class CToc : public INavUI
  19. {
  20. private:
  21. void UpdateTOCSlot(CTreeNode* pNode);
  22. public:
  23. CToc(CHtmlHelpControl* phhctrl, IUnknown* pUnkOuter, CHHWinType* phh = NULL);
  24. virtual ~CToc();
  25. //--- INavUI Functions.
  26. BOOL Create(HWND hwndParent);
  27. LRESULT OnCommand(HWND hwnd, UINT id, UINT uNotifiyCode, LPARAM lParam);
  28. void HideWindow(void);
  29. void ShowWindow(void);
  30. void ResizeWindow();
  31. void SetPadding(int pad) { m_padding = pad; }
  32. void SetTabPos(int tabpos) { m_NavTabPos = tabpos; }
  33. LRESULT OnNotify(HWND hwnd, WPARAM wParam, LPARAM lParam) ;
  34. void SetDefaultFocus() ;
  35. void Refresh(void);
  36. // Not Implemented
  37. bool ProcessMenuChar(HWND hwndParent, int ch) { /*Not Implemented*/ return false;}
  38. void OnDrawItem(UINT id, LPDRAWITEMSTRUCT pdis) {/*Not Implemented*/}
  39. void Seed(LPCSTR pszSeed) {/*Not Implemented*/}
  40. void OnVKListNotify(NMHDR* pNMHdr) {/*Not Implemented*/}
  41. //--- Other Member Functions
  42. void ChangeOuter(IUnknown* pUnkOuter) { m_pOuter = pUnkOuter; }
  43. BOOL InitTreeView(void);
  44. LRESULT OnSiteMapContentsCommand(UINT id, UINT uNotifiyCode, LPARAM lParam);
  45. LRESULT OnBinTOCContentsCommand(UINT id, UINT uNotifiyCode, LPARAM lParam);
  46. BOOL ReadFile(PCSTR pszFile);
  47. void SetStyles(DWORD exStyles, DWORD dwStyles) { m_exStyles = exStyles; m_dwStyles = dwStyles; }
  48. LRESULT TreeViewMsg( NM_TREEVIEW* pnmhdr ); // The treeview message handeler
  49. LRESULT OnSiteMapTVMsg( NM_TREEVIEW *pnmhdr ); // The message handeler for handeling SITEMAP
  50. LRESULT OnBinaryTOCTVMsg( NM_TREEVIEW *pnmhdr );// The message handeler for handeling Binary TOC
  51. BOOL Synchronize(LPCSTR pszUrl);
  52. DWORD OnCustomDraw(LPNMTVCUSTOMDRAW nmcdrw);
  53. void SaveCurUrl(void);
  54. BOOL m_fBinaryTOC; // TRUE if compiled TOC (.chm/.chi) is available, else FALSE
  55. CTreeNode* m_pBinTOCRoot; // The root of the binary table of contents
  56. CTreeNode* pCurrentTreeNode;
  57. CSiteMap m_sitemap; // the sitemap that holds an uncompiled TOC.
  58. HTREEITEM m_tiFirstVisible; // Binary TOC, the initial tree view visible when the Tree
  59. // view is first displayed.
  60. HTREEITEM* m_phTreeItem;
  61. int m_cntFirstVisible;
  62. int m_cntCurHighlight;
  63. HTREEITEM m_hitemCurHighlight;
  64. BOOL m_fSuppressJump; // TRUE to prevent jumping on selection change
  65. BOOL m_fIgnoreNextSelChange;
  66. BYTE* m_pSelectedTocInfoTypes;
  67. HWND m_hwndTree;
  68. HBITMAP m_hbmpBackGround;
  69. HPALETTE m_hpalBackGround;
  70. HBRUSH m_hbrBackGround; // background brush
  71. int m_cxBackBmp;
  72. int m_cyBackBmp;
  73. int m_cFonts;
  74. HFONT* m_ahfonts;
  75. BOOL m_fGlobal; // means we've already initialized ourselves once
  76. HIMAGELIST m_hil;
  77. CHtmlHelpControl* m_phhctrl;
  78. IUnknown* m_pOuter;
  79. BOOL m_fHack;
  80. DWORD m_exStyles;
  81. DWORD m_dwStyles;
  82. int m_padding;
  83. int m_NavTabPos;
  84. BOOL m_fSuspendSync;
  85. CHHWinType* m_phh;
  86. CStr m_cszCurUrl;
  87. BOOL m_fSyncOnActivation; // TRUE to sync when TOC tab is activated
  88. CInfoType* m_pInfoType; // The information Types
  89. };
  90. #endif // __CTOC_H__