
#ifndef INTERFACE_ECC200_H
#define INTERFACE_ECC200_H

// coding schemes 
enum T_SCHEME {schAUTO=0,schASC, schC40, sch256, schEDF, schTXT, schX12, schCNT};

 // type of data being encoded 
enum T_DATA {
  TD_BINARY = 0,                // ASCII or BINARY DATA (as default)
  TD_GS1,                       // data according to GS1 type standard (FNC1 in 1/5 CW) 
  TD_SECTORAL,                  // data conforms to some industry standard (FNC1 in 2/6 CW) 
  TD_MAX
 };

 // character dimensions 
 enum T_DIMENSION {
  dim_auto =-1,                                         // auto
  dim_10_10=0, dim_12_12  , dim_14_14  , dim_16_16  ,   // square         // 0- 3
  dim_18_18  , dim_20_20  , dim_22_22  , dim_24_24  ,   //                // 4- 7
  dim_26_26  , dim_32_32  , dim_36_36  , dim_40_40  ,   //                // 8-11
  dim_44_44  , dim_48_48  , dim_52_52  , dim_64_64  ,   //                //12-15
  dim_72_72  , dim_80_80  , dim_88_88  , dim_96_96  ,   //                //16-19
  dim_104_104, dim_120_120, dim_132_132, dim_144_144,   //         square //20-23
  dim_18_8   , dim_32_8   , dim_26_12,                  // rectangle      //24-26
  dim_36_12  , dim_36_16  , dim_48_16,                  //      rectangle //27-29
  dim_MAX
 };

 const int dimentions_ess200[] =
 { 10,10,   12,12,   14,14,   16,16,   18,18,   20,20,   22,22,   24,24,
   26,26,   32,32,   36,36,   40,40,   44,44,   48,48,   52,52,   64,64,
   72,72,   80,80,   88,88,   96,96,   104,104, 120,120, 132,132, 144,144,
   8,18,    8,32,    12,26,   12,36,   16,36,   16,48                   };

 // The functions results codes
 enum T_RESULT {                  
	 DME_RES_OK = 0,    // Ok
	 DME_RES_LONG1,     // Too long text for this matrix size
	 DME_RES_LONG2,     // Too long text for all sizes
	 DME_RES_ANSIX12,   // Unresolved character in ANSIX12 encodation
	 DME_RES_EDIFACT,   // Unresolved character  for Edifact encodation
	 DME_RES_AU_FAIL,   // Authentication failure
	 DME_RES_TYPE,      // Type error
	 DME_RES_DIMENSION, // Dimension error
	 DME_RES_PARAMS,    // Invalid parameter
	 DME_RES_UNREGISTR, // Unregistered version SDK
	 DME_RES_UserID,    // User ID not found or error
	 DME_RES_STRUCTURE, // structure error
	 DME_RES_CRYPTO,    // data damaged (crypto error)
	 DME_RES_MATRIX,    // incorrect MATRIX
	 DME_RES_EMPTY,     // MATRIX is EMPTY (íåò êîäèðîâàííûõ äàííûõ)
	 DME_RES_ProdID,    // Product ID error
	 DME_RES_UNREALIZED,// Unrealized
	 DME_RES_ALGORITHM, // 
	 DME_RES_UNKNOWN    // UnKnown error
 };

extern "C" {

   // Create of the encoder object for working with ECC-200 symbology
	// Return value: pointer to object (SYMBOL) 
	void* __stdcall CreateSymbol_ECC200(void);

   // Delete of the encoder
   // Parameter: SYMBOL - pointer to object 
	void __stdcall DeleteSymbol_ECC200(void*SYMBOL);

   //                      SCHEME
   // Set the scheme of the data encoding 
	// Parameter: SYMBOL - pointer to object 
   //          schema - encoding scheme (0 - optimal encoding with min size) 
	// Return value: error code(values in T_RESULT)
   int __stdcall SetScheme_ECC200(void*SYMBOL,T_SCHEME schema);

   // Get the scheme of the encoding
	// Parameter: SYMBOL - pointer to object 
	// Return value: coding scheme number 
   T_SCHEME __stdcall GetScheme_ECC200(void*SYMBOL);

   //                      DIMENSION
   // Set the symbol dimensions 
	// Parameter: SYMBOL - pointer to object 
	// Return value: error code(values in T_RESULT)
   int __stdcall SetDimension_ECC200(void*SYMBOL,T_DIMENSION dim);

   // Get the dimensions of the symbol
	// Parameter: SYMBOL - pointer to object 
	// Return value: dimensions of the data matrix symbology
   T_DIMENSION __stdcall GetDimension_ECC200(void*SYMBOL);

   //                      Sign
   // Setting the sign of encryption of object data using UserID 
   // Parameter: SYMBOL - pointer to object 
   //           p - sign of encryption
	// Return value: error code(values in T_RESULT)
   int __stdcall SetSignUser_ECC200(void*SYMBOL,bool p);

   // Setting the sign of encryption of object data using ProductID
   // Parameter: SYMBOL - pointer to object 
   //           p - sign of encryption,
   //           ProductID - pointer to the product code string 
	// Return value: error code(values in T_RESULT)
   int __stdcall SetSignProduct_ECC200(void*SYMBOL, bool p, const char*ProductID);

   //                      
   // Set data to encoding
   // Parameter: SYMBOL - pointer to object 
   //              m,l - pointer to data, data length 
	// Return value: error code(values in T_RESULT)
   int __stdcall SetDataToEncoding_ECC200(void * SYMBOL, const char* m, int l);

   // Save of encoded symbol as BMP file
   // Parameter: SYMBOL - pointer to object
   //           modul  - module side size  (pixels)
   //           quiet  -width of the frame around the SYMBOL  (pixels)
   //           FileNamem - pointer to string with full image file name 
   // Return value: error code(values in T_RESULT)
   int __stdcall WriteEncodedSymbolToBMP_ECC200(void* SYMBOL, int modul, int quiet, char* FileName);

	// Write of encoded symbol to the buffer
	// Parameter: SYMBOL - pointer to object
	//           dest  - pointer to the buffer
	//           maxDestSize - max size of the buffer
	// Return value: error code(values in T_RESULT)
	int __stdcall WriteEncodedSymbolToBuf_ECC200(void* SYMBOL, unsigned char* dest, int maxDestSize);

   //                      Service

   // Clear of the encoder data
   // Parameter: SYMBOL - pointer to object
   void __stdcall Clear_ECC200(void* SYMBOL);

   const char* __stdcall Version_ECC200(void);
}//extern "C"

#endif