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.

113 lines
2.6 KiB

  1. #ifndef __NAVUI_H__
  2. #define __NAVUI_H__
  3. class CTreeNode;
  4. ///////////////////////////////////////////////////////////
  5. //
  6. //
  7. // NavUI.h - Defines naviagation UI interface
  8. //
  9. //
  10. /*
  11. This class defines the interface for a navigation pane. All navigation
  12. panes must inherit and implement these functions. An array of nav panes
  13. are stored in CHHWinType. These functions are called virtually.
  14. */
  15. ///////////////////////////////////////////////////////////
  16. //
  17. // INavUI Interface
  18. //
  19. interface INavUI
  20. {
  21. virtual ~INavUI() {} // Destructor doesn't get called if this is missing?!?!?
  22. // Interface
  23. virtual BOOL
  24. Create(HWND hwndParent) = 0;
  25. virtual LRESULT
  26. OnCommand(HWND hwnd, UINT id, UINT uNotifiyCode, LPARAM lParam) = 0; //Search
  27. virtual void
  28. ResizeWindow() = 0;
  29. virtual void
  30. HideWindow() = 0;
  31. virtual void
  32. ShowWindow() = 0;
  33. virtual void
  34. SetPadding(int pad) = 0 ;
  35. virtual void
  36. SetTabPos(int tabpos) = 0 ;
  37. //--- New functions
  38. // Handles activating
  39. //virtual void
  40. //Activate() = 0;
  41. // Set focus to the most expected control, usually edit combo.
  42. virtual void
  43. SetDefaultFocus() = 0 ;
  44. // Process accelerator keys.
  45. virtual bool
  46. ProcessMenuChar(HWND hwndParent, int ch) = 0 ;
  47. // Process WM_NOTIFY messages. Used by embedded Tree and List view controls.
  48. virtual LRESULT
  49. OnNotify(HWND hwnd, WPARAM wParam, LPARAM lParam) = 0;
  50. // Process WM_DRAWITEM messages.
  51. virtual void
  52. OnDrawItem(UINT id, LPDRAWITEMSTRUCT pdis) = 0 ;
  53. // Seed the nav ui with a search term or keyword.
  54. virtual void
  55. Seed(LPCSTR pszSeed) = 0 ;
  56. virtual void OnVKListNotify(NMHDR* pNMHdr) = 0;
  57. virtual BOOL Synchronize(PSTR pszUrl, CTreeNode* pSyncNode = NULL) {return FALSE;}
  58. virtual void Refresh(void) { return; }
  59. /* The following are not called externally.
  60. virtual void
  61. SetFont(HFONT hfont) = 0 ;
  62. virtual HWND
  63. GetParentSize(RECT* prcParent, HWND hwndParent) = 0; // Move to util.h
  64. virutal void
  65. FillListBox(BOOL fReset = FALSE) = 0;
  66. */
  67. /* Member funcitons in other UI panes.
  68. //Index
  69. void ChangeOuter(IUnknown* pUnkOuter) { m_pOuter = pUnkOuter; }
  70. BOOL ReadIndexFile(PCSTR pszFile);
  71. // Toc
  72. void ChangeOuter(IUnknown* pUnkOuter) { m_pOuter = pUnkOuter; }
  73. BOOL CreateContentsWindow(HWND hwndParent);
  74. BOOL InitTreeView(void);
  75. BOOL ReadFile(PCSTR pszFile);
  76. void SetStyles(DWORD exStyles, DWORD dwStyles) { m_exStyles = exStyles; m_dwStyles = dwStyles; }
  77. BOOL Synchronize(PCSTR pszName, PSTR pszUrl);
  78. void SaveCurUrl(void);
  79. */
  80. };
  81. #endif //__NAVUI_H__