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.

131 lines
3.4 KiB

  1. #ifndef __CUSTMTAB_H__
  2. #define __CUSTMTAB_H__
  3. ///////////////////////////////////////////////////////////
  4. //
  5. //
  6. // CustmTab.h - CustomTab Proxy object.
  7. //
  8. // This header defines the class which manages custom
  9. // navigation panes.
  10. // INavPaneUI Interface
  11. #include "navui.h"
  12. // Other nav pane related structures.
  13. #include "navpane.h"
  14. // The IHHWindowPane header file:
  15. #include "HTMLHelp_.h"
  16. ///////////////////////////////////////////////////////////
  17. //
  18. // Forwards
  19. //
  20. ///////////////////////////////////////////////////////////
  21. //
  22. // Constants
  23. //
  24. ///////////////////////////////////////////////////////////
  25. //
  26. // CBookmarksNavPane
  27. //
  28. class CCustomNavPane : public INavUI
  29. {
  30. public:
  31. //---Construction
  32. CCustomNavPane (CHHWinType* pWinType);
  33. virtual ~CCustomNavPane () ;
  34. public:
  35. //--- INavUI Interface functions.
  36. virtual BOOL Create(HWND hwndParent);
  37. virtual LRESULT OnCommand(HWND hwnd, UINT id, UINT uNotifiyCode, LPARAM lParam);
  38. virtual void ResizeWindow();
  39. virtual void HideWindow() ;
  40. virtual void ShowWindow() ;
  41. virtual void SetPadding(int pad) ;
  42. virtual void SetTabPos(int tabpos) ;
  43. // Set focus to the most expected control, usually edit combo.
  44. virtual void SetDefaultFocus() ;
  45. // Process accelerator keys.
  46. virtual bool ProcessMenuChar(HWND hwndParent, int ch) ;
  47. // Process WM_NOTIFY messages. Used by embedded Tree and List view controls.
  48. virtual LRESULT OnNotify(HWND hwnd, WPARAM wParam, LPARAM lParam) ;
  49. // Process WM_DRAWITEM messages.
  50. virtual void OnDrawItem(UINT id, LPDRAWITEMSTRUCT pdis) ;
  51. // Seed the nav ui with a search term or keyword.
  52. virtual void Seed(LPCSTR pszSeed) ;
  53. virtual BOOL Synchronize(PSTR , CTreeNode* ) ;
  54. void OnVKListNotify(NMHDR* pNMHdr) {/*Not Implemented*/}
  55. //--- Public Functions.
  56. public:
  57. HRESULT SetControlProgId(LPCOLESTR ProgId);
  58. //--- Public Static functions
  59. public:
  60. // Registers the window class for this window.
  61. static void RegisterWindowClass() ;
  62. private:
  63. //--- Helper Functions.
  64. void SetFont (HFONT hfont) { m_hfont = hfont; }
  65. void SaveCustomTabState() ;
  66. void LoadCustomTabState() ;
  67. //int GetAcceleratorKey(HWND hwndctrl) ;
  68. //int GetAcceleratorKey(int ctrlid) {return GetAcceleratorKey(::GetDlgItem(m_hWnd, ctrlid)) ; }
  69. protected:
  70. //--- Message Handler Functions
  71. #if 0
  72. void OnTab(HWND hwndReceivedTab, BookmarkDlgItemInfoIndex index) ;
  73. void OnArrow(HWND hwndReceivedTab, BookmarkDlgItemInfoIndex index, int key) ;
  74. bool OnReturn(HWND hwndReceivedTab, BookmarkDlgItemInfoIndex /*index*/);
  75. #endif
  76. private:
  77. //--- Callbacks
  78. // Window Proc
  79. LRESULT CustomNavePaneProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ;
  80. // Static Window Proc.
  81. static LRESULT WINAPI s_CustomNavePaneProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ;
  82. protected:
  83. //--- Statics
  84. private:
  85. //--- Member Functions.
  86. HWND m_hWnd;
  87. HFONT m_hfont; // author-specified font to use for child windows
  88. int m_padding;
  89. int m_NavTabPos; // location of parent tabs
  90. // Window handle to the embedded component.
  91. HWND m_hwndComponent ;
  92. // Holds a pointer to the wintype so we can send the WMP_HH_TAB_KEY message to it.
  93. CHHWinType* m_pWinType;
  94. // Pointer to the GUID.
  95. CLSID m_clsid ;
  96. // Smart pointer to the IHHWindowPane interface on the component.
  97. CComPtr<IHHWindowPane> m_spIHHWindowPane;
  98. };
  99. #endif //__CUSTMTAB_H__