public interface TripEventManager
TripEvent.Listener
with the registerTripEventListener
API.
Note: This interface (and any containing interfaces) is still in beta and might be subject to change.
Modifier and Type | Method and Description |
---|---|
void |
addEvent(int offset,
int length,
org.json.JSONObject attributes,
TripEvent.ModifyListener listener)
Add a new TripEvent with the specified parameters.
|
void |
getAllEvents(TripEvent.ListListener listener)
Request a list of all the currently registered events.
|
void |
modifyEvent(TripEvent event,
int offset,
int length,
org.json.JSONObject attributes,
TripEvent.ModifyListener listener)
Modify an existing event.
|
void |
registerTripEventListener(TripEvent.Listener listener)
Register a TripEvent.Listener, to receive information when a TripEvent has been removed.
|
void |
removeAllEvents(TripEvent.ModifyListener listener)
Remove all currently registered events from the trip.
|
void |
removeEvent(TripEvent event,
TripEvent.ModifyListener listener)
Remove the specified event.
|
void |
unregisterTripEventListener(TripEvent.Listener listener)
Unregister a TripEvent.Listener.
|
void registerTripEventListener(TripEvent.Listener listener)
listener
- TripEvent.Listener
to receive information about the TripEvent objects.void unregisterTripEventListener(TripEvent.Listener listener)
listener
- The TripEvent.Listener
to unregister.java.lang.IllegalArgumentException
- if the listener is null or previously not registered.void addEvent(int offset, int length, org.json.JSONObject attributes, TripEvent.ModifyListener listener)
offset
- The offset for the event in meters. The offset is calculated from the start of the Trip until the start of the event.length
- The length for the event in meters.attributes
- The attributes of the event (see TripEvent
for options).listener
- TripEvent.ModifyListener
to receive the result of the operation.void modifyEvent(TripEvent event, int offset, int length, org.json.JSONObject attributes, TripEvent.ModifyListener listener)
event
- The TripEvent to modify.offset
- The offset for the event in meters. The offset is calculated from the start of the Trip until the start of the event.length
- The length for the event in meters.attributes
- The attributes of the event (see TripEvent
for options).listener
- TripEvent.ModifyListener
to receive the result of the operation.void removeEvent(TripEvent event, TripEvent.ModifyListener listener)
event
- The TripEvent to remove.listener
- TripEvent.ModifyListener
to receive the result of the operation.void getAllEvents(TripEvent.ListListener listener)
listener
- TripEvent.ListListener
to receive the result of the operation.void removeAllEvents(TripEvent.ModifyListener listener)
listener
- TripEvent.ModifyListener
to receive the result of the operation.