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.

157 lines
4.4 KiB

  1. /************************************************************************
  2. * @doc SHROOM EXTERNAL API
  3. *
  4. * TITLE: QUERYIMP.H
  5. *
  6. * DESCRIPTION:
  7. * Definition of CITQuery
  8. * Autodoc headers added by Anita Legsdin 8/6/97
  9. *
  10. *********************************************************************/
  11. // QUERYIMP.H: Definition of CITQuery
  12. #ifndef __QUERYIMP_H__
  13. #define __QUERYIMP_H__
  14. #include "verinfo.h"
  15. // Implemenation of IITQuery
  16. class CITQuery:
  17. public IITQuery,
  18. public CComObjectRootEx<CComMultiThreadModel>,
  19. public CComCoClass<CITQuery, &CLSID_IITQuery>
  20. {
  21. BEGIN_COM_MAP(CITQuery)
  22. COM_INTERFACE_ENTRY(IITQuery)
  23. END_COM_MAP()
  24. DECLARE_REGISTRY(CLSID_IITQuery, "ITIR.Query.4",
  25. "ITIR.Query", 0, THREADFLAGS_BOTH)
  26. public:
  27. CITQuery();
  28. ~CITQuery();
  29. // IITQuery methods
  30. public:
  31. STDMETHOD(SetResultCallback)(FCALLBACK_MSG *pfcbkmsg);
  32. STDMETHOD(SetCommand)(LPCWSTR lpszCommand);
  33. STDMETHOD(SetOptions)(DWORD dwFlags);
  34. STDMETHOD(SetProximity)(WORD wNear);
  35. STDMETHOD(SetGroup)(IITGroup* pITGroup);
  36. STDMETHOD(SetResultCount)(LONG cRows);
  37. /*****************************************************************
  38. * @method STDMETHOD | IITQuery | GetResultCallback |
  39. * Retrieves callback structure containing ERR_FUNC MessageFunc member
  40. * that is called during query processing.
  41. *
  42. * @parm FCALLBACK_MSG | *pfcbkmsg | Pointer to callback structure.
  43. *
  44. * @rvalue E_POINTER | The argument *pfcbkmsg is NULL.
  45. *
  46. * @xref <om .SetResultCallback>
  47. ****************************************************************/
  48. STDMETHOD(GetResultCallback)(FCALLBACK_MSG *pfcbkmsg)
  49. {
  50. if (pfcbkmsg == NULL)
  51. return (E_POINTER);
  52. *pfcbkmsg = m_fcbkmsg;
  53. return (S_OK);
  54. }
  55. /*****************************************************************
  56. * @method STDMETHOD | IITQuery | GetCommand |
  57. * Gets full-text query used by Search method.
  58. *
  59. * @parm LPCWSTR& | lpszCommand | Full-text query command.
  60. *
  61. * @xref <om.SetCommand>
  62. *
  63. ****************************************************************/
  64. STDMETHOD(GetCommand)(LPCWSTR& lpszCommand) { lpszCommand = GetCommand(); return S_OK; }
  65. /*****************************************************************
  66. * @method STDMETHOD | IITQuery | GetOptions |
  67. * Gets search options.
  68. *
  69. * @parm DWORD& | dwFlags | Search options. See <om .SetCommand> for
  70. * a list of values.
  71. *
  72. * @xref <om .setoptions>
  73. ****************************************************************/
  74. STDMETHOD(GetOptions)(DWORD& dwFlags) { dwFlags = GetOptions(); return S_OK; }
  75. /*****************************************************************
  76. * @method STDMETHOD | IITQuery | GetProximity |
  77. * Gets proximity value for searching with NEAR operator.
  78. *
  79. * @parm WORD& | wNear | The number of words apart the search terms can be to be
  80. * considered "near". Default value is 8.
  81. *
  82. * @xref <om.SetProximity>
  83. *
  84. ****************************************************************/
  85. STDMETHOD(GetProximity)(WORD& wNear) { wNear = GetProximity(); return S_OK; }
  86. /*****************************************************************
  87. * @method STDMETHOD | IITQuery | GetGroup |
  88. * Gets the group object used in filtering search results.
  89. *
  90. * @parm IITGroup** | ppiitGroup | Pointer to group object.
  91. *
  92. * @rvalue E_POINTER | The argument ppitGroup is NULL.
  93. *
  94. * @xref <om .SetGroup>
  95. *
  96. ****************************************************************/
  97. STDMETHOD(GetGroup)(IITGroup** ppiitGroup)
  98. {
  99. if (NULL==ppiitGroup)
  100. return (E_POINTER);
  101. *ppiitGroup = GetGroup();
  102. return S_OK;
  103. }
  104. /*****************************************************************
  105. * @method STDMETHOD | IITQuery | GetResultCount |
  106. * Gets maximum number of search hits to return.
  107. *
  108. * @parm LONG& | cRows | Maximum number of hits.
  109. *
  110. * @rvalue E_POINTER | The argument ppitGroup is NULL.
  111. *
  112. * @xref <om .SetResultCount>
  113. *
  114. ****************************************************************/
  115. STDMETHOD(GetResultCount)(LONG& cRows) { cRows = GetResultCount(); return S_OK; }
  116. STDMETHOD(ReInit)();
  117. // Access functions
  118. public:
  119. LPCWSTR GetCommand() { return m_lpszCommand; }
  120. DWORD GetOptions() { return m_dwFlags; }
  121. WORD GetProximity() { return m_wNear; }
  122. DWORD GetResultCount() { return (DWORD) m_cRows; }
  123. IITGroup* GetGroup() { return m_pITGroup; }
  124. // Private methods and data
  125. private:
  126. LONG m_cRows;
  127. DWORD m_dwFlags;
  128. LPCWSTR m_lpszCommand;
  129. WORD m_wNear;
  130. IITGroup* m_pITGroup;
  131. LPVOID m_pCommand;
  132. FCALLBACK_MSG m_fcbkmsg;
  133. };
  134. #endif