Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
JavaScript Suite Documentation
SoftButtonObject

SoftButtonObject Class Reference

Constructors

Instance Methods

Constructors

new SoftButtonObject(name, states, initialStateName, onEventListener)

Create a new instance of the SoftButtonObject with multiple states

Instance Methods

softButtonObject.clone() ⇒ SoftButtonObject

Creates a deep copy of the object

Kind: Instance method of SoftButtonObject
Returns: SoftButtonObject deep copy of the object

softButtonObject.equals(other) ⇒ Boolean

Checks whether two SoftButtonObjects can be considered equivalent, but does NOT compare the listener objects

Kind: Instance method of SoftButtonObject
Returns: Boolean - Whether the objects are the same or not

ParamTypeDescription
other SoftButtonObject The object to compare

softButtonObject.getButtonId() ⇒ Number

Get the id of the SoftButtonObject

Kind: Instance method of SoftButtonObject
Returns: Number - an int value that represents the id of the SoftButtonObject

softButtonObject.getCurrentState() ⇒ [SoftButtonState, null]

Get the current state for the SoftButtonObject

Kind: Instance method of SoftButtonObject
Returns: [SoftButtonState, null] - a SoftButtonState represents the current state

softButtonObject.getCurrentStateName() ⇒ [String, null]

Get the name of the current state

Kind: Instance method of SoftButtonObject
Returns: [String, null] - a String that represents the name of the current state

softButtonObject.getCurrentStateSoftButton() ⇒ [SoftButton, null]

Get the SoftButton object for the current state

Kind: Instance method of SoftButtonObject
Returns: [SoftButton, null] - a SoftButton object that is associated with the current state

softButtonObject.getName() ⇒ String

Get the name of the SoftButtonObject

Kind: Instance method of SoftButtonObject
Returns: String - a String that represents the name of the SoftButtonObject

softButtonObject.getOnEventListener() ⇒ [function, null]

Get the event listener for the SoftButtonObject

Kind: Instance method of SoftButtonObject
Returns: [function, null] - The event listener function.

softButtonObject.getStates() ⇒ Array.<SoftButtonState>

Get the SoftButtonState list

Kind: Instance method of SoftButtonObject
Returns: Array.<SoftButtonState> - a list of the object's soft button states

softButtonObject.setName(name) ⇒ SoftButtonObject

Set the name of the SoftButtonObject

Kind: Instance method of SoftButtonObject
Returns: SoftButtonObject - A reference to this instance to support method chaining.

ParamTypeDescription
name String a String that represents the name of the SoftButtonObject

softButtonObject.setOnEventListener(onEventListener) ⇒ SoftButtonObject

Set the event listener for the SoftButtonObject

Kind: Instance method of SoftButtonObject
Returns: SoftButtonObject - A reference to this instance to support method chaining.

ParamTypeDescription
onEventListener function a listener that has a callback that will be triggered when a button event or button press happens

softButtonObject.transitionToNextState()

Transition the SoftButtonObject to the next state

Kind: Instance method of SoftButtonObject

softButtonObject.transitionToStateByName(newStateName) ⇒ Boolean

Transition the SoftButtonObject to a specific state

Kind: Instance method of SoftButtonObject
Returns: Boolean - a boolean value that represents whether the transition succeeded or failed

ParamTypeDescription
newStateName String a String value represents the name fo the state that we want to transition the SoftButtonObject to
View on GitHub.com
Previous Section Next Section