Leaked source code of windows server 2003
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.

360 lines
7.0 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996 - 1997.
  5. //
  6. // File: find.hxx
  7. //
  8. // Contents: Definitions of classes for the find event record feature.
  9. //
  10. // Classes: CFindInfo
  11. // CFindDlg
  12. //
  13. // History: 3-19-1997 DavidMun Created
  14. //
  15. //---------------------------------------------------------------------------
  16. #ifndef __FIND_HXX_
  17. #define __FIND_HXX_
  18. class CFindInfo;
  19. //===========================================================================
  20. //
  21. // CFindDlg class
  22. //
  23. //===========================================================================
  24. //+--------------------------------------------------------------------------
  25. //
  26. // Class: CFindDlg
  27. //
  28. // Purpose: Support a dialog specifying criteria for searching for a
  29. // record.
  30. //
  31. // History: 3-19-1997 DavidMun Created
  32. //
  33. //---------------------------------------------------------------------------
  34. class CFindDlg: public CDlg
  35. {
  36. public:
  37. CFindDlg();
  38. VOID
  39. SetParent(
  40. CFindInfo *pfi);
  41. ~CFindDlg();
  42. HRESULT
  43. DoModelessDlg(
  44. CSnapin *pSnapin);
  45. HWND
  46. GetDlgWindow();
  47. protected:
  48. //
  49. // CDlg overrides
  50. //
  51. virtual VOID
  52. _OnHelp(
  53. UINT message,
  54. WPARAM wParam,
  55. LPARAM lParam);
  56. virtual HRESULT
  57. _OnInit(
  58. BOOL *pfSetFocus);
  59. virtual BOOL
  60. _OnCommand(
  61. WPARAM wParam,
  62. LPARAM lParam);
  63. virtual VOID
  64. _OnDestroy();
  65. //
  66. // non-override members
  67. //
  68. VOID
  69. _OnClear();
  70. VOID
  71. _OnNext();
  72. private:
  73. static DWORD WINAPI
  74. _ThreadFunc(
  75. LPVOID pvThis);
  76. BOOL _fNonDescDirty;
  77. BOOL _fDescDirty;
  78. CFindInfo *_pfi; // back pointer to parent
  79. IStream *_pstm; // unmarshal to get _prpa
  80. IResultPrshtActions *_prpa;
  81. };
  82. //+--------------------------------------------------------------------------
  83. //
  84. // Member: CFindDlg::SetParent
  85. //
  86. // Synopsis: Set backpointer to parent (containing) object
  87. //
  88. // History: 4-22-1997 DavidMun Created
  89. //
  90. //---------------------------------------------------------------------------
  91. inline VOID
  92. CFindDlg::SetParent(
  93. CFindInfo *pfi)
  94. {
  95. ASSERT(pfi);
  96. _pfi = pfi;
  97. }
  98. //+--------------------------------------------------------------------------
  99. //
  100. // Member: CFindDlg::GetDlgWindow
  101. //
  102. // Synopsis: Return dialog window, or if none is open, NULL.
  103. //
  104. // History: 4-22-1997 DavidMun Created
  105. //
  106. //---------------------------------------------------------------------------
  107. inline HWND
  108. CFindDlg::GetDlgWindow()
  109. {
  110. return _hwnd;
  111. }
  112. //===========================================================================
  113. //
  114. // CFindInfo class
  115. //
  116. //===========================================================================
  117. //+--------------------------------------------------------------------------
  118. //
  119. // Class: CFindInfo
  120. //
  121. // Purpose: Encapsulate information associated with a find dialog for
  122. // a cloginfo/csnapin pair.
  123. //
  124. // History: 3-19-1997 DavidMun Created
  125. //
  126. //---------------------------------------------------------------------------
  127. class CFindInfo:
  128. public CFindFilterBase,
  129. public CDLink
  130. {
  131. public:
  132. CFindInfo(
  133. CSnapin *pSnapin,
  134. CLogInfo *pli);
  135. virtual
  136. ~CFindInfo();
  137. virtual BOOL
  138. Passes(
  139. CFFProvider *pFFP);
  140. VOID
  141. Reset();
  142. HWND
  143. GetDlgWindow();
  144. CLogInfo *
  145. GetLogInfo();
  146. DIRECTION
  147. GetDirection();
  148. VOID
  149. SetDirection(
  150. DIRECTION FindDirection);
  151. LPCWSTR
  152. GetDescription();
  153. HRESULT
  154. OnFind();
  155. VOID
  156. SetDescription(
  157. LPWSTR pwszDescription);
  158. VOID
  159. Shutdown();
  160. #if (DBG == 1)
  161. VOID
  162. Dump();
  163. #endif // (DBG == 1)
  164. //
  165. // CDLink overrides
  166. //
  167. CFindInfo *
  168. Next();
  169. private:
  170. CSnapin *_pSnapin; // backpointer to parent snapin
  171. CLogInfo *_pli; // log to perform find on
  172. CFindDlg _FindDlg; // manages modeless find dialog
  173. LPWSTR _pwszDescription;
  174. DIRECTION _FindDirection;
  175. };
  176. //+--------------------------------------------------------------------------
  177. //
  178. // Member: CFindInfo::GetDescription
  179. //
  180. // Synopsis: Access function for description
  181. //
  182. // History: 3-24-1997 DavidMun Created
  183. //
  184. //---------------------------------------------------------------------------
  185. inline LPCWSTR
  186. CFindInfo::GetDescription()
  187. {
  188. return _pwszDescription;
  189. }
  190. //+--------------------------------------------------------------------------
  191. //
  192. // Member: CFindInfo::GetDirection
  193. //
  194. // Synopsis: Access function for search direction
  195. //
  196. // History: 3-24-1997 DavidMun Created
  197. //
  198. //---------------------------------------------------------------------------
  199. inline DIRECTION
  200. CFindInfo::GetDirection()
  201. {
  202. return _FindDirection;
  203. }
  204. //+--------------------------------------------------------------------------
  205. //
  206. // Member: CFindInfo::GetDlgWindow
  207. //
  208. // Synopsis: Access func for dialog hwnd
  209. //
  210. // History: 3-21-1997 DavidMun Created
  211. //
  212. //---------------------------------------------------------------------------
  213. inline HWND
  214. CFindInfo::GetDlgWindow()
  215. {
  216. return _FindDlg.GetDlgWindow();
  217. }
  218. //+--------------------------------------------------------------------------
  219. //
  220. // Member: CFindInfo::GetLogInfo
  221. //
  222. // Synopsis: Access func for log info to which this applies
  223. //
  224. // History: 3-24-1997 DavidMun Created
  225. //
  226. //---------------------------------------------------------------------------
  227. inline CLogInfo *
  228. CFindInfo::GetLogInfo()
  229. {
  230. return _pli;
  231. }
  232. //+--------------------------------------------------------------------------
  233. //
  234. // Member: CFindInfo::SetDirection
  235. //
  236. // Synopsis: Access func for direction
  237. //
  238. // History: 3-25-1997 DavidMun Created
  239. //
  240. //---------------------------------------------------------------------------
  241. inline VOID
  242. CFindInfo::SetDirection(
  243. DIRECTION FindDirection)
  244. {
  245. if (FindDirection == FORWARD)
  246. {
  247. _FindDirection = FindDirection;
  248. }
  249. else
  250. {
  251. _FindDirection = BACKWARD;
  252. }
  253. }
  254. //+--------------------------------------------------------------------------
  255. //
  256. // Member: CFindInfo::Next
  257. //
  258. // Synopsis: CDLink override to save typing.
  259. //
  260. // History: 3-21-1997 DavidMun Created
  261. //
  262. //---------------------------------------------------------------------------
  263. inline CFindInfo *
  264. CFindInfo::Next()
  265. {
  266. return (CFindInfo *)CDLink::Next();
  267. }
  268. #endif // __FIND_HXX_