27 #ifndef __SB_REMOTE_PLAYER_H__
28 #define __SB_REMOTE_PLAYER_H__
35 #include <sbIDataRemote.h>
36 #include <sbIDownloadDevice.h>
37 #include <sbIMediaList.h>
38 #include <sbIMediacoreEventListener.h>
39 #include <sbIMediacoreManager.h>
40 #include <sbIRemoteLibrary.h>
41 #include <sbIRemoteObserver.h>
42 #include <sbIRemotePlayer.h>
43 #include <sbISecurityAggregator.h>
45 #include <nsAutoPtr.h>
47 #include <nsDataHashtable.h>
48 #include <nsInterfaceHashtable.h>
49 #include <nsIClassInfo.h>
50 #include <nsIDOMEventListener.h>
51 #include <nsIGenericFactory.h>
52 #include <nsIIOService.h>
53 #include <nsISecurityCheckedComponent.h>
54 #include <nsIWeakReference.h>
55 #include <nsPIDOMWindow.h>
56 #include <nsStringGlue.h>
57 #include <nsWeakReference.h>
59 #define SONGBIRD_REMOTEPLAYER_CONTRACTID \
60 "@songbirdnest.com/remoteapi/remoteplayer;1"
61 #define SONGBIRD_REMOTEPLAYER_CLASSNAME \
62 "Songbird Remote Player"
63 #define SONGBIRD_REMOTEPLAYER_CID \
68 {0xbb, 0x41, 0x8f, 0x2e, 0x5b, 0x12, 0x70, 0x0b} \
78 #ifdef METRICS_ENABLED
87 public nsSupportsWeakReference,
94 NS_DECL_SBIREMOTEPLAYER
97 NS_DECL_NSIDOMEVENTLISTENER
99 NS_DECL_SBISECURITYAGGREGATOR
100 NS_DECL_SBIMEDIACOREEVENTLISTENER
107 static NS_METHOD
Register(nsIComponentManager* aCompMgr,
109 const
char *aLoaderStr,
111 const nsModuleComponentInfo *aInfo);
112 static NS_METHOD
Unregister(nsIComponentManager* aCompMgr,
114 const
char *aLoaderStr,
115 const nsModuleComponentInfo *aInfo);
117 const nsAString &aClass,
118 const nsAString &aType,
122 const nsAString &aClass,
123 const nsAString &aType,
124 const nsAString &aCategoryID,
131 nsAString &aJSScopeName );
136 const nsAString &aTitleKey,
137 const nsAString &aMessageKey,
138 const
char* aScopedName = nsnull );
140 const nsAString& aSiteID );
144 already_AddRefed<nsPIDOMWindow>
GetWindow();
149 virtual ~sbRemotePlayer();
157 nsresult
GetBrowser( nsIDOMElement** aElement );
160 const nsAString& aSiteID );
162 const nsAString& aPropertyID,
163 const nsAString& aDisplayName,
164 const nsAString& aButtonLabel,
167 PRBool aUserViewable,
168 PRUint32 aNullSort );
184 nsCOMPtr<nsIWeakReference>
mMM;
232 #ifdef METRICS_ENABLED
233 nsCOMPtr<sbIMetrics> mMetrics;
242 NS_DECL_SBIDEVICEBASECALLBACK
252 nsCOMPtr<nsIWeakReference> mWeakRemotePlayer;
253 nsCOMPtr<sbIDeviceBase> mDownloadDevice;
254 nsCOMPtr<nsIURI> mCodebaseURI;
255 nsCOMPtr<nsIIOService> mIOService;
258 nsACString& aScopeDomain,
259 nsACString& aScopePath );
263 #endif // __SB_REMOTE_PLAYER_H__
nsresult InitPrivileged(nsIURI *aCodebase, nsIDOMWindow *aWindow)
PRBool mUseDefaultCommands
nsCOMPtr< sbIDataRemote > mdrRepeat
nsresult OnViewChange(sbIMediacoreEvent *aEvent)
static PRBool GetUserApprovalForHost(nsIURI *aURI, const nsAString &aTitleKey, const nsAString &aMessageKey, const char *aScopedName=nsnull)
nsCOMPtr< sbIDataRemote > mdrCurrentAlbum
static already_AddRefed< nsPIDOMWindow > GetWindowFromJS()
nsresult ConfirmPlaybackControl()
nsCOMPtr< sbIDataRemote > mdrMute
virtual ~sbRemotePlayerDownloadCallback()
nsRefPtr< sbRemoteCommands > mCommandsObject
Metrics service interface This is an interface to the songbird metrics service, used to phone home an...
nsCOMPtr< sbIDataRemote > mdrPlaying
nsresult InitInternal(nsPIDOMWindow *aWindow)
This interface is a composition of many of our other interfaces with the goal of exposing a more web-...
already_AddRefed< nsIURI > GetSiteScopeURI()
nsCOMPtr< nsIDOMDocument > mContentDoc
nsRefPtr< sbRemoteWebPlaylist > mRemWebPlaylist
nsCOMPtr< nsPIDOMWindow > mPrivWindow
nsCOMPtr< nsIWeakReference > mMM
nsresult SetOriginScope(sbIMediaItem *aItem, const nsAString &aSiteID)
An interface for accessing, and binding to, stored data.
[SOON TO BE DEPRECATED AFTER 0.3] The callback class for sbIDeviceBase
nsISecurityCheckedComponent
NS_DECL_ISUPPORTS NS_DECL_SBIDEVICEBASECALLBACK sbRemotePlayerDownloadCallback()
static NS_METHOD Register(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *aLoaderStr, const char *aType, const nsModuleComponentInfo *aInfo)
nsDataHashtable< nsStringHashKey, sbRemoteObserver > mRemObsHash
static nsresult DispatchEvent(nsIDOMDocument *aDocument, const nsAString &aClass, const nsAString &aType, PRBool aIsTrusted)
nsCOMPtr< nsIIOService > mIOService
nsresult OnBeforeViewChange(sbIMediacoreEvent *aEvent)
_collectFormDataForFrame aDocument
nsRefPtr< sbRemoteNotificationManager > mNotificationMgr
nsresult SetDownloadScope(sbIMediaItem *aItem, const nsAString &aSiteID)
nsCOMPtr< nsISecurityCheckedComponent > mSecurityMixin
nsresult InitRemoteWebPlaylist()
nsCOMPtr< nsIDOMDocument > mChromeDoc
nsCOMPtr< sbIDataRemote > mdrCurrentTrack
A marker interface for objects that aggregate the security mixin.
nsresult OnTrackChange(sbIMediacoreEvent *aEvent)
nsresult OnTrackIndexChange(sbIMediacoreEvent *aEvent)
already_AddRefed< nsPIDOMWindow > GetWindow()
nsCOMPtr< sbIDataRemote > mdrShuffle
An interface to control a media library from remote web pages.
nsCOMPtr< sbIDataRemote > mdrPosition
nsresult GetBrowser(nsIDOMElement **aElement)
nsresult OnBeforeTrackChange(sbIMediacoreEvent *aEvent)
nsCOMPtr< sbIDataRemote > mdrCurrentArtist
nsRefPtr< sbRemotePlayerDownloadCallback > mDownloadCallback
nsCOMPtr< sbIDataRemote > mdrPaused
nsresult CreateProperty(const nsAString &aPropertyType, const nsAString &aPropertyID, const nsAString &aDisplayName, const nsAString &aButtonLabel, PRInt32 aTimeType, PRBool aReadonly, PRBool aUserViewable, PRUint32 aNullSort)
nsCOMPtr< sbIDataRemote > remote
static nsresult GetJSScopeNameFromScope(const nsACString &aScopeName, nsAString &aJSScopeName)
nsresult UnregisterCommands()
nsresult RegisterCommands(PRBool aUseDefaultCommands)
nsresult TakePlaybackControl(nsIURI *aURI)
static nsresult DispatchSecurityEvent(nsIDOMDocument *aDoc, sbIRemotePlayer *aPlayer, const nsAString &aClass, const nsAString &aType, const nsAString &aCategoryID, PRBool aHasAccess, PRBool aIsTrusted)
nsresult Initialize(sbRemotePlayer *aRemotePlayer)
static NS_METHOD Unregister(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *aLoaderStr, const nsModuleComponentInfo *aInfo)
sbRemoteNotificationManager * GetNotificationManager()
nsCOMPtr< sbIRemoteObserver > observer
nsInterfaceHashtable< nsStringHashKey, sbIRemoteLibrary > mCachedLibraries
nsCOMPtr< nsIURI > mSiteScopeURI
nsCOMPtr< sbIDataRemote > mdrVolume
nsresult GetSiteScopeURL(nsAString &aURL)