net.rim.device.api.media
Class BluetoothHeadsetMediaActionContext

java.lang.Object
  extended by net.rim.device.api.media.BluetoothHeadsetMediaActionContext

public class BluetoothHeadsetMediaActionContext
extends Object

The context object for media actions generated from Bluetooth headsets. All media actions generated from MediaActionHandler.SOURCE_BLUETOOTH_HEADSET will have context objects that are instances of this class.

Since:
BlackBerry API 5.0.0

Field Summary
static int BUTTON_BACKWARD
          The button indicating that the media action was generated as a result of a Bluetooth backward button.
static int BUTTON_EJECT
          The button indicating that the media action was generated as a result of a Bluetooth eject button.
static int BUTTON_FAST_FORWARD
          The button indicating that the media action was generated as a result of a Bluetooth fast forward button.
static int BUTTON_FORWARD
          The button indicating that the media action was generated as a result of a Bluetooth forward button.
static int BUTTON_MUTE
          The button indicating that the media action was generated as a result of a Bluetooth mute button.
static int BUTTON_PAUSE
          The button indicating that the media action was generated as a result of a Bluetooth pause button.
static int BUTTON_PLAY
          The button indicating that the media action was generated as a result of a Bluetooth play button.
static int BUTTON_REWIND
          The button indicating that the media action was generated as a result of a Bluetooth rewind button.
static int BUTTON_STOP
          The button indicating that the media action was generated as a result of a Bluetooth stop button.
static int BUTTON_UNDEFINED
          The button indicating that the media action was generated as a result of a undefined Bluetooth button.
static int BUTTON_VOLUME_DOWN
          The button indicating that the media action was generated as a result of a Bluetooth volume down button.
static int BUTTON_VOLUME_UP
          The button indicating that the media action was generated as a result of a Bluetooth volume up button.
 
Constructor Summary
BluetoothHeadsetMediaActionContext(int button)
          Creates a new instance of BluetoothHeadsetMediaActionContext.
 
Method Summary
 boolean equals(Object obj)
          Tests an object for equality with this object.
 int getButton()
          Returns the button of the media action.
static String getButtonName(int button)
          Returns the name of a "button" constant.
 int hashCode()
          Returns a hash code value for the object.
 String toString()
          Generates and returns a String representation of this object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 



Field Detail

BUTTON_UNDEFINED

public static final int BUTTON_UNDEFINED
The button indicating that the media action was generated as a result of a undefined Bluetooth button.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_VOLUME_UP

public static final int BUTTON_VOLUME_UP
The button indicating that the media action was generated as a result of a Bluetooth volume up button.

See Also:
BluetoothHeadsetMediaActionContext.BUTTON_VOLUME_DOWN, Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_VOLUME_DOWN

public static final int BUTTON_VOLUME_DOWN
The button indicating that the media action was generated as a result of a Bluetooth volume down button.

See Also:
BluetoothHeadsetMediaActionContext.BUTTON_VOLUME_UP, Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_MUTE

public static final int BUTTON_MUTE
The button indicating that the media action was generated as a result of a Bluetooth mute button.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_PLAY

public static final int BUTTON_PLAY
The button indicating that the media action was generated as a result of a Bluetooth play button.

See Also:
BluetoothHeadsetMediaActionContext.BUTTON_PAUSE, BluetoothHeadsetMediaActionContext.BUTTON_STOP, Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_STOP

public static final int BUTTON_STOP
The button indicating that the media action was generated as a result of a Bluetooth stop button.

See Also:
BluetoothHeadsetMediaActionContext.BUTTON_PLAY, BluetoothHeadsetMediaActionContext.BUTTON_PAUSE, Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_PAUSE

public static final int BUTTON_PAUSE
The button indicating that the media action was generated as a result of a Bluetooth pause button.

See Also:
BluetoothHeadsetMediaActionContext.BUTTON_PLAY, BluetoothHeadsetMediaActionContext.BUTTON_STOP, Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_REWIND

public static final int BUTTON_REWIND
The button indicating that the media action was generated as a result of a Bluetooth rewind button.

See Also:
BluetoothHeadsetMediaActionContext.BUTTON_FAST_FORWARD, Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_FAST_FORWARD

public static final int BUTTON_FAST_FORWARD
The button indicating that the media action was generated as a result of a Bluetooth fast forward button.

See Also:
BluetoothHeadsetMediaActionContext.BUTTON_REWIND, Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_EJECT

public static final int BUTTON_EJECT
The button indicating that the media action was generated as a result of a Bluetooth eject button.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_FORWARD

public static final int BUTTON_FORWARD
The button indicating that the media action was generated as a result of a Bluetooth forward button.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

BUTTON_BACKWARD

public static final int BUTTON_BACKWARD
The button indicating that the media action was generated as a result of a Bluetooth backward button.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0


Constructor Detail

BluetoothHeadsetMediaActionContext

public BluetoothHeadsetMediaActionContext(int button)
Creates a new instance of BluetoothHeadsetMediaActionContext.

Parameters:
button - the value to return from BluetoothHeadsetMediaActionContext.getButton(); should be one of the BUTTON_ constants defined in this class, but this is not enforced.
Since:
BlackBerry API 5.0.0


Method Detail

equals

public boolean equals(Object obj)
Tests an object for equality with this object.

Overrides:
equals in class Object
Parameters:
obj - the object to test for equality with this object; may be null.
Returns:
true if and only if the specified Object is an instance of BluetoothHeadsetMediaActionContext and its getButton() method returns the same value as that of this object; returns false in all other cases.
See Also:
Boolean.hashCode(), Hashtable
Since:
BlackBerry API 5.0.0

getButton

public int getButton()
Returns the button of the media action. The "button" is the event that occurred on the Bluetooth headset that resulted in the media action. For example, if the media action was generated as a result of the "volume down" button being pressed, then the button would be BUTTON_VOLUME_DOWN.

Returns:
one of the BUTTON_ constants defined in this class that corresponds to the type of Bluetooth button that triggered the media action.
Since:
BlackBerry API 5.0.0

hashCode

public int hashCode()
Description copied from class: Object
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable
Since:
BlackBerry API 5.0.0

toString

public String toString()
Generates and returns a String representation of this object.

Overrides:
toString in class Object
Returns:
a String representation of this object; never returns null.
Since:
BlackBerry API 5.0.0

getButtonName

public static String getButtonName(int button)
Returns the name of a "button" constant.

Parameters:
button - the button whose name to return; known values are the BUTTON_ constants defined in this class.
Returns:
the name of the specified button; returns Integer.toString(button) if the name of the specified button is not known.
Since:
BlackBerry API 5.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal