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.

117 lines
3.1 KiB

  1. /********************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. NetSearchConfig.h
  5. Abstract:
  6. Implements the class CSearchResultList that contains methods for traversing the elements
  7. of XML file that contains the results returned by a search engine. A sample results XML file
  8. if shown here -
  9. <ResultList xmlns="x-schema:ResultListSchema1.xdr">
  10. <ResultItem
  11. Title="What if I've upgraded from Windows 95 to Windows 98?"
  12. URI="http://gsadevnet/support/windows/InProductHelp98/lic_keep_old_copy.asp"
  13. ContentType="7"
  14. Rank="96"
  15. Description="Online version of our in-product help."
  16. DateLastModified="08/04/1999 19:48:10" />
  17. </ResultList>
  18. Revision History:
  19. a-prakac created 10/24/200
  20. ********************************************************************/
  21. #if !defined(__INCLUDED___PCH___SELIB_NETSEARCHCONFIG_H___)
  22. #define __INCLUDED___PCH___SELIB_NETSEARCHCONFIG_H___
  23. #include <SearchEngineLib.h>
  24. #include <MPC_config.h>
  25. class CSearchResultList :
  26. public MPC::Config::TypeConstructor,
  27. public MPC::NamedMutex
  28. {
  29. class CSearchItem :
  30. public MPC::Config::TypeConstructor
  31. {
  32. DECLARE_CONFIG_MAP(CSearchItem);
  33. public:
  34. MPC::wstring m_strSearchItem;
  35. ////////////////////////////////////////
  36. //
  37. // MPC::Config::TypeConstructor
  38. //
  39. DEFINE_CONFIG_DEFAULTTAG();
  40. DECLARE_CONFIG_METHODS();
  41. //
  42. ////////////////////////////////////////
  43. };
  44. class CResultItem :
  45. public MPC::Config::TypeConstructor
  46. {
  47. DECLARE_CONFIG_MAP(CResultItem);
  48. public:
  49. SearchEngine::ResultItem_Data m_data;
  50. ////////////////////////////////////////
  51. //
  52. // MPC::Config::TypeConstructor
  53. //
  54. DEFINE_CONFIG_DEFAULTTAG();
  55. DECLARE_CONFIG_METHODS();
  56. //
  57. ////////////////////////////////////////
  58. };
  59. typedef std::list< CResultItem > ResultList;
  60. typedef ResultList::iterator ResultIter;
  61. typedef ResultList::const_iterator ResultIterConst;
  62. typedef std::list< CSearchItem > SearchList;
  63. typedef SearchList::iterator SearchIter;
  64. typedef SearchList::const_iterator SearchIterConst;
  65. ////////////////////////////////////////
  66. DECLARE_CONFIG_MAP(CSearchResultList);
  67. ResultIter m_itCurrentResult;
  68. ResultList m_lstResult;
  69. SearchList m_lstSearchItem;
  70. CComBSTR m_bstrPrevQuery;
  71. ////////////////////////////////////////
  72. //
  73. // MPC::Config::TypeConstructor
  74. //
  75. DEFINE_CONFIG_DEFAULTTAG();
  76. DECLARE_CONFIG_METHODS ();
  77. //
  78. ////////////////////////////////////////
  79. public:
  80. CSearchResultList ();
  81. ~CSearchResultList();
  82. HRESULT MoveFirst ( );
  83. HRESULT MoveNext ( );
  84. HRESULT ClearResults ( );
  85. bool IsCursorValid ( );
  86. HRESULT SetResultItemIterator ( /*[in]*/long lIndex );
  87. HRESULT LoadResults ( /*[in]*/IStream* pStream );
  88. HRESULT InitializeResultObject ( /*[out]*/SearchEngine::ResultItem* pRIObj );
  89. HRESULT GetSearchTerms ( /*[in, out]*/ MPC::WStringList& strList );
  90. CComBSTR& PrevQuery ();
  91. ////////////////////////////////////////
  92. };
  93. #endif // !defined(__INCLUDED___PCH___SELIB_NETSEARCHCONFIG_H___)