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.

280 lines
12 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (c) Microsoft Corporation. All rights reserved.
  5. //
  6. //--------------------------------------------------------------------------
  7. import "ocidl.idl";
  8. import "docobj.idl";
  9. #include <olectl.h>
  10. #include "brdispid.h"
  11. //----------------------------------------------------------------------
  12. //+++++ MediaBar binary behavior interfaces:
  13. //----------------------------------------------------------------------
  14. interface IMediaBehavior;
  15. interface IMediaItem;
  16. interface IPlaylistInfo;
  17. // NOTE the mediabar behavior exposes a subset of WMP7 object model
  18. // where appropriate, object, property, method and event
  19. // identifiers are slightly renamed to avoid name collisions
  20. typedef
  21. [
  22. helpstring( "State of opening process" ),
  23. public
  24. ]
  25. enum mbOpenState // wmpos
  26. {
  27. [ helpstring( "Undefined" ) ] mbosUndefined,
  28. [ helpstring( "New Playlist is about to be loaded" ) ] mbosPlaylistChanging,
  29. [ helpstring( "Locating the playlist" ) ] mbosPlaylistLocating,
  30. [ helpstring( "Connecting to the server holding a playlist" ) ] mbosPlaylistConnecting,
  31. [ helpstring( "Loading a playlist" ) ] mbosPlaylistLoading,
  32. [ helpstring( "Opening a playlist" ) ] mbosPlaylistOpening,
  33. [ helpstring( "Playlist is open" ) ] mbosPlaylistOpenNoMedia,
  34. [ helpstring( "Playlist has changed" ) ] mbosPlaylistChanged,
  35. [ helpstring( "New media is about to be loaded" ) ] mbosMediaChanging,
  36. [ helpstring( "Locating the media" ) ] mbosMediaLocating,
  37. [ helpstring( "Connecting to the server holding media" ) ] mbosMediaConnecting,
  38. [ helpstring( "Loading media" ) ] mbosMediaLoading,
  39. [ helpstring( "Opening a media" ) ] mbosMediaOpening,
  40. [ helpstring( "Media is open" ) ] mbosMediaOpen,
  41. [ helpstring( "Starting codec acquisition" ) ] mbosBeginCodecAcquisition,
  42. [ helpstring( "End codec acquisition" ) ] mbosEndCodecAcquisition,
  43. [ helpstring( "Starting license acquisition" ) ] mbosBeginLicenseAcquisition,
  44. [ helpstring( "End license acquisition" ) ] mbosEndLicenseAcquisition,
  45. [ helpstring( "Starting individualization" ) ] mbosBeginIndividualization,
  46. [ helpstring( "End individualization" ) ] mbosEndIndividualization,
  47. [ helpstring( "Waiting for media" ) ] mbosMediaWaiting,
  48. [ helpstring( "Opening an URL whose type is not known" ) ] mbosOpeningUnknownURL,
  49. } mbOpenState;
  50. typedef
  51. [
  52. helpstring( "State of playback" ),
  53. public
  54. ]
  55. enum mbPlayState
  56. {
  57. [ helpstring( "State is undefined" ) ] mbpsUndefined,
  58. [ helpstring( "Playback is stopped" ) ] mbpsStopped,
  59. [ helpstring( "Playback is paused" ) ] mbpsPaused,
  60. [ helpstring( "Stream is playing" ) ] mbpsPlaying,
  61. [ helpstring( "Stream is Scanning forward" ) ] mbpsScanForward,
  62. [ helpstring( "Stream is Scanning in reverse" ) ] mbpsScanReverse,
  63. [ helpstring( "Media is being buffered" ) ] mbpsBuffering,
  64. [ helpstring( "Waiting for streaming data" ) ] mbpsWaiting,
  65. [ helpstring( "End of media reached" ) ] mbpsMediaEnded,
  66. [ helpstring( "Preparing new media" ) ] mbpsTransitioning,
  67. [ helpstring( "Ready to begin playing" ) ] mbpsReady,
  68. } mbPlayState;
  69. [
  70. uuid(BB24BBE0-1EEC-422b-A397-EDBC31FB3A56),
  71. helpstring("IMediaBehavior Interface"),
  72. dual,
  73. pointer_default(unique)
  74. ]
  75. interface IMediaBehavior : IDispatch
  76. {
  77. [id (DISPID_MBBEHAVIOR_PLAYURL), helpstring( "load media from URL and start playing" ) ]
  78. HRESULT playURL(BSTR bstrURL, BSTR bstrMIME);
  79. [id (DISPID_MBBEHAVIOR_STOP), helpstring( "Stops playing current media" ) ]
  80. HRESULT stop();
  81. [id (DISPID_MBBEHAVIOR_PLAYNEXT), helpstring( "Starts playing the next media in playlist (if playlist is present)" ) ]
  82. HRESULT playNext();
  83. [ id(DISPID_MBBEHAVIOR_CURRENTITEM), propget, helpstring( "Returns the current media item" ) ]
  84. HRESULT currentItem( [out, retval] IMediaItem **ppMediaItem);
  85. [ id(DISPID_MBBEHAVIOR_NEXTITEM), propget, helpstring( "Returns the next media item in playlist (if any)" ) ]
  86. HRESULT nextItem( [out, retval] IMediaItem **ppMediaItem);
  87. [ id(DISPID_MBBEHAVIOR_PLAYLISTINFO), propget, helpstring( "Returns the playlist info (if any playlist)" ) ]
  88. HRESULT playlistInfo( [out, retval] IPlaylistInfo **ppPlaylistInfo);
  89. [ id(DISPID_MBBEHAVIOR_HASNEXTITEM), propget, helpstring( "Returns whether playlist has a next item." ) ]
  90. HRESULT hasNextItem( [out, retval] VARIANT_BOOL *pfhasNext );
  91. [ id(DISPID_MBBEHAVIOR_PLAYSTATE), propget, helpstring( "Returns the play state of the player" ) ]
  92. HRESULT playState( [out, retval] mbPlayState *pps );
  93. [ id(DISPID_MBBEHAVIOR_OPENSTATE), propget, helpstring( "Returns the open state of the player" ) ]
  94. HRESULT openState( [out, retval] mbOpenState *pos );
  95. [ id(DISPID_MBBEHAVIOR_ENABLED), propget, helpstring("Returns a boolen value specifying whether or not the control is enabled")]
  96. HRESULT enabled([out, retval] VARIANT_BOOL *pbEnabled);
  97. [ id(DISPID_MBBEHAVIOR_ENABLED), propput, helpstring("Sets a boolean value specifying whether or not the control is enabled")]
  98. HRESULT enabled([in] VARIANT_BOOL bEnable);
  99. [ id(DISPID_MBBEHAVIOR_DISABLEDUI), propget, helpstring("Returns a boolen value specifying whether or not the mediabar UI is disabled")]
  100. HRESULT disabledUI([out, retval] VARIANT_BOOL *pbDisabled);
  101. [ id(DISPID_MBBEHAVIOR_DISABLEDUI), propput, helpstring("Sets a boolean value specifying whether or not the mediabar UI is disabled")]
  102. HRESULT disabledUI([in] VARIANT_BOOL bDisable);
  103. };
  104. [
  105. uuid(BB24BBE1-1EEC-422b-A397-EDBC31FB3A56),
  106. helpstring("IMediaItem Interface"),
  107. dual,
  108. pointer_default(unique)
  109. ]
  110. interface IMediaItem : IDispatch
  111. {
  112. [ id(DISPID_MBMEDIAITEM_SOURCEURL), propget, helpstring( "Returns the media URL" ) ]
  113. HRESULT sourceURL( [out, retval] BSTR *pbstrSourceURL );
  114. [ id(DISPID_MBMEDIAITEM_NAME), propget, helpstring( "Returns the name of the media" ) ]
  115. HRESULT name( [out, retval] BSTR *pbstrName);
  116. [ id(DISPID_MBMEDIAITEM_DURATION), propget, helpstring( "Returns duration of current media" ) ]
  117. HRESULT duration( [out, retval] double * pDuration );
  118. [ id(DISPID_MBMEDIAITEM_ATTRIBUTECOUNT), propget, helpstring( "Returns the count of the attributes associated with this media" ) ]
  119. HRESULT attributeCount( [out, retval] long *plCount );
  120. [ id(DISPID_MBMEDIAITEM_GETATTRIBUTENAME), helpstring( "Returns the name of the attribute whose index has been specified" ) ]
  121. HRESULT getAttributeName( [in] long lIndex, [out, retval] BSTR *pbstrItemName );
  122. [ id(DISPID_MBMEDIAITEM_GETITEMINFO), helpstring( "Returns the value of specified attribute for this media" ) ]
  123. HRESULT getItemInfo( [in] BSTR bstrItemName, [out, retval] BSTR *pbstrVal );
  124. };
  125. [
  126. uuid(BB24BBE2-1EEC-422b-A397-EDBC31FB3A56),
  127. helpstring("IPlaylistInfo Interface"),
  128. dual,
  129. pointer_default(unique)
  130. ]
  131. interface IPlaylistInfo : IDispatch
  132. {
  133. [ id(DISPID_MBPLAYLISTINFO_NAME), propget, helpstring( "Returns the name of the playlist" ) ]
  134. HRESULT name( [out, retval] BSTR *pbstrName);
  135. [ id(DISPID_MBPLAYLISTINFO_ATTRIBUTECOUNT), propget, helpstring( "Returns the count of the attributes associated with this playlist" ) ]
  136. HRESULT attributeCount( [out, retval] long *plCount );
  137. [ id(DISPID_MBPLAYLISTINFO_GETATTRIBUTENAME), helpstring( "Returns the name of the attribute whose index has been specified" ) ]
  138. HRESULT getAttributeName( [in] long lIndex, [out, retval] BSTR *pbstrItemName );
  139. [ id(DISPID_MBPLAYLISTINFO_GETITEMINFO), helpstring( "Returns the value of specified attribute for this media" ) ]
  140. HRESULT getItemInfo( [in] BSTR bstrItemName, [out, retval] BSTR *pbstrVal );
  141. };
  142. // interfaces used to communicate between proxies (custom player in mstime and/or mediabar behavior) and mediabar
  143. enum contentProxyEvent {
  144. OnOpenStateChange,
  145. OnPlayStateChange,
  146. OnShow,
  147. OnHide,
  148. };
  149. [
  150. uuid(EF508010-C806-4356-8492-D15E616F6F37),
  151. helpstring("IMediaHost"),
  152. pointer_default(unique)
  153. ]
  154. interface IMediaHost : IUnknown
  155. {
  156. HRESULT getMediaPlayer(IUnknown **ppPlayer);
  157. HRESULT playURL(BSTR bstrURL, BSTR bstrMIME);
  158. HRESULT addProxy(IUnknown *pProxy);
  159. HRESULT removeProxy(IUnknown *pProxy);
  160. };
  161. [
  162. uuid(EF508011-C806-4356-8492-D15E616F6F37),
  163. helpstring("IContentProxy"),
  164. pointer_default(unique)
  165. ]
  166. interface IContentProxy : IUnknown
  167. {
  168. HRESULT OnCreatedPlayer();
  169. HRESULT fireEvent(enum contentProxyEvent event);
  170. HRESULT detachPlayer();
  171. };
  172. ///////////////////////////////////////////////////////////////////////////////
  173. ///////////////////////////////////////////////////////////////////////////////
  174. //
  175. //
  176. // T Y P E L I B R A R Y
  177. //
  178. //
  179. ///////////////////////////////////////////////////////////////////////////////
  180. ///////////////////////////////////////////////////////////////////////////////
  181. [
  182. uuid(B025F75A-CD86-4D11-A0C8-D7644FDBFB5A),
  183. version(1.0),
  184. lcid(0x0000),
  185. helpstring("Microsoft Browser Helpers")
  186. ]
  187. library BrowseUI
  188. {
  189. importlib("stdole32.tlb");
  190. importlib("stdole2.tlb");
  191. // interface only documents the custom events the media bar behavior will fire
  192. [
  193. uuid(BB24BBEF-1EEC-422b-A397-EDBC31FB3A56),
  194. helpstring("Event interface for MediaBar behavior"),
  195. hidden
  196. ]
  197. dispinterface _mbEvents
  198. {
  199. properties:
  200. methods:
  201. //////////////////////////////////////////////////////////////////////
  202. // Events
  203. //////////////////////////////////////////////////////////////////////
  204. [ id(DISPID_MBBEHAVIOREVENT_ONOPENSTATECHANGE), helpstring( "Sent when the mediabar player changes OpenState" ) ]
  205. void OnOpenStateChange();
  206. [ id(DISPID_MBBEHAVIOREVENT_ONPLAYSTATECHANGE), helpstring( "Sent when the mediabar player changes PlayState" ) ]
  207. void OnPlayStateChange();
  208. [ id(DISPID_MBBEHAVIOREVENT_ONSHOW), helpstring( "Sent when the mediabar player becomes visible" ) ]
  209. void OnShow();
  210. [ id(DISPID_MBBEHAVIOREVENT_ONHIDE), helpstring( "Sent when the mediabar player is hidden" ) ]
  211. void OnHide();
  212. };
  213. //----------------------------------------------------------------------
  214. //+++++ MediaBar binary Behavior objects:
  215. //----------------------------------------------------------------------
  216. [
  217. uuid(BB24BBFF-1EEC-422b-A397-EDBC31FB3A56),
  218. helpstring("Media Behavior Class")
  219. ]
  220. coclass MediaBehavior
  221. {
  222. [default] interface IMediaBehavior;
  223. [default, source] dispinterface _mbEvents;
  224. // communication to and from proxy in content pane to media player
  225. [source] interface IMediaHost;
  226. interface IContentProxy;
  227. };
  228. [
  229. uuid(BB24BBFE-1EEC-422b-A397-EDBC31FB3A56),
  230. helpstring("Media Item Class")
  231. ]
  232. coclass MediaItem
  233. {
  234. [default] interface IMediaItem;
  235. };
  236. [
  237. uuid(BB24BBFD-1EEC-422b-A397-EDBC31FB3A56),
  238. helpstring("Playlist Info Class")
  239. ]
  240. coclass PlaylistInfo
  241. {
  242. [default] interface IPlaylistInfo;
  243. };
  244. };