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.

289 lines
13 KiB

  1. ///////////////////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // mindex.h
  4. //
  5. // Declares the interface to the Media Content Index
  6. //
  7. // Copyright (c) Microsoft Corporation 1999
  8. //
  9. //
  10. ///////////////////////////////////////////////////////////////////////////////////////////////////////////
  11. #ifndef _MINDEX_HEADER_
  12. #define _MINDEX_HEADER_
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. // Media Index class identifier
  17. // {4B1CFD76-28C6-11d3-A1FF-00C04FA3B60C}
  18. DEFINE_GUID(CLSID_MediaIndex,
  19. 0x4b1cfd76, 0x28c6, 0x11d3, 0xa1, 0xff, 0x0, 0xc0, 0x4f, 0xa3, 0xb6, 0xc);
  20. // Media Index "Multimedia" class ID
  21. // {4C58C22D-4440-11d3-A208-00C04FA3B60C}
  22. DEFINE_GUID(CLSID_MediaIndexMusicActivity,
  23. 0x4c58c22d, 0x4440, 0x11d3, 0xa2, 0x8, 0x0, 0xc0, 0x4f, 0xa3, 0xb6, 0xc);
  24. typedef struct IMediaIndexManager *LPMEDIAINDEXMANAGER;
  25. typedef struct IMediaIndexScheme *LPMEDIAINDEXSCHEME;
  26. typedef struct IMediaIndexSchemeDebug *LPMEDIAINDEXSCHEMEDEBUG;
  27. typedef struct IMediaIndexRoot *LPMEDIAINDEXROOT;
  28. typedef struct IMediaIndexObject *LPMEDIAINDEXOBJECT;
  29. typedef struct IMediaIndexNotificationSink *LPMEDIAINDEXNOTIFICATIONSINK;
  30. typedef struct IMediaIndexMusicActivityRoot *LPMEDIAINDEXMUSICACTIVITYROOT;
  31. //property types
  32. #define PROPERTY_TYPE_NUMERIC 0
  33. #define PROPERTY_TYPE_TEXT 1
  34. #define PROPERTY_TYPE_DATE 2
  35. #define PROPERTY_TYPE_URL 3
  36. #define PROPERTY_TYPE_BINARY 4
  37. #define PROPERTY_TYPE_UNICODE_TEXT 5
  38. #define PROPERTY_TYPE_FILEPATH 6
  39. //object change notification types
  40. #define CHANGE_TYPE_ADDED 0
  41. #define CHANGE_TYPE_REMOVED 1
  42. #define CHANGE_TYPE_RELATIONSHIP 2
  43. #define CHANGE_TYPE_PROPERTY 3
  44. typedef struct _MEDIAINDEXOBJECTDESCRIPTION
  45. {
  46. const CLSID* Clsid; //Class id of a database object
  47. wchar_t wszDesc[255]; //Its description
  48. } MEDIAINDEXOBJECTDESCRIPTION, *LPMEDIAINDEXOBJECTDESCRIPTION;
  49. typedef struct _MEDIAINDEX_PROPERTYDESCRIPTION
  50. {
  51. const CLSID* Clsid; //Class id of a database property
  52. DWORD dwPropNumber; //Known ID of property
  53. DWORD dwDataType; //Data type (int, text, binary, etc.)
  54. wchar_t wszDesc[255]; //Its description
  55. } MEDIAINDEXPROPERTYDESCRIPTION, *LPMEDIAINDEXPROPERTYDESCRIPTION;
  56. //
  57. // IMediaIndexManager
  58. //
  59. // {5BC8AEBF-28C6-11d3-A1FF-00C04FA3B60C}
  60. DEFINE_GUID(IID_IMediaIndexManager,
  61. 0x5bc8aebf, 0x28c6, 0x11d3, 0xa1, 0xff, 0x0, 0xc0, 0x4f, 0xa3, 0xb6, 0xc);
  62. #undef INTERFACE
  63. #define INTERFACE IMediaIndexManager
  64. DECLARE_INTERFACE_(IMediaIndexManager, IUnknown)
  65. {
  66. // IUnknown methods
  67. STDMETHOD(QueryInterface) (THIS_ REFIID iid, LPVOID *ppvInterface) PURE;
  68. STDMETHOD_(DWORD, AddRef) (THIS) PURE;
  69. STDMETHOD_(DWORD, Release) (THIS) PURE;
  70. // IMediaIndexManager methods
  71. STDMETHOD(OpenScheme) (THIS_ LPCWSTR wszName, LPMEDIAINDEXNOTIFICATIONSINK pSink, LPMEDIAINDEXSCHEME* ppScheme) PURE;
  72. STDMETHOD(RegisterSchemeFromXMLObject) (THIS_ LPCWSTR wszName, IXMLDOMDocument* pXMLDoc) PURE;
  73. STDMETHOD(RegisterSchemeFromXMLScript) (THIS_ LPCWSTR wszName, LPCWSTR wszXMLScript) PURE;
  74. STDMETHOD(BeginSchemeEnumeration) (THIS) PURE;
  75. STDMETHOD(EnumerateScheme) (THIS_ LPWSTR wszName, DWORD cchName) PURE;
  76. STDMETHOD(EndSchemeEnumeration) (THIS) PURE;
  77. };
  78. //
  79. // IMediaIndexScheme
  80. //
  81. // {6292C109-28C6-11d3-A1FF-00C04FA3B60C}
  82. DEFINE_GUID(IID_IMediaIndexScheme,
  83. 0x6292c109, 0x28c6, 0x11d3, 0xa1, 0xff, 0x0, 0xc0, 0x4f, 0xa3, 0xb6, 0xc);
  84. #undef INTERFACE
  85. #define INTERFACE IMediaIndexScheme
  86. DECLARE_INTERFACE_(IMediaIndexScheme, IUnknown)
  87. {
  88. // IUnknown methods
  89. STDMETHOD(QueryInterface) (THIS_ REFIID iid, LPVOID *ppvInterface) PURE;
  90. STDMETHOD_(DWORD, AddRef) (THIS) PURE;
  91. STDMETHOD_(DWORD, Release) (THIS) PURE;
  92. STDMETHOD(GetSchemeInfo) (THIS_ LPWSTR wszSchemeName, IXMLDOMDocument** ppXMLDoc) PURE;
  93. STDMETHOD(OpenIndex) (THIS) PURE;
  94. STDMETHOD(CloseIndex) (THIS) PURE;
  95. STDMETHOD(BeginUserEnumeration) (THIS) PURE;
  96. STDMETHOD(EnumerateUser) (THIS_ LPWSTR wszUserName) PURE;
  97. STDMETHOD(EndUserEnumeration) (THIS) PURE;
  98. STDMETHOD(SetCurrentUser) (THIS_ LPCWSTR wszUserName) PURE;
  99. STDMETHOD(BeginTransaction) (THIS) PURE;
  100. STDMETHOD(EndTransaction) (THIS_ BOOL fCommit) PURE;
  101. STDMETHOD(GetRoot) (THIS_ LPMEDIAINDEXROOT* ppObject) PURE;
  102. };
  103. //
  104. // IMediaIndexSchemeDebug (Can QI from IMediaIndexScheme when running a debug build)
  105. //
  106. // {6B88573D-28C6-11d3-A1FF-00C04FA3B60C}
  107. DEFINE_GUID(IID_IMediaIndexSchemeDebug,
  108. 0x6b88573d, 0x28c6, 0x11d3, 0xa1, 0xff, 0x0, 0xc0, 0x4f, 0xa3, 0xb6, 0xc);
  109. #undef INTERFACE
  110. #define INTERFACE IMediaIndexSchemeDebug
  111. DECLARE_INTERFACE_(IMediaIndexSchemeDebug, IUnknown)
  112. {
  113. // IUnknown methods
  114. STDMETHOD(QueryInterface) (THIS_ REFIID iid, LPVOID *ppvInterface) PURE;
  115. STDMETHOD_(DWORD, AddRef) (THIS) PURE;
  116. STDMETHOD_(DWORD, Release) (THIS) PURE;
  117. // IMediaIndexSchemeDebug methods
  118. STDMETHOD(DumpIndexToFile) (THIS_ LPCWSTR wszFilename) PURE;
  119. };
  120. //
  121. // IMediaIndexRoot
  122. //
  123. // {7C82B623-28C6-11d3-A1FF-00C04FA3B60C}
  124. DEFINE_GUID(IID_IMediaIndexRoot,
  125. 0x7c82b623, 0x28c6, 0x11d3, 0xa1, 0xff, 0x0, 0xc0, 0x4f, 0xa3, 0xb6, 0xc);
  126. #undef INTERFACE
  127. #define INTERFACE IMediaIndexRoot
  128. DECLARE_INTERFACE_(IMediaIndexRoot, IUnknown)
  129. {
  130. // IUnknown methods
  131. STDMETHOD(QueryInterface) (THIS_ REFIID iid, LPVOID *ppvInterface) PURE;
  132. STDMETHOD_(DWORD, AddRef) (THIS) PURE;
  133. STDMETHOD_(DWORD, Release) (THIS) PURE;
  134. //IMediaIndexRoot methods
  135. STDMETHOD(BeginObjectEnumeration) (THIS_ LPCGUID pguidObjectType,
  136. DWORD dwStartingIndex,
  137. BOOL fRestrictToCurrentUser,
  138. LPCGUID pguidPropertySetID,
  139. DWORD dwPropertyID,
  140. void* pPropertyFilterValue,
  141. BOOL fThreaded,
  142. LPDWORD dwThreadID,
  143. LPDWORD pdwCount) PURE;
  144. STDMETHOD(EnumerateObjects) (THIS_ REFGUID guidObjectType, LPVOID *ppvInterface) PURE;
  145. STDMETHOD(EndObjectEnumeration) (THIS) PURE;
  146. STDMETHOD(Search) (THIS) PURE;
  147. STDMETHOD(CreateObject) (THIS_ REFGUID guidObjectType, LPMEDIAINDEXOBJECT* ppObject) PURE;
  148. STDMETHOD(FetchObject) (THIS_ REFGUID guidObjectType, DWORD dwInstanceID, LPMEDIAINDEXOBJECT* ppObject) PURE;
  149. STDMETHOD(FetchObjectByNumericProperty) (THIS_ REFGUID guidObjectType, REFGUID guidPropertySetID, DWORD dwPropertyID, DWORD dwValue, LPMEDIAINDEXOBJECT* ppObject) PURE;
  150. STDMETHOD(FetchObjectByTextProperty) (THIS_ REFGUID guidObjectType, REFGUID guidPropertySetID, DWORD dwPropertyID, LPCWSTR szSearch, LPMEDIAINDEXOBJECT* ppObject) PURE;
  151. STDMETHOD(RemoveObject) (THIS_ LPMEDIAINDEXOBJECT pObject) PURE;
  152. };
  153. //
  154. // IMediaIndexObject
  155. //
  156. // {7666AF83-28C6-11d3-A1FF-00C04FA3B60C}
  157. DEFINE_GUID(IID_IMediaIndexObject,
  158. 0x7666af83, 0x28c6, 0x11d3, 0xa1, 0xff, 0x0, 0xc0, 0x4f, 0xa3, 0xb6, 0xc);
  159. #undef INTERFACE
  160. #define INTERFACE IMediaIndexObject
  161. DECLARE_INTERFACE_(IMediaIndexObject, IUnknown)
  162. {
  163. // IUnknown methods
  164. STDMETHOD(QueryInterface) (THIS_ REFIID iid, LPVOID *ppvInterface) PURE;
  165. STDMETHOD_(DWORD, AddRef) (THIS) PURE;
  166. STDMETHOD_(DWORD, Release) (THIS) PURE;
  167. //IMediaIndexObject methods
  168. STDMETHOD(GetObjectInfo) (THIS_ REFGUID guidObjectType, LPDWORD pdwInstanceID) PURE;
  169. STDMETHOD(BeginConnectionEnumeration) (THIS_ BOOL fChildren,
  170. DWORD dwStartingIndex,
  171. LPCGUID pguidObjectType,
  172. BOOL fRestrictToCurrentUser,
  173. LPCGUID pguidPropertySetID,
  174. DWORD dwPropertyID,
  175. void* pPropertyFilterValue,
  176. BOOL fThreaded,
  177. LPDWORD dwThreadID,
  178. LPDWORD pdwCount) PURE;
  179. STDMETHOD(EnumerateConnection) (THIS_ REFGUID guidObjectType, LPVOID *ppvInterface) PURE;
  180. STDMETHOD(EndConnectionEnumeration) (THIS) PURE;
  181. STDMETHOD(AddChild) (THIS_ LPMEDIAINDEXOBJECT pAddObject, LPMEDIAINDEXOBJECT pNextObject) PURE;
  182. STDMETHOD(RemoveChild) (THIS_ LPMEDIAINDEXOBJECT pObject) PURE;
  183. STDMETHOD(GetProperty) (THIS_ REFGUID guidPropertySetID, DWORD dwPropertyID, LPWSTR wszPropertyName, LPDWORD pdwDataType, LPVOID pvDataBuffer, DWORD dwBufferSize, LPDWORD pdwRequiredSize) PURE;
  184. STDMETHOD(SetProperty) (THIS_ REFGUID guidPropertySetID, DWORD dwPropertyID, LPCWSTR wszPropertyName, DWORD dwDataType, LPCVOID pvBuffer, DWORD dwBufferSize) PURE;
  185. STDMETHOD(BeginPropertyEnumeration) (THIS_ LPCGUID pguidPropertySetID, LPDWORD pdwCount) PURE;
  186. STDMETHOD(EnumerateProperty) (THIS_ REFGUID guidPropertySetID, LPDWORD pdwPropertyID, LPWSTR wszPropertyName, LPDWORD pdwDataType, LPVOID pvDataBuffer, DWORD dwBufferSize, LPDWORD pdwRequiredSize) PURE;
  187. STDMETHOD(EndPropertyEnumeration) (THIS) PURE;
  188. STDMETHOD_(BOOL, IsParentOf) (THIS_ LPMEDIAINDEXOBJECT pObject) PURE;
  189. STDMETHOD_(BOOL, IsChildOf) (THIS_ LPMEDIAINDEXOBJECT pObject) PURE;
  190. };
  191. //
  192. // IMediaIndexNotificationSink
  193. //
  194. // {892D3443-28C6-11d3-A1FF-00C04FA3B60C}
  195. DEFINE_GUID(IID_IMediaIndexNotificationSink,
  196. 0x892d3443, 0x28c6, 0x11d3, 0xa1, 0xff, 0x0, 0xc0, 0x4f, 0xa3, 0xb6, 0xc);
  197. #undef INTERFACE
  198. #define INTERFACE IMediaIndexNotificationSink
  199. DECLARE_INTERFACE_(IMediaIndexNotificationSink, IUnknown)
  200. {
  201. // IUnknown methods
  202. STDMETHOD(QueryInterface) (THIS_ REFIID iid, LPVOID *ppvInterface) PURE;
  203. STDMETHOD_(DWORD, AddRef) (THIS) PURE;
  204. STDMETHOD_(DWORD, Release) (THIS) PURE;
  205. // IMediaIndexNotificationSink methods
  206. STDMETHOD(ObjectChanged) (THIS_ REFGUID guidObjectType, DWORD dwInstanceID, DWORD dwChangeType, REFGUID guidPropertySetID, DWORD dwPropertyID);
  207. STDMETHOD(EnumerationCallback) (THIS_ LPMEDIAINDEXOBJECT pObject, DWORD dwThreadID, HANDLE hCancelEvent);
  208. };
  209. //
  210. // IMediaIndexMusicActivityRoot
  211. //
  212. // {AD27169C-443F-11d3-A208-00C04FA3B60C}
  213. DEFINE_GUID(IID_IMediaIndexMusicActivityRoot,
  214. 0xAD27169C, 0x443F, 0x11d3, 0xa2, 0x08, 0x0, 0xc0, 0x4f, 0xa3, 0xb6, 0xc);
  215. #undef INTERFACE
  216. #define INTERFACE IMediaIndexMusicActivityRoot
  217. DECLARE_INTERFACE_(IMediaIndexMusicActivityRoot, IMediaIndexRoot)
  218. {
  219. // IUnknown methods
  220. STDMETHOD(QueryInterface) (THIS_ REFIID iid, LPVOID *ppvInterface) PURE;
  221. STDMETHOD_(DWORD, AddRef) (THIS) PURE;
  222. STDMETHOD_(DWORD, Release) (THIS) PURE;
  223. //IMediaIndexRoot methods
  224. STDMETHOD(BeginObjectEnumeration) (THIS_ LPCGUID pguidObjectType,
  225. DWORD dwStartingIndex,
  226. BOOL fRestrictToCurrentUser,
  227. LPCGUID pguidPropertySetID,
  228. DWORD dwPropertyID,
  229. void* pPropertyFilterValue,
  230. BOOL fThreaded,
  231. LPDWORD dwThreadID,
  232. LPDWORD pdwCount) PURE;
  233. STDMETHOD(EnumerateObjects) (THIS_ REFGUID guidObjectType, LPVOID *ppvInterface) PURE;
  234. STDMETHOD(EndObjectEnumeration) (THIS) PURE;
  235. STDMETHOD(Search) (THIS) PURE;
  236. STDMETHOD(CreateObject) (THIS_ REFGUID guidObjectType, LPMEDIAINDEXOBJECT* ppObject) PURE;
  237. STDMETHOD(FetchObject) (THIS_ REFGUID guidObjectType, DWORD dwInstanceID, LPMEDIAINDEXOBJECT* ppObject) PURE;
  238. STDMETHOD(FetchObjectByNumericProperty) (THIS_ REFGUID guidObjectType, REFGUID guidPropertySetID, DWORD dwPropertyID, DWORD dwValue, LPMEDIAINDEXOBJECT* ppObject) PURE;
  239. STDMETHOD(FetchObjectByTextProperty) (THIS_ REFGUID guidObjectType, REFGUID guidPropertySetID, DWORD dwPropertyID, LPCWSTR szSearch, LPMEDIAINDEXOBJECT* ppObject) PURE;
  240. STDMETHOD(RemoveObject) (THIS_ LPMEDIAINDEXOBJECT pObject) PURE;
  241. //IMediaIndexMusicActivityRoot methods
  242. STDMETHOD(OpenIndex) (THIS_ LPMEDIAINDEXNOTIFICATIONSINK pSink) PURE;
  243. STDMETHOD(CloseIndex) (THIS) PURE;
  244. STDMETHOD(GetSchemeInfo) (THIS_ LPWSTR wszSchemeName, IXMLDOMDocument** ppXMLDoc) PURE;
  245. };
  246. #ifdef __cplusplus
  247. };
  248. #endif
  249. #endif //_MINDEX_HEADER_