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.

121 lines
3.4 KiB

  1. // Copyright (C) 1996-1997 Microsoft Corporation. All rights reserved.
  2. #if _MSC_VER > 1000
  3. #pragma once
  4. #endif
  5. #ifndef __CSEARCH_H__
  6. #define __CSEARCH_H__
  7. #ifndef __SITEMAP_H__
  8. #include "sitemap.h"
  9. #endif
  10. #include "clistbox.h"
  11. #include "fts.h"
  12. #include "listview.h"
  13. #include "secwin.h"
  14. #include "navui.h" // Clean up headers.
  15. // Common navpane functions. Used for processing accelerators.
  16. #include "navpane.h"
  17. ///////////////////////////////////////////////////////////
  18. //
  19. // Forward References
  20. //
  21. class CHtmlHelpControl; // forward reference
  22. ///////////////////////////////////////////////////////////
  23. //
  24. // CSearch Declaration
  25. //
  26. class CSearch : public INavUI
  27. {
  28. public:
  29. //--- Internal Contants
  30. typedef enum DlgItemInfoIndex
  31. {
  32. c_KeywordEdit,
  33. c_ListTopicBtn,
  34. c_ResultsList,
  35. c_DisplayBtn,
  36. c_NumDlgItems
  37. };
  38. //--- Construction
  39. CSearch(CHHWinType* phh);
  40. virtual ~CSearch();
  41. //--- INavUI Interface
  42. BOOL Create (HWND hwndParent);
  43. LRESULT OnCommand (HWND hwnd, UINT id, UINT uNotifiyCode, LPARAM lParam);
  44. void ResizeWindow ();
  45. void SetPadding (int pad) { m_padding = pad; }
  46. void SetTabPos (int tabpos) { m_NavTabPos = tabpos; }
  47. void HideWindow (void);
  48. void ShowWindow (void);
  49. //--- INavUI Interface functions - NEW
  50. void SetDefaultFocus () ;
  51. bool ProcessMenuChar (HWND hwndParent, int ch);
  52. LRESULT OnNotify (HWND hwnd, WPARAM wParam, LPARAM lParam) ;
  53. void OnDrawItem(UINT id, LPDRAWITEMSTRUCT pdis) {/*Not Implemented*/}
  54. void Seed(LPCSTR pszSeed) {/*Not Implemented*/}
  55. void OnVKListNotify(NMHDR* pNMHdr) {/*Not Implemented*/}
  56. //--- Helper functions.
  57. protected:
  58. // Returns the font to be used.
  59. HFONT GetContentFont() { return m_phh->GetContentFont(); }
  60. void InitDlgItemArray() ;
  61. //--- Calbacks
  62. private:
  63. static LRESULT WINAPI ComboProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  64. static LRESULT WINAPI ListViewProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  65. static LRESULT WINAPI ListBtnProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  66. static LRESULT WINAPI DisplayBtnProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  67. static WNDPROC s_lpfnlComboWndProc;
  68. static WNDPROC s_lpfnlListViewWndProc;
  69. // Member data.
  70. protected:
  71. int m_cFonts;
  72. CHHWinType* m_phh;
  73. CExCollection* m_pTitleCollection;
  74. HPALETTE m_hpalBackGround;
  75. HBRUSH m_hbrBackGround; // background brush
  76. HBITMAP m_hbmpBackGround;
  77. int m_cxBackBmp;
  78. int m_cyBackBmp;
  79. HWND m_hwndComboBox; //TODO: This isn't a combobox.
  80. HWND m_hwndListBox;
  81. HWND m_hwndDisplayButton;
  82. HWND m_hwndListTopicsButton;
  83. HWND m_hwndStaticKeyword;
  84. HWND m_hwndStaticTopic;
  85. CFTSListView *m_plistview; // class to manage the list view control
  86. int m_padding;
  87. int m_NavTabPos; // location of parent tabs
  88. // The window passed into create is not the actual parent window of the
  89. // controls. Instead, the controls are always parented to the Navigation window
  90. // which owns the tabs. For resizing, we need to have a pointer to the
  91. // tabctrl window. So, we save this pointer here.
  92. HWND m_hwndResizeToParent ;
  93. // Array of dlgitems
  94. CDlgItemInfo m_aDlgItems[c_NumDlgItems] ;
  95. };
  96. #endif // __CSEARCH_H__