All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Playlist Commands

Classes

interface  sbIPlaylistCommands
 An interface that represents the set of command buttons and context menu items available on a displayed playlist. More...
 
interface  sbIPlaylistCommandsContext
 The interface for giving context to a playlistcommands object. More...
 
interface  sbIPlaylistCommandsListener
 The interface for receiving notices when a Command Object is added to or removed from another Command Object. More...
 
interface  sbIPlaylistCommandsManager
 The service used to register, unregister, and list playlist commands for a particular playlist guid or type. More...
 
interface  sbIPlaylistCommandsBuilder
 A helper used to construct sbIPlaylistCommands interfaces. More...
 
interface  sbIPlaylistCommandsBuilderContext
 The interface for giving context to playlist builder callbacks. More...
 
interface  sbIPlaylistCommandsBuilderSimpleCallback
 An interface used to receive generic callbacks from an sbIPlaylistCommandsBuilder object. More...
 
interface  sbIPlaylistCommandsBuilderGetStringCallback
 An interface used to receive callbacks from an sbIPlaylistCommandsBuilder object when a string value should be returned. More...
 
interface  sbIPlaylistCommandsBuilderGetBoolCallback
 An interface used to receive callbacks from an sbIPlaylistCommandsBuilder object when a boolean value should be returned. More...
 
interface  sbIPlaylistCommandsBuilderSetValueCallback
 A callback interface used to receive a string value from an sbIPlaylistCommandsBuilder object. More...
 
interface  sbIPlaylistCommandsBuilderInstantiationCallback
 A callback interface used to instantiate a custom command DOM element for sbIPlaylistCommandsBuilder objects. More...
 
interface  sbIPlaylistCommandsBuilderRefreshCallback
 A callback interface used to refresh a custom command DOM element for sbIPlaylistCommandsBuilder objects. More...
 
interface  sbIPlaylistCommandsBuilderPCCallback
 A callback interface used to receive callbacks from an sbIPlaylistCommandsBuilder object relating to an entire set of playlistcommands. More...
 
interface  sbIPlaylistCommandsHelper
 A helper service to add and remove playlistCommands. More...
 

Functions

sbIPlaylistCommandsBuilder sbIPlaylistCommandsHelper::createCommandObjectForAction (in AString aCommandId, in AString aLabel, in AString aTooltipText, in sbIPlaylistCommandsBuilderSimpleCallback aCallback)
 A method to create a command object for a specified action. The command object and action added to that command object will share the param id. More...
 
void sbIPlaylistCommandsHelper::addCommandObjectForType (in unsigned short aTargetFlags, in AString aMediaListType, in sbIPlaylistCommands aCommandObject)
 Add a command object to medialists of the specified type. Generally commands added to type are defaults that appear for all medialists of the specified type unless commands are specified to a medialist by its guid. In that case those registered to its guid are displayed and those registered to its type are not. More...
 
void sbIPlaylistCommandsHelper::addCommandObjectForGUID (in unsigned short aTargetFlags, in AString aMediaListGUID, in sbIPlaylistCommands aCommandObject)
 Add a command object to the medialist of the specified guid. Generally, if a medialist has commands registered to it by guid, those will be displayed and those registered to the medialist by type are not. More...
 
void sbIPlaylistCommandsHelper::removeCommandObjectForType (in unsigned short aTargetFlags, in AString aMediaListType, in sbIPlaylistCommands aCommandObject)
 Remove a command object from medialists of the specified type. More...
 
void sbIPlaylistCommandsHelper::removeCommandObjectForGUID (in unsigned short aTargetFlags, in AString aMediaListGUID, in sbIPlaylistCommands aCommandObject)
 Remove a command object from the medialist of the specified guid. More...
 
sbIPlaylistCommands sbIPlaylistCommandsHelper::getCommandObjectForType (in unsigned short aTargetFlag, in AString aMediaListType, in AString aCommandId)
 Retrieve a specific command object registered for medialists of the param type. More...
 
sbIPlaylistCommands sbIPlaylistCommandsHelper::getCommandObjectForGUID (in unsigned short aTargetFlag, in AString aMediaListGUID, in AString aCommandId)
 Retrieve a specific command object registered for the medialist with the param guid. More...
 

Variables

const unsigned short sbIPlaylistCommandsHelper::TARGET_SERVICEPANE_MENU = 1 << 0
 A flag referring to the context menu that appears from the service pane node. More...
 
const unsigned short sbIPlaylistCommandsHelper::TARGET_MEDIAITEM_CONTEXT_MENU = 1 << 1
 A flag referring to the context menu that appears from mediaitems displayed in the medialist. More...
 
const unsigned short sbIPlaylistCommandsHelper::TARGET_TOOLBAR = 1 << 2
 A flag referring to the toolbar at the bottom of a medialist view. More...
 
const unsigned short sbIPlaylistCommandsHelper::TARGET_ALL
 A convenience flag referring to all locations that a sbIPlaylistCommands object can appear. More...
 

Detailed Description

Function Documentation

void sbIPlaylistCommandsHelper::addCommandObjectForGUID ( in unsigned short  aTargetFlags,
in AString  aMediaListGUID,
in sbIPlaylistCommands  aCommandObject 
)

Add a command object to the medialist of the specified guid. Generally, if a medialist has commands registered to it by guid, those will be displayed and those registered to the medialist by type are not.

The location of the command object is specified by the param aTargetFlags. Any combination of the TARGET flags can be | (OR) together to specify multiple locations for this command object. The following is an example of using this function to add a command object (cmdObject) to the playlist with guid playlistGUID so that it appears in the servicepane menu and toolbar:

var playlistCommandsHelper =
Components.classes["@songbirdnest.com/Songbird/PlaylistCommandsHelper;1"]
.getService(Ci.sbIPlaylistCommandsHelper);
var servicePaneAndToolbarFlags = playlistCommandsHelper.TARGET_SERVICEPANE_MENU |
playlistCommandsHelper.TARGET_TOOLBAR;
playlistCommandsHelper.addCommandObjectForGUID(servicePaneAndToolbarFlags,
playlistGUID,
cmdObject);

The location of the sbIPlaylistCommands object is internally controlled by specifying the Visibility Callback, which the caller is discouraged from changing without thorough knowledge of sbIPlaylistCommands and sbIPlaylistCommandsManager.

The param aCommandObject will override any command object already registered to the param type if it has the same id.

Parameters
aTargetFlagsAny combination of the TARGET flags specifying where the param aCommandObject should appear
aMediaListGUIDThe guid of the medialist for which to add the command object
aCommandObjThe command object instance to be added
See Also
sbIPlaylistCommands, sbIPlaylistCommandsBuilder, sbIPlaylistCommandsManager
void sbIPlaylistCommandsHelper::addCommandObjectForType ( in unsigned short  aTargetFlags,
in AString  aMediaListType,
in sbIPlaylistCommands  aCommandObject 
)

Add a command object to medialists of the specified type. Generally commands added to type are defaults that appear for all medialists of the specified type unless commands are specified to a medialist by its guid. In that case those registered to its guid are displayed and those registered to its type are not.

The location of the command object is specified by the param aTargetFlags. Any combination of the TARGET flags can be | (OR) together to specify multiple locations for this command object. The following is an example of using this function to add a command object (cmdObject) to smart playlists so that it appears in the servicepane menu and toolbar:

var playlistCommandsHelper =
Components.classes["@songbirdnest.com/Songbird/PlaylistCommandsHelper;1"]
.getService(Ci.sbIPlaylistCommandsHelper);
var servicePaneAndToolbarFlags = playlistCommandsHelper.TARGET_SERVICEPANE_MENU |
playlistCommandsHelper.TARGET_TOOLBAR;
playlistCommandsHelper.addCommandObjectForType(servicePaneAndToolbarFlags,
"smart",
cmdObject);

The location of the sbIPlaylistCommands object is internally controlled by specifying the Visibility Callback, which the caller is discouraged from changing without thorough knowledge of sbIPlaylistCommands and sbIPlaylistCommandsManager.

The param aCommandObject will override any command object already registered to the param type if it has the same id.

Parameters
aTargetFlagsAny combination of the TARGET flags specifying where the param aCommandObject should appear
aMediaListTypeThe listType string to register the command object against. Likely one of the accepted listTypes (e.g. "simple")
aCommandObjThe command object instance to be added
See Also
sbIPlaylistCommands, sbIPlaylistCommandsBuilder, sbIPlaylistCommandsManager
sbIPlaylistCommandsBuilder sbIPlaylistCommandsHelper::createCommandObjectForAction ( in AString  aCommandId,
in AString  aLabel,
in AString  aTooltipText,
in sbIPlaylistCommandsBuilderSimpleCallback  aCallback 
)

A method to create a command object for a specified action. The command object and action added to that command object will share the param id.

Parameters
aCommandIdAn identifier that will be used to distinguish the new command object
aLabelThe user-facing label for the command object. The caller is expected to properly localize this string
aTooltipTextText that will appear on hover over the command object. As of Songbird 1.10 this does not seem to be implemented.
aCallbackThe callback method that will be called when the command object is triggered
Returns
The new sbIPlaylistCommands object
See Also
sbIPlaylistCommands, sbIPlaylistCommandsBuilder
sbIPlaylistCommands sbIPlaylistCommandsHelper::getCommandObjectForGUID ( in unsigned short  aTargetFlag,
in AString  aMediaListGUID,
in AString  aCommandId 
)

Retrieve a specific command object registered for the medialist with the param guid.

The param aTargetFlag should represent one of the locations the desired command object appears in. Please note that command objects can be registered to multiple locations and, if this is the case with the returned command object, modifications to the returned command object will appear in the aTargetFlag location as well as in the other locations. To guard against unexpected side effects, the caller can check the targetFlags attribute of the returned sbIPlaylistCommands object if that command object was added using this API.

Parameters
aTargetFlagA single TARGET flag specifying one of the locations in which the desired command object appears
aMediaListGUIDThe guid of the medialist from which to retrieve the command object
aCommandIdThe id of the command object instance to be retrieved
Returns
The sbIPlaylistCommands object that was desired or null if not found
See Also
sbIPlaylistCommands, sbIPlaylistCommandsBuilder, sbIPlaylistCommandsManager
sbIPlaylistCommands sbIPlaylistCommandsHelper::getCommandObjectForType ( in unsigned short  aTargetFlag,
in AString  aMediaListType,
in AString  aCommandId 
)

Retrieve a specific command object registered for medialists of the param type.

The param aTargetFlag should represent one of the locations the desired command object appears in. Please note that command objects can be registered to multiple locations and, if this is the case with the returned command object, modifications to the returned command object will appear in the aTargetFlag location as well as in the other locations. To guard against unexpected side effects, the caller can check the targetFlags attribute of the returned sbIPlaylistCommands object if that command object was added using this API.

Parameters
aTargetFlagA single TARGET flag specifying one of the locations in which the desired command object appears
aMediaListTypeThe arbitrary type string from which to retrieve the command object. Likely one of the accepted listTypes (e.g. "simple").
aCommandIdThe id of the command object instance to be retrieved
Returns
The sbIPlaylistCommands object that was desired or null if not found
See Also
sbIPlaylistCommands, sbIPlaylistCommandsBuilder, sbIPlaylistCommandsManager
void sbIPlaylistCommandsHelper::removeCommandObjectForGUID ( in unsigned short  aTargetFlags,
in AString  aMediaListGUID,
in sbIPlaylistCommands  aCommandObject 
)

Remove a command object from the medialist of the specified guid.

This command object must be registered for the specified guid to be removed, if it was registered to medialists by type then it must be removed with removeCommandObjectForMediaListType

The location to remove the command object from is specified by the param aTargetFlags. Any combination of the TARGET flags can be | (OR) together to specify multiple locations to remove the param aCommandObject from. The command object will only be removed from those locations specified by aTargetFlags.

This function does nothing if the command object is not found, or for those locations specified by aTargetFlags but for which aCommandObject is not actually present.

Parameters
aTargetFlagsAny combination of the TARGET flags specifying where the param aCommandObject should be removed from
aMediaListGUIDThe guid of the medialist from which to remove the command object
aCommandObjThe command object instance to be removed
See Also
sbIPlaylistCommands, sbIPlaylistCommandsBuilder, sbIPlaylistCommandsManager
void sbIPlaylistCommandsHelper::removeCommandObjectForType ( in unsigned short  aTargetFlags,
in AString  aMediaListType,
in sbIPlaylistCommands  aCommandObject 
)

Remove a command object from medialists of the specified type.

This command object must be registered for the specified type to be removed, if it was registered to a medialist by guid then it must be removed with removeCommandObjectForMediaListGUID.

The location to remove the command object from is specified by the param aTargetFlags. Any combination of the TARGET flags can be | (OR) together to specify multiple locations to remove the param aCommandObject from. The command object will only be removed from those locations specified by aTargetFlags.

This function does nothing if the command object is not found, or for those locations specified by aTargetFlags but for which aCommandObject is not actually present.

Parameters
aTargetFlagsAny combination of the TARGET flags specifying where the param aCommandObject should be removed from
aMediaListTypeThe arbitrary type string to from which to remove the command object. Likely one of the accepted listTypes (e.g. "simple")
aCommandObjThe command object instance to be removed
See Also
sbIPlaylistCommands, sbIPlaylistCommandsBuilder, sbIPlaylistCommandsManager

Variable Documentation

const unsigned short sbIPlaylistCommandsHelper::TARGET_ALL
Initial value:

A convenience flag referring to all locations that a sbIPlaylistCommands object can appear.

Definition at line 61 of file sbIPlaylistCommandsHelper.idl.

const unsigned short sbIPlaylistCommandsHelper::TARGET_MEDIAITEM_CONTEXT_MENU = 1 << 1

A flag referring to the context menu that appears from mediaitems displayed in the medialist.

Definition at line 52 of file sbIPlaylistCommandsHelper.idl.

const unsigned short sbIPlaylistCommandsHelper::TARGET_SERVICEPANE_MENU = 1 << 0

A flag referring to the context menu that appears from the service pane node.

Definition at line 47 of file sbIPlaylistCommandsHelper.idl.

const unsigned short sbIPlaylistCommandsHelper::TARGET_TOOLBAR = 1 << 2

A flag referring to the toolbar at the bottom of a medialist view.

Definition at line 56 of file sbIPlaylistCommandsHelper.idl.