//  Copyright (C) 2018-2022  SEIKO EPSON CORPORATION
//
//  License: LGPL-2.1+
//  Author : SEIKO EPSON CORPORATION
//
//  This file is part of the 'Epson Scan 2' package.
//	 This library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Lesser General Public
//  License as published by the Free Software Foundation; either
//  version 2.1 of the License, or (at your option) any later version.

//  This library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//  
//  ESCI2Accessor.h -- template and derived ESC/I ESC/I-2 protocol commands
#pragma once

       
#include "ESCI2Command.h"
#include "Utils/event_caller.hpp"
class CESCI2Accessor : public CESCI2Command
{
public:
 CESCI2Accessor();
 virtual ~CESCI2Accessor();
 virtual ESErrorCode Initialize() override;
protected:
 ESErrorCode Open();
 ESErrorCode Close();
 bool IsOpened() const;
 void DeviceDisconnected() override;
 ESErrorCode SetPanelToPushScanReady( BOOL bPushScanReady );
 ESErrorCode UnlockAdministratorLock();
 ESErrorCode LockAdministratorLock();
 bool RequestingUnlockAdminLock();
 BOOL IsScannableDeviceConfig();
 ESErrorCode CaptureScanner();
 ESErrorCode ReleaseScanner();
 ESErrorCode StartJobInMode( ESJobMode eJobMode );
 ESErrorCode StopJobInMode( ESJobMode eJobMode );
 ESErrorCode StartJobInStandard();
 ESErrorCode StopJobInStandard();
 ESErrorCode StartJobInContinue();
 ESErrorCode StopJobInContinue();
protected:
 ESErrorCode ParametersForScan( ESDictionaryA& dicParameter );
 ESIndexSet ErrorsForInterruption();
 ESErrorCode ScanInContext();
 ESErrorCode TransferImage();
 ESErrorCode Scan();
 ESErrorCode ScanForAFM();
 ESErrorCode ScanForAFMC();
 static void* DoScanForAFMInBackground(void* pParam);
 static void* DoScanForAFMCInBackground(void *pParam);
 static void* DoStopScanningInAutoFeedingModeInBackground(void *pParam);
 ESErrorCode ScanForAFMInBackground();
 ESErrorCode ScanForAFMCInBackground();
 ESErrorCode ProcessPageStartInfo( ESDictionaryA& dicInfo, ESAnyArray* pStrDocumentType, ESStringA& strSurface );
 ESErrorCode ProcessImageDataBlock( ES_CMN_FUNCS::BUFFER::CESHeapBuffer& cDataBuffer, ESStringA& strSurface );
 ESErrorCode ProcessPageEndInfo( ESDictionaryA& dicInfo, ESStringA& strSurface, bool bIsDoubleFeed ,ESAnyArray* pStrDocumentTypes);
 ESErrorCode StopScanningInAutoFeedingMode();
 ESErrorCode StopScanningInAutoFeedingModeInBackground();
 ESErrorCode StartAFM();
 ESErrorCode StopAFM();
 ESErrorCode StartAFMC();
 ESErrorCode StopAFMC();
 ESErrorCode StartScanningInAFM();
 ESErrorCode StopScanningInAFM();
 ESErrorCode StartScanningInAFMC();
 ESErrorCode StopScanningInAFMC();
 ESErrorCode ScheduleAutoFeedingModeTimeout();
 ESErrorCode InvalidateAutoFeedingModeTimeout();
 ESErrorCode Cancel();
 ESErrorCode Abort();
 void DisposeImageHandles();
 void AbortImageHandles();
 void NotifyBeginContinuousScanning();
 void NotifyEndContinuousScanning();
 void NotifyCompleteScanningWithError( ESErrorCode err );
 void NotifyInterruptScanningWithError( ESErrorCode err );
 void NotifyWillScanToScannedImage( IESScannedImage* pImage );
 void NotifyDidScanToScannedImage( IESScannedImage* pImage );
 virtual ESErrorCode CallDelegateScannerDidPressButton( UInt8 un8ButtonNumber ) override;
 virtual ESErrorCode CallDelegateNetworkScannerDidRequestStartScanning() override;
 virtual ESErrorCode CallDelegateScannerDidRequestStop() override;
 virtual void CALLBACK DidRequestStopScanning() override;
 virtual void CALLBACK DidDisconnect() override;
 virtual void CALLBACK DeviceCommunicationError(ESErrorCode err) override;
 virtual void CALLBACK DidRequestGetImageData() override;
 void StartButtonChecking();
 void StopButtonChecking();
protected:
 ESErrorCode Setup();
 ESErrorCode GetInfo();
 ESErrorCode GetExtInfo();
 ESErrorCode GetMaintenanceInfo();
 ESErrorCode GetMaintenanceStatus();
 ESErrorCode GetCapabilities();
 ESErrorCode GetMaintenanceCapabilities();
 ESErrorCode GetStatus();
 ESErrorCode GetResults();
 ESErrorCode ResetParametersForKeys( ESStringArrayA* parKeys );
 ESErrorCode Reset();
 ESErrorCode WaitUntilSetForcus(ESFloat* pfOutFocus);
 virtual ESString GetVersion();
 ESErrorCode GetErrorStatus();
 bool IsErrorCodeSupported();
 ESNumber GetErrorCode();
 ESBatteryStatus GetBatteryStatus();
 ESWarningStatus GetWarningStatus();
 bool IsExtInformationSupported();
 bool IsAuthenticationSupported() override;
 bool IsAuthenticationEnabled() override;
 ESErrorCode SetAuthenticationEnabled( bool bEnabled );
 virtual ESString GetAuthUserName() override;
 virtual ESErrorCode SetAuthUserName( ESString strAuthUserName );
 virtual ESString GetAuthPassword() override;
 virtual ESErrorCode SetAuthPassword( ESString strAuthPassword );
 virtual bool IsAdminLockSupported()override;
 virtual bool IsAdminLockEnabled()override;
 virtual bool IsAdminLockEnabledWithUnlockTest(bool bUnlockTest)override;
 virtual ESString GetAdminLockPassword()override;
 virtual ESErrorCode SetAdminLockPassword(ESString strPassword)override;
 virtual ESString GetProductName() override;
 ESString GetSerialNumber();
 bool IsInterruptionEnabled();
 ESErrorCode SetInterruptionEnabled( bool bIsInterruptionEnabled );
 bool IsLengthPaddingSupported();
 bool IsGuidelessADF();
 bool IsAutoFeedingModeSupported();
 bool IsLegacyAFMSupported();
 bool IsContinuousAutoFeedingModeSupported();
 ESNumber GetAutoFeedingModeTimeout();
 ESErrorCode SetAutoFeedingModeTimeout( ESNumber nAutoFeedingModeTimeout );
 ESIndexSet GetSupportedFunctionalUnitTypes();
 virtual ESFunctionalUnitType GetFunctionalUnitType() override;
 ESErrorCode SetFunctionalUnitType( ESNumber nFunctionalUnitType );
 ESAny GetFunctionalUnitSpecificResolutions();
 ESAny GetSupportedXResolutions();
 ESAny GetSupportedYResolutions();
 ESNumber GetXResolution();
 ESNumber GetYResolution();
 ESErrorCode SetXResolution( ESNumber xResolution );
 ESErrorCode SetYResolution( ESNumber yResolution );
 ESNumber GetOpticalResolution();
 ST_ES_SIZE_F GetMaxImagePixels();
 ST_ES_SIZE_F GetMaxScanSize();
 bool IsMaxScanSizeInNormalSpeedSupported();
 ST_ES_SIZE_F GetMaxScanSizeInNormalSpeed();
 ST_ES_SIZE_F GetMaxScanSizeInLongLength();
 ST_ES_SIZE_F GetMaxScanSizeInLongLengthWithResolution( ESNumber nResolution );
 ST_ES_SIZE_F GetMinScanSize();
 ESDicArray GetMaxLongLengthTable();
 ESErrorCode SetScanArea( ST_ES_RECT_F rcArea, bool bShouldAlign );
 ST_ES_RECT_F GetScanArea();
 ESErrorCode SetScanArea( ST_ES_RECT_F rcScanArea );
 ST_ES_RECT_UN32 GetScanAreaInPixel() override;
 ESErrorCode SetScanAreaInPixel( ST_ES_RECT_UN32 rcScanAreaInPixel, bool bShouldAlign );
 ESErrorCode SetScanAreaInPixel( ST_ES_RECT_UN32 rcScanAreaInPixel );
 ST_ES_SIZE_F GetScanSize();
 ESErrorCode SetScanSize( ST_ES_SIZE_F sizeScan );
 ST_ES_SIZE_UN32 GetScanSizeInPixel();
 ESErrorCode SetScanSizeInPixel( ST_ES_SIZE_UN32 sizeScan );
 ESFloat GetXOffsetMargin();
 ESErrorCode SetXOffsetMargin( ESFloat fMargin );
 ESFloat GetYOffsetMargin();
 ESErrorCode SetYOffsetMargin( ESFloat fMargin );
 bool IsAfmEnabled() const;
 ESErrorCode SetAfmEnabled( bool bEnable );
 BOOL IsPushScanReadySupported();
 ESIndexSet GetSupportedJobModes();
 ESJobMode GetJobMode();
 ESErrorCode SetJobMode( ESJobMode eJobMode );
 bool IsDisableJobContinue();
 ESErrorCode SetDisableJobContinue( bool bDisableJobContinue );
 bool IsDisableKeepingCapture();
 ESErrorCode SetDisableKeepingCapture( bool bDisableKeepingCapture );
 ESGuidePosition GetGuidePosition();
 ESIndexSet GetSupportedColorFormats();
 ESNumber GetColorFormat();
 ESErrorCode SetColorFormat( ESNumber nColorFormat );
 ESIndexSet GetSupportedColorCounterTypes();
 ESNumber GetColorCounterType();
 ESErrorCode SetColorCounterType( ESNumber nColorCounterType );
 ESNumber GetBitsPerSample();
 ESNumber GetSamplesPerPixel();
 ESNumber GetBitsPerPixel();
 ESIndexSet GetSupportedImageFormats();
 ESImageFormat GetImageFormat();
 ESErrorCode SetImageFormat( ESNumber nImageFormat );
 ESIndexSet GetSupportedGammaModes();
 ESGammaMode GetGammaMode();
 ESErrorCode SetGammaMode( ESNumber nGammaMode );
 ESIndexSet GetSupportedGammaChannels();
 ESAny GetGammaTableForChannel( ESGammaChannel eChannel );
 ESAny GetGammaTableMono ();
 ESAny GetGammaTableRed ();
 ESAny GetGammaTableGreen();
 ESAny GetGammaTableBlue ();
 ESErrorCode SetGammaTable( ESIndexArray arGammaTable, ESGammaChannel eChannel );
 ESErrorCode SetGammaTableMono ( ESIndexArray arGammaTable );
 ESErrorCode SetGammaTableRed ( ESIndexArray arGammaTable );
 ESErrorCode SetGammaTableGreen( ESIndexArray arGammaTable );
 ESErrorCode SetGammaTableBlue ( ESIndexArray arGammaTable );
 ESIndexSet GetSupportedColorMatrixModes();
 ESColorMatrixMode GetColorMatrixMode();
 ESErrorCode SetColorMatrixMode( ESNumber nColorMatrixMode );
 ESAny GetColorMatrix();
 ESErrorCode _SetColorMatrix( ES_COLOR_MATRIX& matrix );
 ESErrorCode SetColorMatrix( ESFloatArray arColorMatrix );
 bool IsSkewCorrectionSupported();
 bool IsSkewCorrectionEnabled();
 ESErrorCode SetSkewCorrectionEnabled( bool bSkewCorrectionEnabled );
 ESAny GetSupportedThreshold();
 ESNumber GetThreshold();
 ESErrorCode SetThreshold( ESNumber nThreshold );
    ESAny GetSupportedSharpnessLevel();
    ESNumber GetSharpnessLevel();
    ESErrorCode SetSharpnessLevel( ESNumber nSharpnessLevel );
    ESAny GetSupportedContrast();
    ESNumber GetContrast();
    ESErrorCode SetContrast( ESNumber nContrast );
    ESAny GetSupportedBrightness();
    ESNumber GetBrightness();
    ESErrorCode SetBrightness( ESNumber nBrightness );
    ESAny GetSupportedGammaScale();
    ESNumber GetGammaScale();
    ESErrorCode SetGammaScale( ESNumber nGammaScale );
 virtual bool IsDetectBlankPageSupported();
 virtual bool IsDetectBlankPageEnabled();
 virtual ESErrorCode SetDetectBlankPageEnabled( bool nDetectBlankPageLevel );
 virtual ESAny GetSupportedDetectBlankPageLevel();
 virtual ESNumber GetDetectBlankPageLevel();
 virtual ESErrorCode SetDetectBlankPageLevel( ESNumber nDetectBlankPageLevel );
 virtual bool IsDetectColorTypeSupported();
 virtual bool IsDetectColorTypeEnabled();
 virtual ESErrorCode SetDetectColorTypeEnabled( bool nDetectBlankPageLevel );
 virtual bool IsSkipImageSupported();
 virtual bool IsSkipImageEnabled();
 virtual ESErrorCode SetSkipImageEnabled( bool nDetectBlankPageLevel );
    ESAny GetSupportedBackGroundRemoval();
    ESNumber GetBackGroundRemoval();
    ESErrorCode SetBackGroundRemoval( ESNumber nBackGroundRemoval );
 ESErrorCode DoAutoFocus(ESFloat* pfOutFocus);
 bool IsAutoFocusSupported();
 bool IsManualFocusSupported();
 ESFloat GetFocus();
 ESFloat GetMaxFocus();
 ESFloat GetMinFocus();
 ESErrorCode SetFocus(ESFloat fFocus);
 ESAny GetSupportedJPEGQuality();
 ESNumber GetJPEGQuality();
 ESErrorCode SetJPEGQuality( ESNumber nJPEGQuality );
 ESIndexSet GetSupportedQuietModes();
 ESQuietMode GetQuietMode();
 ESErrorCode SetQuietMode( ESNumber nQuietMode);
 bool IsAutoCroppingSupported();
 bool IsAutoCroppingEnabled();
 ESErrorCode SetAutoCroppingEnabled( bool bAutoCroppingEnabled );
 bool IsAutoCroppingInscribedSupported();
 bool IsAutoCroppingInscribedEnabled();
 ESErrorCode SetAutoCroppingInscribedEnabled( bool bAutoCroppingEnabled );
 ESAny GetCroppableResolutions();
 ESAny GetSupportedCroppingSizes();
 ESFloat GetCroppingSize();
 ESErrorCode SetCroppingSize( ESFloat fCroppingSize );
 ESNumber GetBufferSize();
 ESErrorCode SetBufferSize( ESNumber nBufferSize );
 ESNumber GetDeviceMaxBufferSize() override;
 ESAny GetSupportedFilmType();
 ESNumber GetFilmType();
 ESErrorCode SetFilmType(ESNumber nFilmType);
 bool IsDocumentSizeDetectionSupported();
 ST_ES_SIZE_F GetDetectedDocumentSize();
 ESIndexSet GetSupportedLaminatedPaperModes();
 ESLaminatedPaperMode GetLaminatedPaperMode();
 ESErrorCode SetLaminatedPaperMode( ESNumber nLaminatedPaperMode );
 bool IsFeederSupported();
 bool IsFeederEnabled();
 bool IsAutoScanSupported();
 bool IsFeedTypeADF() override;
    bool IsAdfLoadSupported() override;
 bool IsSupportedScanningMode();
 ESNumber GetScanningMode();
 ESErrorCode SetScanningMode( ESNumber nScanningMode);
 bool IsCarrierSheetDetectionSupported();
 ESDuplexType GetDuplexType();
 bool IsDuplexSupported();
 bool IsDuplexEnabled() override;
 ESErrorCode SetDuplexEnabled( bool bEnabled );
 bool IsPaperEndDetectionSupported();
 bool IsPaperEndDetectionEnabled();
 ESErrorCode SetPaperEndDetectionEnabled( bool bPaperEndDetectionEnabled );
 bool IsOverScanSupported();
 bool IsOverScanEnabled();
 ESErrorCode SetOverScanEnabled( bool bOverScanEnabled );
 bool IsOverScanForCroppingSupported();
 bool IsOverScanForCroppingEnabled();
 ESErrorCode SetOverScanForCroppingEnabled( bool bOverScanEnabled );
 bool IsPassportCarrierSheetSupported();
 bool IsPassportCarrierSheetEnabled();
 ESErrorCode SetPassportCarrierSheetEnabled(bool bEnabled);
 ESIndexSet GetSupportedDoubleFeedDetections();
 ESDoubleFeedDetection GetDoubleFeedDetection();
 ESErrorCode SetDoubleFeedDetection( ESNumber nDoubleFeedDetection );
 ESIndexSet GetSupportedBGColors();
 ESBGColor GetBGColor();
 ESErrorCode SetBGColor(ESNumber nBGColor);
 bool IsDoubleFeedDetectionRangeSupported();
 ESFloat GetMinDoubleFeedDetectionRangeLength();
 ESFloat GetDoubleFeedDetectionRangeOffset();
 ESErrorCode SetDoubleFeedDetectionRangeOffset( ESFloat fDoubleFeedDetectionRangeOffset );
 ESFloat GetDoubleFeedDetectionRangeLength();
 ESErrorCode SetDoubleFeedDetectionRangeLength( ESFloat fDoubleFeedDetectionRangeLength );
 bool IsLengthDoubleFeedDetectionSupported();
 bool IsLengthDoubleFeedDetectionEnabled();
 ESErrorCode SetLengthDoubleFeedDetectionEnabled( bool bLengthDoubleFeedDetectionEnabled );
 ESFloat GetMaxLengthDoubleFeedDetectionLength();
 ESFloat GetLengthDoubleFeedDetectionLength();
 ESErrorCode SetLengthDoubleFeedDetectionLength( ESFloat fLengthDoubleFeedDetectionLength);
 bool IsImageDoubleFeedDetectionSupported();
 bool IsImageDoubleFeedDetectionEnabled();
 ESErrorCode SetImageDoubleFeedDetectionEnabled( bool bImageDoubleFeedDetectionEnabled );
 bool IsImagePaperProtectionSupported();
 bool IsImagePaperProtectionEnabled();
 ESErrorCode SetImagePaperProtectionEnabled( bool bImagePaperProtectionEnabled );
 ESStringA GetDocumentSeparationSTAT();
 bool IsDocumentSeparationSupported();
 bool IsDocumentSeparationEnabled();
 ESNumber GetDocumentSeparation();
 ESDictionaryA GetUnavailableScanParameterSTAT();
 bool IsUnavailableScanParameterStatusSupported();
 ESIndexArray GetUnavailableScanParameterStatus();
 ESStringA GetScannerPositionSTAT();
 bool IsScannerPositionStatusSupported();
 ESNumber GetScannerPositionStatus();
 ESStringA GetCardScanningSTAT();
 bool IsCardScanningSupported();
 bool IsCardScanningEnabled();
 ESStringA GetSensorGlassSTAT();
 bool IsSensorGlassStatusSupported();
 ESNumber GetSensorGlassStatus();
 bool IsDocumentLoaded();
    ESNumber GetClientApplication();
    ESErrorCode SetClientApplication( ESNumber nClientApplication);
    ESIndexSet GetSupportedClientApplications();
 ESIndexSet GetSupportedEdgeFillColors();
 ESEdgeFillColor GetEdgeFillColor();
 ESErrorCode SetEdgeFillColor( ESNumber nEdgeFillColor );
 ESAny GetSupportedEdgeFillWidth();
 ESFloat GetEdgeFillWidthLeft();
 ESErrorCode SetEdgeFillWidthLeft( ESFloat fEdgeFillWidthLeft );
 ESFloat GetEdgeFillWidthRight();
 ESErrorCode SetEdgeFillWidthRight( ESFloat fEdgeFillWidthRight );
 ESFloat GetEdgeFillWidthTop();
 ESErrorCode SetEdgeFillWidthTop( ESFloat fEdgeFillWidthTop );
 ESFloat GetEdgeFillWidthBottom();
 ESErrorCode SetEdgeFillWidthBottom( ESFloat fEdgeFillWidthBottom );
 bool IsCleaningSupported();
 bool IsCalibrationSupported();
 ESNumber GetPagesToBeScanned();
 ESErrorCode SetPagesToBeScanned( ESNumber nPagesToBeScanned );
 bool IsCaptureCommandSupported();
 ESErrorCode SetCaptureCommandSupported( bool bSupported );
 bool IsCompressed();
protected:
 ESAny GetMaintenanceResultForKey( ESStringA strKey );
 ESErrorCode DoCleaning();
 ESErrorCode DoCalibration();
 bool IsPowerSaveSupported();
 ESAny GetSupportedPowerSaveTimes();
 ESNumber GetPowerSaveTime();
 ESErrorCode SetPowerSaveTime( ESNumber nPowerSaveTime );
 ESAny GetSupportedPowerOffTimes();
 ESNumber GetPowerOffTime();
 ESErrorCode SetPowerOffTime( ESNumber nPowerOffTime );
 ESAny GetSupportedPowerOffTimes2nd();
 ESNumber GetPowerOffTime2nd();
 ESErrorCode SetPowerOffTime2nd( ESNumber nPowerOffTime );
 ESAny GetSupportedFirstPCConnectionDates();
 ESString GetFirstPCConnectionDate();
 ESErrorCode SetFirstPCConnectionDate( ESString strFirstPCConnectionDate );
 ESIndexSet GetSupportedSensorGlassDirtSensitivities();
 ESNumber GetSensorGlassDirtSensitivity();
 ESErrorCode SetSensorGlassDirtSensitivity( ESNumber nGlassDirtSensitivity );
 ESAny GetSupportedSimplexScanCounters();
 ESNumber GetSimplexScanCounter();
 ESErrorCode SetSimplexScanCounter( ESNumber nSimplexScanCounter );
 ESAny GetSupportedDuplexScanCounters();
 ESNumber GetDuplexScanCounter();
 ESErrorCode SetDuplexScanCounter( ESNumber nDuplexScanCounter );
 ESAny GetSupportedSimplexCardScanCounters();
 ESNumber GetSimplexCardScanCounter();
 ESErrorCode SetSimplexCardScanCounter( ESNumber nSimplexCardScanCounter );
 ESAny GetSupportedDuplexCardScanCounters();
 ESNumber GetDuplexCardScanCounter();
 ESErrorCode SetDuplexCardScanCounter( ESNumber nDuplexCardScanCounter );
 ESAny GetSupportedDocumentFeederLamp1Counters();
 ESNumber GetDocumentFeederLamp1Counter();
 ESErrorCode SetDocumentFeederLamp1Counter( ESNumber nDocumentFeederLamp1Counter );
 ESAny GetSupportedDocumentFeederLamp2Counters();
 ESNumber GetDocumentFeederLamp2Counter();
 ESErrorCode SetDocumentFeederLamp2Counter( ESNumber nDocumentFeederLamp2Counter );
 ESAny GetSupportedPaperJamCounters();
 ESNumber GetPaperJamCounter();
 ESErrorCode SetPaperJamCounter( ESNumber nPaperJamCounter );
 ESAny GetSupportedUltraSonicDoubleFeedCounters();
 ESNumber GetUltraSonicDoubleFeedCounter();
 ESErrorCode SetUltraSonicDoubleFeedCounter( ESNumber nUltraSonicDoubleFeedCounter );
 ESAny GetSupportedLengthDoubleFeedCounters();
 ESNumber GetLengthDoubleFeedCounter();
 ESErrorCode SetLengthDoubleFeedCounter( ESNumber nLengthDoubleFeedCounter );
 ESAny GetSupportedImageDoubleFeedCounters();
 ESNumber GetImageDoubleFeedCounter();
 ESErrorCode SetImageDoubleFeedCounter( ESNumber nImageDoubleFeedCounter );
 ESAny GetSupportedPaperProtectionCounters();
 ESNumber GetPaperProtectionCounter();
 ESErrorCode SetPaperProtectionCounter(ESNumber nPaperProtectionCounter);
 ESAny GetSupportedRollerKitCounters();
 ESNumber GetRollerKitCounter();
 ESErrorCode SetRollerKitCounter( ESNumber nRollerKitCounter );
 ESAny GetSupportedRetardRollerCounters();
 ESNumber GetRetardRollerCounter();
 ESErrorCode SetRetardRollerCounter(ESNumber nRetardRollerCounter);
 ESAny GetSupportedPickupRollerCounters();
 ESNumber GetPickupRollerCounter();
 ESErrorCode SetPickupRollerCounter( ESNumber nPickupRollerCounter );
 ESAny GetSupportedSeparationPadCounters();
 ESNumber GetSeparationPadCounter();
 ESErrorCode SetSeparationPadCounter( ESNumber nSeparationPadCounter );
 ESAny GetSupportedSpecialDocumentCounters();
 ESNumber GetSpecialDocumentCounter();
 ESErrorCode SetSpecialDocumentCounter( ESNumber nSpecialDocumentCounter );
 ESAny GetSupportedPassportCarrierSheetCounters();
 ESNumber GetPassportCarrierSheetCounter();
 ESErrorCode SetPassportCarrierSheetCounter(ESNumber nCounter);
 ESAny GetSupportedScanCounters();
 ESNumber GetScanCounter();
 ESErrorCode SetScanCounter( ESNumber nScanCounter );
 ESAny GetSupportedFlatbedLamp1Counters();
 ESNumber GetFlatbedLamp1Counter();
 ESErrorCode SetFlatbedLamp1Counter( ESNumber nFlatbedLamp1Counter );
 ESAny GetSupportedFlatbedLamp2Counters();
 ESNumber GetFlatbedLamp2Counter();
 ESErrorCode SetFlatbedLamp2Counter( ESNumber nFlatbedLamp2Counter );
 ESAny GetSupportedDocumentTopCorrectionsFront();
 ESFloat GetDocumentTopCorrectionFront();
 ESErrorCode SetDocumentTopCorrectionFront( ESFloat fDocumentTopCorrectionFront );
 ESAny GetSupportedDocumentTopCorrectionsBack();
 ESFloat GetDocumentTopCorrectionBack();
 ESErrorCode SetDocumentTopCorrectionBack( ESFloat fDocumentTopCorrectionBack );
 ESAny GetSupportedDocumentDriveCorrectionsFront();
 ESFloat GetDocumentDriveCorrectionFront();
 ESErrorCode SetDocumentDriveCorrectionFront( ESFloat fDocumentDriveCorrectionFront );
 ESAny GetSupportedDocumentDriveCorrectionsBack();
 ESFloat GetDocumentDriveCorrectionBack();
 ESErrorCode SetDocumentDriveCorrectionBack( ESFloat fDocumentDriveCorrectionBack );
 ESAny GetSupportedLightIntensitiesBack();
 ESNumber GetLightIntensityBack();
 ESErrorCode SetLightIntensityBack( ESNumber nLightIntensityBack );
 bool IsDefaultPasswordTypeSupported();
 ESNumber GetDefaultPasswordType();
 ESAny GetSupportedDirectPowerOn();
 ESNumber GetDirectPowerOn();
 ESErrorCode SetDirectPowerOn(ESNumber nDirectPowerOn);
 ESAny GetSupportedNonConnectPowerOff();
 ESNumber GetNonConnectPowerOff();
 ESErrorCode SetNonConnectPowerOff(ESNumber nNonConnectPowerOff);
 ESAny GetSupportedADFPaperProtection();
 ESNumber GetADFPaperProtection();
 ESErrorCode SetADFPaperProtection(ESNumber nADFPaperProtection);
 ESAny GetSupportedBehaviorWhenDoubleFeed();
 ESNumber GetBehaviorWhenDoubleFeed();
 ESErrorCode SetBehaviorWhenDoubleFeed(ESNumber nBehaviorWhenDoubleFeed);
 ESAny GetSupportedCleaningWarningNotifyCount();
 ESNumber GetCleaningWarningNotifyCount();
 ESErrorCode SetCleaningWarningNotifyCount(ESNumber nCleaning);
 ESAny GetSupportedRollerKitNotifyCount();
 ESNumber GetRollerKitNotifyCount();
 ESErrorCode SetRollerKitNotifyCount(ESNumber nRKITNearEnd);
 ESAny GetSupportedRetardRollerNotifyCount();
 ESNumber GetRetardRollerNotifyCount();
 ESErrorCode SetRetardRollerNotifyCount(ESNumber nRTRLNearEnd);
 ESAny GetSupportedSeparationPadNotifyCount();
 ESNumber GetSeparationPadNotifyCount();
 ESErrorCode SetSeparationPadNotifyCount(ESNumber nSPADNearEnd);
 ESAny GetSupportedPickupRollerNotifyCount();
 ESNumber GetPickupRollerNotifyCount();
 ESErrorCode SetPickupRollerNotifyCount(ESNumber nPURLNearEnd);
 ESAny GetSupportedCleaningWarningCounter();
 ESNumber GetCleaningWarningCounter();
 ESErrorCode SetCleaningWarningCounter(ESNumber nCleaningWarningCounter);
 ESAny GetSupportedCleaningWarningNotify();
 ESNumber GetCleaningWarningNotify();
 ESErrorCode SetCleaningWarningNotify(ESNumber nCleaningWarningNotify);
 bool IsDocumentFeederBGLevelFrontSupported();
 ESDictionary GetDocumentFeederBGLevelFront();
 bool IsDocumentFeederBGLevelBackSupported();
 ESDictionary GetDocumentFeederBGLevelBack();
 bool IsPickupRollerLifeLimitSupported();
 ESNumber GetPickupRollerLifeLimit();
 bool IsSeparationPadLifeLimitSupported();
 ESNumber GetSeparationPadLifeLimit();
 bool IsRollerKitLifeLimitSupported();
 ESNumber GetRollerKitLifeLimit();
 bool IsRetardRollerLifeLimitSupported();
 ESNumber GetRetardRollerLifeLimit();
 bool IsPickupRollerNearendSupported();
 ESNumber GetPickupRollerNearend();
 bool IsSeparationPadNearendSupported();
 ESNumber GetSeparationPadNearend();
 bool IsRollerKitNearendSupported();
 ESNumber GetRollerKitNearend();
 bool IsRetardRollerNearendSupported();
 ESNumber GetRetardRollerNearend();
 ESAny GetSupportedCapability(const UInt32& key);
 ENUM_ES_HASH_TYPE GetMaintenanceHashType();
private :
 template <typename Function>
 void ForeachAnyArrayValue(const ESAny &anyValue, Function func) {
  if (!anyValue.empty()) {
   const ESAnyArray* pAnyArray = SafeAnyDataCPtr< ESAnyArray >(anyValue);
   if (pAnyArray) {
    for (auto key = pAnyArray->begin(); key != pAnyArray->end(); key++) {
     const ESStringA* pValue = SafeAnyDataCPtr< ESStringA >(*key);
     if (pValue) {
      func(FourCharCode(*pValue));
     }
    }
   }
  }
 };
 template <typename Function>
 void StringToNumberFromAnyValue(const ESAny &anyValue, Function func) {
  if (!anyValue.empty()) {
   const ESStringA* pValue = SafeAnyDataCPtr< ESStringA >(anyValue);
   if (pValue) {
    func(FourCharCode(*pValue));
   }
  }
 };
 ESAny GetSupportedIntegerKeyValueToADFTree(const UInt32 &key);
 ESNumber GetIntegerKeyValueToADFTree(const UInt32 &key);
 ESErrorCode SetIntegerKeyValueToADFTree(const UInt32 &key, ESNumber nValue);
 BOOL IncludedInDocumentType(ESAnyArray* pStrDocumentTypes, UInt32 checkType);
protected:
 ESFunctionalUnitType m_eFunctionalUnitType;
 ESColorMatrixMode m_eColorMatrixMode;
 bool m_bCaptureCommandSupport;
 ESJobMode m_eJobMode;
 bool m_bIsDisableJobContinue;
 bool m_bIsDisableKeepingCapture;
 ESString m_strAuthUsername;
 ESString m_strAuthPassword;
 bool m_bIsAuthenticationEnabled;
 bool m_bIsAdminLockUnlocked;
 ESString m_strAdminLockPassword;
 ESDictionaryA m_dicInformation;
 ESDictionaryA m_dicMaintenanceInformation;
 ESDictionaryA m_dicMaintenanceStatus;
 ESDictionaryA m_dicExtInformation;
 ESDictionaryA m_dicCapabilities;
 ESDictionaryA m_dicMaintenanceCapabilities;
 ESDictionaryA m_dicStatus;
 ESDictionaryA m_dicResult;
 ESDictionaryA m_dicParameters;
 ESDictionaryA m_dicMaintenanceParameters;
 ESDictionaryA m_dicProcessingImagePtr;
 ESDictionaryA m_dicClosableImagePtr;
 ESDictionaryA m_dicPageCounts;
 std::recursive_mutex m_event_mtx;
 std::unique_ptr<event_caller> m_interruptCheckTimer;
 ESFloat m_fXOffsetMargin;
 ESFloat m_fYOffsetMargin;
 bool m_bIsAfmEnabled;
 ESNumber m_nAfmTimeout_s;
 std::unique_ptr<event_caller> m_afmCheckTimer;
 bool m_bIsInterrutionEnabled;
 bool m_bIsPushScanReady;
};
