Package totalcross.io.device.scanner
Class ScanEvent
- java.lang.Object
-
- totalcross.ui.event.Event<ScanHandler>
-
- totalcross.io.device.scanner.ScanEvent
-
public class ScanEvent extends Event<ScanHandler>
ScanEvent is an event thrown by the barcode scanner. Used in the Scanner class.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class totalcross.ui.event.Event
Event.Type<H>
-
-
Field Summary
Fields Modifier and Type Field Description static intBATTERY_ERRORThe event type for a scanner low battery event.java.lang.StringdataThe data resulting from the scan when type isSCANNED.static intSCANNEDThe event type for a scanner scanning event.static intTRIGGEREDThe event type for a scanner triggered: A scan attempt was initiated - hard or soft trigger.
-
Constructor Summary
Constructors Constructor Description ScanEvent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispatch(ScanHandler listener)voidupdate(int type)Updates a scan event with the given type.-
Methods inherited from class totalcross.ui.event.Event
clearQueue, getNextAvailableEventId, isAvailable, toString, touch
-
-
-
-
Field Detail
-
SCANNED
public static final int SCANNED
The event type for a scanner scanning event.- See Also:
- Constant Field Values
-
BATTERY_ERROR
public static final int BATTERY_ERROR
The event type for a scanner low battery event.- See Also:
- Constant Field Values
-
TRIGGERED
public static final int TRIGGERED
The event type for a scanner triggered: A scan attempt was initiated - hard or soft trigger.- See Also:
- Constant Field Values
-
data
public java.lang.String data
The data resulting from the scan when type isSCANNED.
-
-
Method Detail
-
update
public void update(int type)
Updates a scan event with the given type. target is always null.
-
dispatch
public void dispatch(ScanHandler listener)
- Specified by:
dispatchin classEvent<ScanHandler>
-
-