JSR-043: JTAPI-1.4

javax.telephony.phone
Interface PhoneTerminalEvent

All Superinterfaces:
Event, TerminalEvent

public interface PhoneTerminalEvent
extends Event, TerminalEvent

The PhoneTerminalEvent is the base event for all events in the phone package. Each event in this package must extend this interface. Events from the phone package reported via the PhoneTerminalListener interface.

This interface contains the getPhoneCause() method which returns a phone package specific cause for the event. Cause codes pertaining to this package are defined in this interface as well.

Since:
1.4
See Also:
Terminal, TerminalEvent, Event, PhoneTerminalListener

Field Summary
static int CAUSE_PHONE_TERMINAL_NORMAL
          Cause code indicating normal operation
static int CAUSE_PHONE_TERMINAL_UNKNOWN
          Cause code indicating the cause was unknown
static int PHONE_TERMINAL_BUTTON_INFO_EVENT
          The PHONE_TERMINAL_BUTTON_INFO_EVENT event indicates that the information associated with a button component has changed.
static int PHONE_TERMINAL_BUTTON_PRESS_EVENT
          The PHONE_TERMINAL_BUTTON_PRESS_EVENT event indicates that a button component has been pressed.
static int PHONE_TERMINAL_BUTTON_PRESS_THRESHOLD_EXCEEDED_EVENT
          The PHONE_TERMINAL_BUTTON_PRESS_THRESHOLD_EXCEEDED_EVENT event indicates that the indicated button has been pressed for longer than the requested time threshold.
static int PHONE_TERMINAL_DISPLAY_UPDATE_EVENT
          The PHONE_TERMINAL_DISPLAY_UPDATE_EVENT event indicates that the contents of the display component has changed.
static int PHONE_TERMINAL_HOOKSWITCH_STATE_EVENT
          The PHONE_TERMINAL_HOOKSWITCH_STATE_EVENT event indicates that the state of the hookswitch component has changed.
static int PHONE_TERMINAL_LAMP_MODE_EVENT
          The PHONE_TERMINAL_LAMP_MODE_EVENT event indicates that the mode of the PhoneLamp has changed.
static int PHONE_TERMINAL_MICROPHONE_GAIN_EVENT
          The PHONE_TERMINAL_LAMP_MODE_EVENT event indicates that the gain of a PhoneMicrophone component has changed.
static int PHONE_TERMINAL_RINGER_PATTERN_EVENT
          The PHONE_TERMINAL_RINGER_PATTERN_EVENT event indicates that the pattern of a ringer component has changed.
static int PHONE_TERMINAL_RINGER_VOLUME_EVENT
          The PHONE_TERMINAL_RINGER_VOLUME_EVENT event indicates that the volume of a ringer component has changed.
static int PHONE_TERMINAL_SPEAKER_VOLUME_EVENT
          The PHONE_TERMINAL_SPEAKER_VOLUME_EVENT event indicates that the volume of a speaker component has changed.
 
Fields inherited from interface javax.telephony.Event
CAUSE_CALL_CANCELLED, CAUSE_DEST_NOT_OBTAINABLE, CAUSE_INCOMPATIBLE_DESTINATION, CAUSE_LOCKOUT, CAUSE_NETWORK_CONGESTION, CAUSE_NETWORK_NOT_OBTAINABLE, CAUSE_NEW_CALL, CAUSE_NORMAL, CAUSE_RESOURCES_NOT_AVAILABLE, CAUSE_SNAPSHOT, CAUSE_UNKNOWN
 
Fields inherited from interface javax.telephony.TerminalEvent
TERMINAL_EVENT_TRANSMISSION_ENDED
 
Method Summary
 Component getComponent()
          Returns the Component object responsible for this event.
 ComponentGroup getComponentGroup()
          Returns the ComponentGroup object associated with this event.
 java.lang.String getDisplay(int x, int y)
          Returns the displayed string starting at coordinates (x, y).
 int getGain()
          Returns the gain of the microphone.
 int getHookSwitchState()
          Returns the current state of the hookswitch.
 java.lang.String getInfo()
          Returns the button information.
 int getMode()
          Returns the current lamp mode.
 java.lang.String getOldInfo()
          Returns the information previously associated with this button.
 int getPhoneCause()
          Returns the phone causes associated with this event.
 int getPressedDuration()
          Returns the duration of time starting when a user first pressed and held a button, and ending when the user releases the button.
 int getRingerPattern()
          Returns the pattern of the ringer.
 int getVolume()
          Returns the volume of the ringer or speaker (depending on event).
 
Methods inherited from interface javax.telephony.Event
getCause, getID, getMetaEvent, getSource
 
Methods inherited from interface javax.telephony.TerminalEvent
getTerminal
 

Field Detail

CAUSE_PHONE_TERMINAL_NORMAL

public static final int CAUSE_PHONE_TERMINAL_NORMAL
Cause code indicating normal operation

CAUSE_PHONE_TERMINAL_UNKNOWN

public static final int CAUSE_PHONE_TERMINAL_UNKNOWN
Cause code indicating the cause was unknown

PHONE_TERMINAL_BUTTON_INFO_EVENT

public static final int PHONE_TERMINAL_BUTTON_INFO_EVENT
The PHONE_TERMINAL_BUTTON_INFO_EVENT event indicates that the information associated with a button component has changed.

Applications may obtain the new information associated with this button via the PhoneButton.getInfo() method.

See Also:
PhoneButton.setInfo(java.lang.String)

PHONE_TERMINAL_BUTTON_PRESS_EVENT

public static final int PHONE_TERMINAL_BUTTON_PRESS_EVENT
The PHONE_TERMINAL_BUTTON_PRESS_EVENT event indicates that a button component has been pressed.

Applications may obtain the identifying information associated with this button via the PhoneButton.getInfo() method.

See Also:
PhoneButton.buttonPress()

PHONE_TERMINAL_DISPLAY_UPDATE_EVENT

public static final int PHONE_TERMINAL_DISPLAY_UPDATE_EVENT
The PHONE_TERMINAL_DISPLAY_UPDATE_EVENT event indicates that the contents of the display component has changed.

Applications may obtain the new contents of the display component via the PhoneDisplay.getDisplay(int x, int y) method.

See Also:
PhoneDisplay.setDisplay(java.lang.String string, int x, int y)

PHONE_TERMINAL_HOOKSWITCH_STATE_EVENT

public static final int PHONE_TERMINAL_HOOKSWITCH_STATE_EVENT
The PHONE_TERMINAL_HOOKSWITCH_STATE_EVENT event indicates that the state of the hookswitch component has changed.

Applications may obtain the new contents of the state of the hookswitch (either on-hook or off-hook) via the PhoneHookswitch.getHookSwitchState() method.

See Also:
PhoneHookswitch.ON_HOOK, PhoneHookswitch.OFF_HOOK, PhoneHookswitch.setHookSwitch(int hookSwitchState)

PHONE_TERMINAL_LAMP_MODE_EVENT

public static final int PHONE_TERMINAL_LAMP_MODE_EVENT
The PHONE_TERMINAL_LAMP_MODE_EVENT event indicates that the mode of the PhoneLamp has changed.

Applications may obtain the new mode of the PhoneLamp via the PhoneLamp.getMode() method.

See Also:
PhoneLamp.LAMPMODE_OFF, PhoneLamp.LAMPMODE_FLASH, PhoneLamp.LAMPMODE_STEADY, PhoneLamp.LAMPMODE_FLUTTER, PhoneLamp.LAMPMODE_BROKENFLUTTER, PhoneLamp.LAMPMODE_WINK, PhoneLamp.setMode(int mode)

PHONE_TERMINAL_MICROPHONE_GAIN_EVENT

public static final int PHONE_TERMINAL_MICROPHONE_GAIN_EVENT
The PHONE_TERMINAL_LAMP_MODE_EVENT event indicates that the gain of a PhoneMicrophone component has changed.

Applications may obtain the new gain of the PhoneMicrophone via the PhoneMicrophone.getGain() method.

See Also:
PhoneMicrophone.MUTE, PhoneMicrophone.MID, PhoneMicrophone.FULL, PhoneMicrophone.setGain(int gain)

PHONE_TERMINAL_RINGER_PATTERN_EVENT

public static final int PHONE_TERMINAL_RINGER_PATTERN_EVENT
The PHONE_TERMINAL_RINGER_PATTERN_EVENT event indicates that the pattern of a ringer component has changed.

Applications may obtain the new pattern of the of the ringer component via the PhoneRinger.getRingerPattern() method.

See Also:
PhoneRinger.setRingerPattern(int ringerPattern)

PHONE_TERMINAL_RINGER_VOLUME_EVENT

public static final int PHONE_TERMINAL_RINGER_VOLUME_EVENT
The PHONE_TERMINAL_RINGER_VOLUME_EVENT event indicates that the volume of a ringer component has changed.

Applications may obtain the new volume of the ringer component via the PhoneRinger.getRingerVolume() method.

See Also:
PhoneRinger.FULL, PhoneRinger.MIDDLE, PhoneRinger.OFF, PhoneRinger.setRingerVolume(int volume)

PHONE_TERMINAL_SPEAKER_VOLUME_EVENT

public static final int PHONE_TERMINAL_SPEAKER_VOLUME_EVENT
The PHONE_TERMINAL_SPEAKER_VOLUME_EVENT event indicates that the volume of a speaker component has changed.

Applications may obtain the new volume of the speaker component via the PhoneSpeaker.getVolume() method.

See Also:
PhoneSpeaker.MUTE, PhoneSpeaker.MID, PhoneSpeaker.FULL, PhoneSpeaker.setVolume(int volume)

PHONE_TERMINAL_BUTTON_PRESS_THRESHOLD_EXCEEDED_EVENT

public static final int PHONE_TERMINAL_BUTTON_PRESS_THRESHOLD_EXCEEDED_EVENT
The PHONE_TERMINAL_BUTTON_PRESS_THRESHOLD_EXCEEDED_EVENT event indicates that the indicated button has been pressed for longer than the requested time threshold.

First this event is sent (if the threshold is exceeded), then the PHONE_TERMINAL_BUTTON_PRESSED_EVENT is sent (since the second event represents a complete button pressed in, button released again action).

The PHONE_TERMINAL_BUTTON_PRESSED_EVENT will now provide the time duration that the button was actually pressed and held before the user released it. Applications may obtain the actual duration that the button was held via the getPressedDuration() method (which has a meaningful value for this event).

An application that is not interested in button press durations may simply implement the PHONE_TERMINAL_BUTTON_PRESSED_EVENT method in their listener object and ignore the PHONE_TERMINAL_BUTTON_PRESS_THRESHOLD_EXCEEDED_EVENT event (returning a corresponding canSetButtonPressThreshold capability value).

Method Detail

getPhoneCause

public int getPhoneCause()
Returns the phone causes associated with this event.
Returns:
The cause of the event.

getComponentGroup

public ComponentGroup getComponentGroup()
Returns the ComponentGroup object associated with this event.

Returns:
The ComponentGroup object associated with this event.

getComponent

public Component getComponent()
Returns the Component object responsible for this event.

Returns:
The Component object responsible for this event.

getInfo

public java.lang.String getInfo()
Returns the button information.

Returns:
The string button information.

getOldInfo

public java.lang.String getOldInfo()
Returns the information previously associated with this button.

Returns:
The old button information.

getDisplay

public java.lang.String getDisplay(int x,
                                   int y)
Returns the displayed string starting at coordinates (x, y).

Parameters:
x - The x-coordinate.
y - The y-coordinate.
Returns:
The string displayed starting at coordinates (x, y).

getHookSwitchState

public int getHookSwitchState()
Returns the current state of the hookswitch.

Returns:
The current state of the hookswitch.

getMode

public int getMode()
Returns the current lamp mode.

Returns:
The current lamp mode.

getGain

public int getGain()
Returns the gain of the microphone.

Returns:
The gain of the microphone.

getRingerPattern

public int getRingerPattern()
Returns the pattern of the ringer.

Returns:
The pattern of the ringer.

getVolume

public int getVolume()
Returns the volume of the ringer or speaker (depending on event).

Returns:
The volume of the ringer or speaker (depending on event).

getPressedDuration

public int getPressedDuration()
Returns the duration of time starting when a user first pressed and held a button, and ending when the user releases the button. The value is in milliseconds.

Since:
1.4

JSR-043: JTAPI-1.4

Send comments to: JSR-43@ectf.org