eu.gnome.morena
Interface Scanner

All Superinterfaces:
Device, Version
All Known Implementing Classes:
ICAScanner, WIAScanner

public interface Scanner
extends Device

Interface representing a scanner device that allows a control over parameters that can be set before scanning when a native device driver UI is not displayed.


Field Summary
static int BLACK_AND_WHITE
           
static int DUPLEX_AVAIL
           
static int DUPLEX_AVAIL_BACK_ONLY
           
static int DUPLEX_AVAIL_FRONT_ONLY
           
static int DUPLEX_NOT_AVAIL
           
static int GRAY_16
           
static int GRAY_8
           
static int RGB_16
           
static int RGB_8
           
 
Fields inherited from interface eu.gnome.morena.Version
BUILD_DATE, BUILD_TIME, TMP_DIR, VERSION, VERSION_BUILD, VERSION_MAJOR, VERSION_MINOR
 
Method Summary
 void cancelTransfer()
          Stop scanning in progress.
 int getFeederFunctionalUnit()
          Get feeder functional unit.
 int getFlatbedFunctionalUnit()
          Get flatbed functional unit.
 int getFunctionalUnit()
           
 int getMode()
          Gets a current color mode
 int getResolution()
          Gets current scanning resolution.
 java.util.List<java.lang.Integer> getSupportedModes()
          Gets supported color modes
 java.util.List<java.lang.Integer> getSupportedResolutions()
          Gets supported scanning resolutions.
 boolean isDuplexEnabled()
           
 boolean isDuplexSupported()
           
 void setDuplexEnabled(boolean enabled)
           
 void setFrame(int x, int y, int width, int height)
          Sets area of scanning in pixels.
 void setFunctionalUnit(int unit)
           
 void setMode(int mode)
          Sets a color mode
 void setResolution(int resolution)
          Sets scanning resolution.
 void startTransfer(TransferDoneListener transferDoneListener, int functionalUnit)
          Scanning from specified functional unit.
 
Methods inherited from interface eu.gnome.morena.Device
setupDevice, startTransfer, startTransfer, toString
 

Field Detail

RGB_8

static final int RGB_8
See Also:
Constant Field Values

GRAY_8

static final int GRAY_8
See Also:
Constant Field Values

RGB_16

static final int RGB_16
See Also:
Constant Field Values

GRAY_16

static final int GRAY_16
See Also:
Constant Field Values

BLACK_AND_WHITE

static final int BLACK_AND_WHITE
See Also:
Constant Field Values

DUPLEX_NOT_AVAIL

static final int DUPLEX_NOT_AVAIL
See Also:
Constant Field Values

DUPLEX_AVAIL

static final int DUPLEX_AVAIL
See Also:
Constant Field Values

DUPLEX_AVAIL_FRONT_ONLY

static final int DUPLEX_AVAIL_FRONT_ONLY
See Also:
Constant Field Values

DUPLEX_AVAIL_BACK_ONLY

static final int DUPLEX_AVAIL_BACK_ONLY
See Also:
Constant Field Values
Method Detail

getMode

int getMode()
Gets a current color mode

Returns:
- color mode
See Also:
RGB_8, RGB_16, GRAY_8, GRAY_16, BLACK_AND_WHITE

setMode

void setMode(int mode)
Sets a color mode

Parameters:
mode - - color mode
See Also:
RGB_8, RGB_16, GRAY_8, GRAY_16, BLACK_AND_WHITE

getSupportedModes

java.util.List<java.lang.Integer> getSupportedModes()
Gets supported color modes

Returns:
- list of color modes
See Also:
RGB_8, RGB_16, GRAY_8, GRAY_16, BLACK_AND_WHITE

getResolution

int getResolution()
Gets current scanning resolution.

Returns:
resolution - DPI

setResolution

void setResolution(int resolution)
Sets scanning resolution.

Parameters:
resolution - - DPI

getSupportedResolutions

java.util.List<java.lang.Integer> getSupportedResolutions()
Gets supported scanning resolutions.

Returns:
list of supported resolutions - DPI

setFrame

void setFrame(int x,
              int y,
              int width,
              int height)
Sets area of scanning in pixels.

Parameters:
x -
y -
width -
height -

startTransfer

void startTransfer(TransferDoneListener transferDoneListener,
                   int functionalUnit)
                   throws java.lang.Exception
Scanning from specified functional unit. This method initiates an image transfer from specified functional unit of this device. TransferDoneListener provided is a callback handler that handles a result of the transfer. Since the transfer process is asynchronous by nature it should be considered that this method call does not wait for the transfer is to be completed.

Parameters:
transferDoneListener - - specifies the handler of the transferred image.
functionalUnit - - specifies the functional unit.
Throws:
java.lang.Exception

cancelTransfer

void cancelTransfer()
Stop scanning in progress.


getFunctionalUnit

int getFunctionalUnit()
Returns:
currently selected functional unit

setFunctionalUnit

void setFunctionalUnit(int unit)
Parameters:
unit - - functional unit to be selected

getFlatbedFunctionalUnit

int getFlatbedFunctionalUnit()
Get flatbed functional unit. Implementation note: functional unit is not recognized in WIA1 interface (Windows XP).

Returns:
functional unit id or -1 if not present or recognized.

getFeederFunctionalUnit

int getFeederFunctionalUnit()
Get feeder functional unit. Implementation note: functional unit is not recognized in WIA1 interface (Windows XP).

Returns:
functional unit id or -1 if not present or recognized.

isDuplexSupported

boolean isDuplexSupported()

isDuplexEnabled

boolean isDuplexEnabled()

setDuplexEnabled

void setDuplexEnabled(boolean enabled)