/*---------------------------------------------------------------------------*/
/* Eye-One IO C-Style API                                                    */
/* This API provides high-level methods to access the                        */
/* Eye-One devices from X-Rite Inc.                                          */
/*                                                                           */
/* Version 1.1                                                               */
/*                                                                           */
/* Copyright (c) 2004 - 2007 by X-Rite Inc.                                  */
/*                                                                           */
/* ALL RIGHTS RESERVED.                                                      */
/*                                                                           */
/* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS         */
/* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED         */
/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE        */
/* ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY           */
/* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL        */
/* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE         */
/* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS             */
/* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,              */
/* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING                 */
/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS        */
/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.              */
/*---------------------------------------------------------------------------*/
#ifndef EYE_ONE_IO_H
#define EYE_ONE_IO_H

#ifdef __cplusplus
  extern "C" {
#endif


/*----------------------- Eye-One Table error types -------------------------*/
#define I1_ADDITIONAL_ERRORS             /* Extend 'I1_ErrorType' with Eye-One Table errors */ \
  eNoI1Connected = 100,                  /* No Eye-One measure device connected */ \
  ePositionNotReachedError,              /* End Position not be reached */ \
  eIllegalPositionError,                 /* Position is out of range */ \
  eWhiteBaseError,                       /* Whitebase error */ \
  eI1LibraryError                        /* Error in Eye-One framework/dll */



/*---------------------------------------------------------------------------*/

#include "EyeOne.h"


/*---------------------------------------------------------------------------*/
/* definitions for specific key/values used with I1_GetOption() */

/* Eye-One IO key/values */
#define I1T_VERSION                       "I1TVersion"
#define I1T_MAJOR_VERSION                 "I1TMajorVersion"
#define I1T_MINOR_VERSION                 "I1TMinorVersion"
#define I1T_REVISION_VERSION              "I1TRevisionVersion"
#define I1T_BUILD_VERSION                 "I1TBuildVersion"
#define I1T_SERIAL_NUMBER                 "I1TSerialNumber"
#define I1T_IS_CONNECTED                  "I1TConnection"
#define I1T_I1_SERIAL_NUMBER              "I1TI1SerialNumber"
#define I1T_HOLD_POSITION                 "I1THoldPosition"
#define I1T_ENABLE_ELECTROSTATIC_FOIL     "I1TEnableElectrostaticFoil"
#define I1T_ENABLE_ELECTROSTATIC_FOIL_BUTTON  "I1TEnableElectrostaticFoilButton"
#define I1T_LAST_WHITE_BASE_TRANSFER_TIME "I1TLastWhiteBaseTransferTime"
#define I1T_FIRMWARE_VERSION              "I1TFirmwareVersion"

#define I1T_MOVE_SPEED                    "I1TMoveSpeed"
#define I1T_SCAN_SPEED                    "I1TScanSpeed"
#define I1T_SCAN_DELAY                    "I1TScanDelay"

#define I1T_USE_VISOR_COORDINATE          "I1TIsVisorCoordinate"

#define I1T_ALL                           "I1TAll"  /*reset parameter*/


/*--------------------- prototypes of exported functions --------------------*/
/* General remarks:
The FPtr_I1_XXX typedefs (i.e. FPtr_I1_Calibrate) are declared to simplify the
process of getting a reference to the desired method(s) while dynamic loading this library
*/


/*------------------------ Eye-One Table functions --------------------------*/
/*Test if the current Eye-One is connected to the Eye-One Table
return eNoError if the Eye-One Table is connected and an Eye-One is connected to the table
return eNoI1Connected if an Eye-One Table is connected but no Eye-One
return eDeviceNotConnected if no Eye-One Table is present
*/
I1_ErrorType I1_IsTableConnected(void);
typedef I1_ErrorType (* FPtr_I1_IsTableConnected)(void);

/*
Get the position of the arms of the Eye-One Table
*/
I1_ErrorType I1_GetPosition(float *positionX, float *positionY);
typedef I1_ErrorType (* FPtr_I1_GetPosition)(float *, float *);

/*
Moves the arms of Eye-One Table to the specified position
*/
I1_ErrorType I1_SetPosition(float positionX, float positionY);
typedef I1_ErrorType (* FPtr_I1_SetPosition)(float, float);

/*
Moves the arms of Eye-One Table to the white tile
*/
I1_ErrorType I1_GoToHomePosition(void);
typedef I1_ErrorType (* FPtr_I1_GoToHomePosition)(void);

/*
Scans with the Eye-One from position begin to position end
*/
I1_ErrorType I1_Scan(float startPosX, float startPosY, float endPosX, float endPosY);
typedef I1_ErrorType (* FPtr_I1_Scan)(float, float, float, float);


#ifdef __cplusplus
  }
#endif


#endif /*EYE_ONE_IO_H*/