sbRemotePlayer Class Reference

#include <sbRemotePlayer.h>

Inheritance diagram for sbRemotePlayer:
[legend]
Collaboration diagram for sbRemotePlayer:
[legend]

Public Member Functions

NS_DECL_SBIREMOTEPLAYER
NS_DECL_ISUPPORTS
NS_DECL_NSICLASSINFO
NS_DECL_NSIDOMEVENTLISTENER
NS_DECL_SBISECURITYAGGREGATOR
NS_DECL_SBIMEDIACOREEVENTLISTENER 
sbRemotePlayer ()
 
nsresult Init ()
 
nsresult InitPrivileged (nsIURI *aCodebase, nsIDOMWindow *aWindow)
 
PRBool IsPrivileged ()
 
sbRemoteNotificationManagerGetNotificationManager ()
 
nsresult SetOriginScope (sbIMediaItem *aItem, const nsAString &aSiteID)
 
nsresult GetSiteScopeURL (nsAString &aURL)
 
already_AddRefed< nsIURI > GetSiteScopeURI ()
 
already_AddRefed< nsPIDOMWindow > GetWindow ()
 
- Public Member Functions inherited from sbIRemotePlayer
boolean supportsVersion (in AString aAPIVersion)
 Convenience method to see if the requested API version is supported. More...
 
void addListener (in AString aKey, in sbIRemoteObserver aObserver)
 Bind an observer to get called on changes to Songbird metadata/state. More...
 
void removeListener (in AString aKey, in sbIRemoteObserver aObserver)
 Remove an observer from the metadata key. More...
 
void downloadItem (in sbIMediaItem aItem)
 Download the item passed in. More...
 
void downloadList (in sbIRemoteMediaList aList)
 Download all items in a MediaList. More...
 
void downloadSelected (in sbIRemoteWebPlaylist aWebPlaylist)
 Download only the selected elements from a WebPlaylist. More...
 
void play ()
 Begin playback at the current location. More...
 
void playMediaList (in sbIRemoteMediaList aList, in PRInt32 aIndex)
 
void playURL (in AString aURL)
 Play an media file by URL. More...
 
void stop ()
 Stop playback. Sets position to beginning. More...
 
void pause ()
 Stop playback, leaves position at current location. More...
 
void next ()
 Skip to the next track and begin playing. More...
 
void previous ()
 Skip to the previous track and begin playing. More...
 
void setSiteScope (in AUTF8String aDomain, in AUTF8String aPath)
 
nsIURI getSiteScope ()
 Get the site scope. More...
 
sbIRemoteLibrary libraries (in AString aLibraryID)
 
void fireEventToContent (in AString aClass, in AString aType)
 Fires the event to the webpage. More...
 
void fireMediaItemStatusEventToContent (in AString aClass, in AString aType, in sbIMediaItem aMediaItem, in long aStatus)
 Fires the media item status event to the webpage. More...
 
void onCommandsChanged ()
 Forces the webplaylist to rescan its commands. More...
 
boolean hasAccess (in AString aRemotePermCataegory)
 Check if the code has access to a category. More...
 
void createTextProperty (in AString ID, in AString displayName, [optional] in boolean readOnly, [optional] in boolean viewable, [optional] in unsigned long nullSort)
 
void createDateTimeProperty (in AString ID, in AString displayName, in PRInt32 timeType, [optional] in boolean readOnly, [optional] in boolean viewable, [optional] in unsigned long nullSort)
 
void createURIProperty (in AString ID, in AString displayName, [optional] in boolean readOnly, [optional] in boolean viewable, [optional] in unsigned long nullSort)
 
void createNumberProperty (in AString ID, in AString displayName, [optional] in boolean readOnly, [optional] in boolean viewable, [optional] in unsigned long nullSort)
 
void createImageProperty (in AString ID, in AString displayName, [optional] in boolean readOnly, [optional] in boolean viewable, [optional] in unsigned long nullSort)
 
void createRatingsProperty (in AString ID, in AString displayName, [optional] in boolean readOnly, [optional] in boolean viewable, [optional] in unsigned long nullSort)
 
void createButtonProperty (in AString ID, in AString displayName, in AString buttonLabel, [optional] in boolean readOnly, [optional] in boolean viewable, [optional] in unsigned long nullSort)
 
void createDownloadButtonProperty (in AString ID, in AString displayName, in AString buttonLabel, [optional] in boolean readOnly, [optional] in boolean viewable, [optional] in unsigned long nullSort)
 
- Public Member Functions inherited from sbIMediacoreEventListener
void onMediacoreEvent (in sbIMediacoreEvent aEvent)
 

Static Public Member Functions

static NS_METHOD Register (nsIComponentManager *aCompMgr, nsIFile *aPath, const char *aLoaderStr, const char *aType, const nsModuleComponentInfo *aInfo)
 
static NS_METHOD Unregister (nsIComponentManager *aCompMgr, nsIFile *aPath, const char *aLoaderStr, const nsModuleComponentInfo *aInfo)
 
static nsresult DispatchEvent (nsIDOMDocument *aDocument, const nsAString &aClass, const nsAString &aType, PRBool aIsTrusted)
 
static nsresult DispatchSecurityEvent (nsIDOMDocument *aDoc, sbIRemotePlayer *aPlayer, const nsAString &aClass, const nsAString &aType, const nsAString &aCategoryID, PRBool aHasAccess, PRBool aIsTrusted)
 
static nsresult GetJSScopeNameFromScope (const nsACString &aScopeName, nsAString &aJSScopeName)
 
static PRBool GetUserApprovalForHost (nsIURI *aURI, const nsAString &aTitleKey, const nsAString &aMessageKey, const char *aScopedName=nsnull)
 
static already_AddRefed
< nsPIDOMWindow > 
GetWindowFromJS ()
 

Protected Member Functions

virtual ~sbRemotePlayer ()
 
nsresult InitInternal (nsPIDOMWindow *aWindow)
 
nsresult InitRemoteWebPlaylist ()
 
nsresult RegisterCommands (PRBool aUseDefaultCommands)
 
nsresult UnregisterCommands ()
 
nsresult ConfirmPlaybackControl ()
 
nsresult GetBrowser (nsIDOMElement **aElement)
 
nsresult TakePlaybackControl (nsIURI *aURI)
 
nsresult SetDownloadScope (sbIMediaItem *aItem, const nsAString &aSiteID)
 
nsresult CreateProperty (const nsAString &aPropertyType, const nsAString &aPropertyID, const nsAString &aDisplayName, const nsAString &aButtonLabel, PRInt32 aTimeType, PRBool aReadonly, PRBool aUserViewable, PRUint32 aNullSort)
 
nsresult OnStop ()
 
nsresult OnBeforeTrackChange (sbIMediacoreEvent *aEvent)
 
nsresult OnTrackChange (sbIMediacoreEvent *aEvent)
 
nsresult OnTrackIndexChange (sbIMediacoreEvent *aEvent)
 
nsresult OnBeforeViewChange (sbIMediacoreEvent *aEvent)
 
nsresult OnViewChange (sbIMediacoreEvent *aEvent)
 

Protected Attributes

PRBool mInitialized
 
PRBool mUseDefaultCommands
 
PRBool mPrivileged
 
nsCOMPtr< nsIWeakReference > mMM
 
nsCOMPtr< nsIIOService > mIOService
 
nsCOMPtr< nsIDOMDocument > mContentDoc
 
nsCOMPtr< nsIDOMDocument > mChromeDoc
 
nsRefPtr< sbRemoteWebPlaylistmRemWebPlaylist
 
nsRefPtr
< sbRemotePlayerDownloadCallback
mDownloadCallback
 
nsCString mScopeDomain
 
nsCString mScopePath
 
nsString mSiteScopeURL
 
nsCOMPtr< nsIURI > mSiteScopeURI
 
nsRefPtr< sbRemoteCommandsmCommandsObject
 
nsDataHashtable
< nsStringHashKey,
sbRemoteObserver
mRemObsHash
 
nsInterfaceHashtable
< nsStringHashKey,
sbIRemoteLibrary
mCachedLibraries
 
nsCOMPtr< sbIDataRemotemdrCurrentArtist
 
nsCOMPtr< sbIDataRemotemdrCurrentAlbum
 
nsCOMPtr< sbIDataRemotemdrCurrentTrack
 
nsCOMPtr< sbIDataRemotemdrPlaying
 
nsCOMPtr< sbIDataRemotemdrPaused
 
nsCOMPtr< sbIDataRemotemdrRepeat
 
nsCOMPtr< sbIDataRemotemdrShuffle
 
nsCOMPtr< sbIDataRemotemdrPosition
 
nsCOMPtr< sbIDataRemotemdrVolume
 
nsCOMPtr< sbIDataRemotemdrMute
 
nsCOMPtr
< nsISecurityCheckedComponent
mSecurityMixin
 
nsRefPtr
< sbRemoteNotificationManager
mNotificationMgr
 
nsCOMPtr< nsPIDOMWindow > mPrivWindow
 

Friends

class sbRemotePlayerDownloadCallback
 

Additional Inherited Members

- Public Attributes inherited from sbIRemotePlayer
readonly attribute unsigned long apiVersionMajor
 The major API version. More...
 
readonly attribute unsigned long apiVersionMinor
 The minor API version. More...
 
readonly attribute AString name
 The name of the player. More...
 
readonly attribute AString currentArtist
 The name of the artist for the currently playing media item. More...
 
readonly attribute AString currentAlbum
 The name of the album for the currently playing track. More...
 
readonly attribute AString currentTrack
 The name of the currently playing track. More...
 
readonly attribute boolean playing
 The playing state of the application. More...
 
readonly attribute boolean paused
 The paused state of the application. More...
 
readonly attribute long long repeat
 The repeat state for playback. More...
 
readonly attribute boolean shuffle
 Shuffle state for playback. More...
 
attribute long long position
 The location of playback within the current media, in milliseconds. More...
 
readonly attribute unsigned
long long 
duration
 The duration of the current media, in milliseconds. More...
 
readonly attribute long long volume
 The volume on a range from 0 to 255. More...
 
readonly attribute boolean mute
 The mute state. More...
 
readonly attribute
sbIRemoteCommands 
commands
 The collection of commands associated with the current page. More...
 
readonly attribute
sbIRemoteWebPlaylist 
webPlaylist
 The current web playlist. More...
 
readonly attribute sbIRemoteLibrary mainLibrary
 
readonly attribute sbIRemoteLibrary webLibrary
 
readonly attribute sbIRemoteLibrary siteLibrary
 
readonly attribute
sbIRemoteMediaList 
downloadMediaList
 
- Public Attributes inherited from sbISecurityAggregator
readonly attribute sbIRemotePlayer remotePlayer
 

Detailed Description

Definition at line 83 of file sbRemotePlayer.h.

Constructor & Destructor Documentation

NS_DECL_SBIREMOTEPLAYER NS_DECL_ISUPPORTS NS_DECL_NSICLASSINFO NS_DECL_NSIDOMEVENTLISTENER NS_DECL_SBISECURITYAGGREGATOR NS_DECL_SBIMEDIACOREEVENTLISTENER sbRemotePlayer::sbRemotePlayer ( )
sbRemotePlayer::~sbRemotePlayer ( )
protectedvirtual

Definition at line 360 of file sbRemotePlayer.cpp.

Here is the call graph for this function:

Member Function Documentation

nsresult sbRemotePlayer::ConfirmPlaybackControl ( )
protected

Definition at line 2183 of file sbRemotePlayer.cpp.

Here is the call graph for this function:

nsresult sbRemotePlayer::CreateProperty ( const nsAString &  aPropertyType,
const nsAString &  aPropertyID,
const nsAString &  aDisplayName,
const nsAString &  aButtonLabel,
PRInt32  aTimeType,
PRBool  aReadonly,
PRBool  aUserViewable,
PRUint32  aNullSort 
)
protected

Definition at line 2867 of file sbRemotePlayer.cpp.

nsresult sbRemotePlayer::DispatchEvent ( nsIDOMDocument *  aDocument,
const nsAString &  aClass,
const nsAString &  aType,
PRBool  aIsTrusted 
)
static

Definition at line 2515 of file sbRemotePlayer.cpp.

nsresult sbRemotePlayer::DispatchSecurityEvent ( nsIDOMDocument *  aDoc,
sbIRemotePlayer aPlayer,
const nsAString &  aClass,
const nsAString &  aType,
const nsAString &  aCategoryID,
PRBool  aHasAccess,
PRBool  aIsTrusted 
)
static

Definition at line 2551 of file sbRemotePlayer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbRemotePlayer::GetBrowser ( nsIDOMElement **  aElement)
protected

Definition at line 2415 of file sbRemotePlayer.cpp.

nsresult sbRemotePlayer::GetJSScopeNameFromScope ( const nsACString &  aScopeName,
nsAString &  aJSScopeName 
)
static

Definition at line 2616 of file sbRemotePlayer.cpp.

Here is the caller graph for this function:

sbRemoteNotificationManager * sbRemotePlayer::GetNotificationManager ( )

Definition at line 2684 of file sbRemotePlayer.cpp.

already_AddRefed< nsIURI > sbRemotePlayer::GetSiteScopeURI ( )

Definition at line 2710 of file sbRemotePlayer.cpp.

Here is the caller graph for this function:

nsresult sbRemotePlayer::GetSiteScopeURL ( nsAString &  aURL)

Definition at line 2690 of file sbRemotePlayer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool sbRemotePlayer::GetUserApprovalForHost ( nsIURI *  aURI,
const nsAString &  aTitleKey,
const nsAString &  aMessageKey,
const char *  aScopedName = nsnull 
)
static

Definition at line 2248 of file sbRemotePlayer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

already_AddRefed< nsPIDOMWindow > sbRemotePlayer::GetWindow ( )

Definition at line 2504 of file sbRemotePlayer.cpp.

already_AddRefed< nsPIDOMWindow > sbRemotePlayer::GetWindowFromJS ( )
static

Definition at line 2472 of file sbRemotePlayer.cpp.

Here is the caller graph for this function:

nsresult sbRemotePlayer::Init ( )

Definition at line 376 of file sbRemotePlayer.cpp.

Here is the call graph for this function:

nsresult sbRemotePlayer::InitInternal ( nsPIDOMWindow *  aWindow)
protected

Definition at line 431 of file sbRemotePlayer.cpp.

Here is the caller graph for this function:

nsresult sbRemotePlayer::InitPrivileged ( nsIURI *  aCodebase,
nsIDOMWindow aWindow 
)

Definition at line 401 of file sbRemotePlayer.cpp.

Here is the call graph for this function:

nsresult sbRemotePlayer::InitRemoteWebPlaylist ( )
protected

Definition at line 2631 of file sbRemotePlayer.cpp.

PRBool sbRemotePlayer::IsPrivileged ( )

Definition at line 2610 of file sbRemotePlayer.cpp.

nsresult sbRemotePlayer::OnBeforeTrackChange ( sbIMediacoreEvent aEvent)
protected

Definition at line 1747 of file sbRemotePlayer.cpp.

nsresult sbRemotePlayer::OnBeforeViewChange ( sbIMediacoreEvent aEvent)
protected

Definition at line 1824 of file sbRemotePlayer.cpp.

nsresult sbRemotePlayer::OnStop ( )
protected

Definition at line 1735 of file sbRemotePlayer.cpp.

nsresult sbRemotePlayer::OnTrackChange ( sbIMediacoreEvent aEvent)
protected

Definition at line 1773 of file sbRemotePlayer.cpp.

nsresult sbRemotePlayer::OnTrackIndexChange ( sbIMediacoreEvent aEvent)
protected

Definition at line 1799 of file sbRemotePlayer.cpp.

nsresult sbRemotePlayer::OnViewChange ( sbIMediacoreEvent aEvent)
protected

Definition at line 1836 of file sbRemotePlayer.cpp.

NS_METHOD sbRemotePlayer::Register ( nsIComponentManager *  aCompMgr,
nsIFile *  aPath,
const char *  aLoaderStr,
const char *  aType,
const nsModuleComponentInfo *  aInfo 
)
static

Definition at line 2822 of file sbRemotePlayer.cpp.

nsresult sbRemotePlayer::RegisterCommands ( PRBool  aUseDefaultCommands)
protected

Definition at line 844 of file sbRemotePlayer.cpp.

nsresult sbRemotePlayer::SetDownloadScope ( sbIMediaItem aItem,
const nsAString &  aSiteID 
)
protected

Definition at line 2759 of file sbRemotePlayer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbRemotePlayer::SetOriginScope ( sbIMediaItem aItem,
const nsAString &  aSiteID 
)

Definition at line 2795 of file sbRemotePlayer.cpp.

Here is the call graph for this function:

nsresult sbRemotePlayer::TakePlaybackControl ( nsIURI *  aURI)
protected

Definition at line 2441 of file sbRemotePlayer.cpp.

NS_METHOD sbRemotePlayer::Unregister ( nsIComponentManager *  aCompMgr,
nsIFile *  aPath,
const char *  aLoaderStr,
const nsModuleComponentInfo *  aInfo 
)
static

Definition at line 2848 of file sbRemotePlayer.cpp.

nsresult sbRemotePlayer::UnregisterCommands ( )
protected

Definition at line 2152 of file sbRemotePlayer.cpp.

Friends And Related Function Documentation

friend class sbRemotePlayerDownloadCallback
friend

Definition at line 91 of file sbRemotePlayer.h.

Member Data Documentation

nsInterfaceHashtable<nsStringHashKey, sbIRemoteLibrary> sbRemotePlayer::mCachedLibraries
protected

Definition at line 214 of file sbRemotePlayer.h.

nsCOMPtr<nsIDOMDocument> sbRemotePlayer::mChromeDoc
protected

Definition at line 189 of file sbRemotePlayer.h.

nsRefPtr<sbRemoteCommands> sbRemotePlayer::mCommandsObject
protected

Definition at line 208 of file sbRemotePlayer.h.

nsCOMPtr<nsIDOMDocument> sbRemotePlayer::mContentDoc
protected

Definition at line 188 of file sbRemotePlayer.h.

nsRefPtr<sbRemotePlayerDownloadCallback> sbRemotePlayer::mDownloadCallback
protected

Definition at line 195 of file sbRemotePlayer.h.

nsCOMPtr<sbIDataRemote> sbRemotePlayer::mdrCurrentAlbum
protected

Definition at line 218 of file sbRemotePlayer.h.

nsCOMPtr<sbIDataRemote> sbRemotePlayer::mdrCurrentArtist
protected

Definition at line 217 of file sbRemotePlayer.h.

nsCOMPtr<sbIDataRemote> sbRemotePlayer::mdrCurrentTrack
protected

Definition at line 219 of file sbRemotePlayer.h.

nsCOMPtr<sbIDataRemote> sbRemotePlayer::mdrMute
protected

Definition at line 226 of file sbRemotePlayer.h.

nsCOMPtr<sbIDataRemote> sbRemotePlayer::mdrPaused
protected

Definition at line 221 of file sbRemotePlayer.h.

nsCOMPtr<sbIDataRemote> sbRemotePlayer::mdrPlaying
protected

Definition at line 220 of file sbRemotePlayer.h.

nsCOMPtr<sbIDataRemote> sbRemotePlayer::mdrPosition
protected

Definition at line 224 of file sbRemotePlayer.h.

nsCOMPtr<sbIDataRemote> sbRemotePlayer::mdrRepeat
protected

Definition at line 222 of file sbRemotePlayer.h.

nsCOMPtr<sbIDataRemote> sbRemotePlayer::mdrShuffle
protected

Definition at line 223 of file sbRemotePlayer.h.

nsCOMPtr<sbIDataRemote> sbRemotePlayer::mdrVolume
protected

Definition at line 225 of file sbRemotePlayer.h.

PRBool sbRemotePlayer::mInitialized
protected

Definition at line 181 of file sbRemotePlayer.h.

nsCOMPtr<nsIIOService> sbRemotePlayer::mIOService
protected

Definition at line 185 of file sbRemotePlayer.h.

nsCOMPtr<nsIWeakReference> sbRemotePlayer::mMM
protected

Definition at line 184 of file sbRemotePlayer.h.

nsRefPtr<sbRemoteNotificationManager> sbRemotePlayer::mNotificationMgr
protected

Definition at line 231 of file sbRemotePlayer.h.

PRBool sbRemotePlayer::mPrivileged
protected

Definition at line 183 of file sbRemotePlayer.h.

nsCOMPtr<nsPIDOMWindow> sbRemotePlayer::mPrivWindow
protected

Definition at line 235 of file sbRemotePlayer.h.

nsDataHashtable<nsStringHashKey, sbRemoteObserver> sbRemotePlayer::mRemObsHash
protected

Definition at line 211 of file sbRemotePlayer.h.

nsRefPtr<sbRemoteWebPlaylist> sbRemotePlayer::mRemWebPlaylist
protected

Definition at line 192 of file sbRemotePlayer.h.

nsCString sbRemotePlayer::mScopeDomain
protected

Definition at line 199 of file sbRemotePlayer.h.

nsCString sbRemotePlayer::mScopePath
protected

Definition at line 200 of file sbRemotePlayer.h.

nsCOMPtr<nsISecurityCheckedComponent> sbRemotePlayer::mSecurityMixin
protected

Definition at line 229 of file sbRemotePlayer.h.

nsCOMPtr<nsIURI> sbRemotePlayer::mSiteScopeURI
protected

Definition at line 204 of file sbRemotePlayer.h.

nsString sbRemotePlayer::mSiteScopeURL
protected

Definition at line 203 of file sbRemotePlayer.h.

PRBool sbRemotePlayer::mUseDefaultCommands
protected

Definition at line 182 of file sbRemotePlayer.h.


The documentation for this class was generated from the following files: