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.

134 lines
4.8 KiB

  1. #ifndef __dsqueryp_h
  2. #define __dsqueryp_h
  3. #define IID_IDsQueryHandler CLSID_DsQuery
  4. DEFINE_GUID(IID_IDsQueryColumnHandler, 0xc072999e, 0xfa49, 0x11d1, 0xa0, 0xaf, 0x00, 0xc0, 0x4f, 0xa3, 0x1a, 0x86);
  5. #ifndef GUID_DEFS_ONLY
  6. #define DSQPF_RETURNALLRESULTS 0x80000000 // = 1 => return all results on OK, not just selection
  7. #define DSQPM_GCL_FORPROPERTYWELL 0x8000 // == 1 => for property well
  8. //-----------------------------------------------------------------------------
  9. // Internal form helper functions
  10. //-----------------------------------------------------------------------------
  11. // filter types
  12. #define FILTER_FIRST 0x0100
  13. #define FILTER_LAST 0x0200
  14. #define FILTER_CONTAINS 0x0100
  15. #define FILTER_NOTCONTAINS 0x0101
  16. #define FILTER_STARTSWITH 0x0102
  17. #define FILTER_ENDSWITH 0x0103
  18. #define FILTER_IS 0x0104
  19. #define FILTER_ISNOT 0x0105
  20. #define FILTER_GREATEREQUAL 0x0106
  21. #define FILTER_LESSEQUAL 0x0107
  22. #define FILTER_DEFINED 0x0108
  23. #define FILTER_UNDEFINED 0x0109
  24. #define FILTER_ISTRUE 0x010A
  25. #define FILTER_ISFALSE 0x010B
  26. // structures
  27. typedef struct
  28. {
  29. INT fmt;
  30. INT cx;
  31. UINT idsName;
  32. LONG iPropertyIndex;
  33. LPWSTR pPropertyName;
  34. } COLUMNINFO, * LPCOLUMNINFO;
  35. typedef struct
  36. {
  37. UINT nIDDlgItem;
  38. LPWSTR pPropertyName;
  39. INT iFilter;
  40. } PAGECTRL, * LPPAGECTRL;
  41. // form APIs - private
  42. STDAPI ClassListAlloc(LPDSQUERYCLASSLIST* ppDsQueryClassList, LPWSTR* aClassNames, INT cClassNames);
  43. STDAPI QueryParamsAlloc(LPDSQUERYPARAMS* ppDsQueryParams, LPWSTR pQuery, HINSTANCE hInstance, LONG iColumns, LPCOLUMNINFO aColumnInfo);
  44. STDAPI QueryParamsAddQueryString(LPDSQUERYPARAMS* ppDsQueryParams, LPWSTR pQuery);
  45. STDAPI GetFilterString(LPWSTR pFilter, UINT* pLen, INT iFilter, LPWSTR pProperty, LPWSTR pValue);
  46. STDAPI GetQueryString(LPWSTR* ppQuery, LPWSTR pPrefixQuery, HWND hDlg, LPPAGECTRL aCtrls, INT iCtrls);
  47. STDAPI GetPatternString(LPTSTR pFilter, UINT* pLen, INT iFilter, LPTSTR pValue);
  48. STDAPI_(VOID) ResetPageControls(HWND hDlg, LPPAGECTRL aCtrl, INT iCtrls);
  49. STDAPI_(VOID) EnablePageControls(HWND hDlg, LPPAGECTRL aCtrl, INT iCtrls, BOOL fEnable);
  50. STDAPI PersistQuery(IPersistQuery* pPersistQuery, BOOL fRead, LPCTSTR pSection, HWND hDlg, LPPAGECTRL aCtrl, INT iCtrls);
  51. STDAPI SetDlgItemFromProperty(IPropertyBag* ppb, LPCWSTR pszProperty, HWND hwnd, INT id, LPCWSTR pszDefault);
  52. //---------------------------------------------------------------------------//
  53. //
  54. // IDsQueryColumnHandler
  55. // =====================
  56. // This interface is used by the query result view to allow the form to replace
  57. // the contents of the form columns.
  58. //
  59. // If the property name is property,{CLSID}, we CoCreateInstance the GUID
  60. // asking for the IDsQueryColumnHandler which we then call for each
  61. // string property we are going to place into the result view.
  62. //
  63. // The handler only gets called when the results are being unpacked from
  64. // the server, subsequent filtering, sort etc of the view doesn't
  65. // invole this handler.
  66. //
  67. // However perf should be considered when implementing this object.
  68. //
  69. //---------------------------------------------------------------------------//
  70. #undef INTERFACE
  71. #define INTERFACE IDsQueryColumnHandler
  72. DECLARE_INTERFACE_(IDsQueryColumnHandler, IUnknown)
  73. {
  74. // *** IUnknown methods ***
  75. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  76. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  77. STDMETHOD_(ULONG,Release) (THIS) PURE;
  78. // **** IDsQueryColumnHandler ****
  79. STDMETHOD(Initialize)(THIS_ DWORD dwFlags, LPCWSTR pszServer, LPCWSTR pszUserName, LPCWSTR pszPassword) PURE;
  80. STDMETHOD(GetText)(THIS_ ADS_SEARCH_COLUMN* psc, LPWSTR pszBuffer, INT cchBuffer) PURE;
  81. };
  82. //---------------------------------------------------------------------------//
  83. //---------------------------------------------------------------------------//
  84. //
  85. // IDsQuery
  86. // ========
  87. //
  88. //---------------------------------------------------------------------------//
  89. #undef INTERFACE
  90. #define INTERFACE IDsQueryHandler
  91. //
  92. // flags passed to IDsQueryHandler::UpdateView
  93. //
  94. #define DSQRVF_REQUERY 0x00000000
  95. #define DSQRVF_ITEMSDELETED 0x00000001 // pdon -> array of items to remove from the view
  96. #define DSQRVF_OPMASK 0x00000fff
  97. DECLARE_INTERFACE_(IDsQueryHandler, IUnknown)
  98. {
  99. // *** IUnknown methods ***
  100. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  101. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  102. STDMETHOD_(ULONG,Release) (THIS) PURE;
  103. // **** IDsQuery ****
  104. STDMETHOD(UpdateView)(THIS_ DWORD dwType, LPDSOBJECTNAMES pdon) PURE;
  105. };
  106. //---------------------------------------------------------------------------//
  107. #endif // GUID_DEFS_ONLY
  108. #endif