imagerscanengineApi.h
Go to the documentation of this file.
1 
3 #pragma once
4 #include <boost/function.hpp>
5 #include <boost/system/error_code.hpp>
6 #include <boost/shared_ptr.hpp>
7 
9 
10 #include "iScanEngineDeviceList.h"
11 
12 //To avoid redefinition in client and app
13 #ifndef IMAGERSCANENGINE_TYPES
14 #define IMAGERSCANENGINE_TYPES
15 
21 namespace dpyImagerscanengine {
22 
27 typedef boost::function<void(const bool &available)> service_availability_handler;
28 
35 typedef boost::function<void(boost::system::error_code& ec)> request_handler_function;
36 typedef boost::function<void(boost::system::error_code& ec, const std::string& scanned_code)> get_scanned_codes_function;
37 typedef boost::function<void(boost::system::error_code& ec, ListEvent event)> get_list_events_function;
38 typedef boost::function<void(boost::system::error_code& ec, ScannerStatus status)> get_scanner_status_function;
39 typedef boost::function<void(boost::system::error_code& ec, ScannerInfo info)> get_scanner_info_function;
40 }
41 
42 #endif //IMAGERSCANENGINE_TYPES
43 
49 private:
50  boost::shared_ptr<ImagerScanEngineClient> mClient;
51 public:
52  explicit ImagerScanEngine(std::string ip = "127.0.0.1");
54  bool isAlive();
55  void monitorServiceAvailability_S(dpyImagerscanengine::service_availability_handler handler);
56  void monitorServiceAvailability_U();
57  void asyncReboot(dpyImagerscanengine::request_handler_function requestHandler);
58  void asyncGetScannedCodes(dpyImagerscanengine::get_scanned_codes_function scannedCodesHandler);
59  void getScannedCodes_S(dpyImagerscanengine::get_scanned_codes_function scannedCodesHandler);
60  void getScannedCodes_U();
61  void asyncGetListEvents(dpyImagerscanengine::get_list_events_function listEventsHandler);
62  void getListEvents_S(dpyImagerscanengine::get_list_events_function listEventsHandler);
63  void getListEvents_U();
64  void asyncGetScannerStatus(dpyImagerscanengine::get_scanner_status_function scannerStatusHandler);
65  void getScannerStatus_S(dpyImagerscanengine::get_scanner_status_function scannerStatusHandler);
66  void getScannerStatus_U();
67  void asyncGetLastScannedCode(dpyImagerscanengine::get_scanned_codes_function scannedCodesHandler);
68  void asyncSetReadMode(dpyImagerscanengine::ReadMode mode, dpyImagerscanengine::request_handler_function requestHandler);
69  void asyncSetIlluminationProperties(dpyImagerscanengine::Illumination illumination, dpyImagerscanengine::request_handler_function requestHandler);
70  void asyncSetBrightnessProperties(dpyImagerscanengine::Brightness brightness, dpyImagerscanengine::request_handler_function requestHandler);
71  void asyncSetImageMirroredSettings(dpyImagerscanengine::Rotation rotation, dpyImagerscanengine::request_handler_function requestHandler);
72  void asyncSetDetectionProperties(dpyImagerscanengine::DetectionMode detection, dpyImagerscanengine::request_handler_function requestHandler);
73  void asyncSetSensitivityProperties(dpyImagerscanengine::SensitivityMode sensitivity, dpyImagerscanengine::request_handler_function requestHandler);
74  void asyncSetRereadTimeoutProperties(int rereadTimeout, dpyImagerscanengine::request_handler_function requestHandler);
75  void asyncSaveImage(std::string &outputImageFile, dpyImagerscanengine::request_handler_function requestHandler);
76  void asyncGetScannerInfo(dpyImagerscanengine::get_scanner_info_function scannerInfoHandler);
77 };
ReadMode
Read Mode to be requested via client.
Definition: iScanEngineDevice.h:33
boost::function< void(boost::system::error_code &ec, ScannerStatus status)> get_scanner_status_function
Prototype of the handler function for getScannerStatus method.
Definition: imagerscanengineApi.h:38
DetectionMode
Detection Mode to be requested via client.
Definition: iScanEngineDevice.h:50
boost::function< void(const bool &available)> service_availability_handler
Prototype of the handler function used to monitor service availability.
Definition: imagerscanengineApi.h:27
SensitivityMode
Sensitivity Mode to be requested via client.
Definition: iScanEngineDevice.h:58
Brightness
Brightness to be requested via client.
Definition: iScanEngineDevice.h:26
Interacts with platform manager service.
Definition: imagerscanengineClient.h:12
Allows to interact with the Imager Scan Engine service.
Definition: imagerscanengineApi.h:48
boost::function< void(boost::system::error_code &ec, ListEvent event)> get_list_events_function
Prototype of the handler function for getListEvents method.
Definition: imagerscanengineApi.h:37
Rotation
Rotation Mode to be requested via client.
Definition: iScanEngineDevice.h:41
Illumination
Illumination to be requested via client.
Definition: iScanEngineDevice.h:18
Deepsy Imagerscanengine namespace that includes the different enums, structs or method signatures tha...
boost::function< void(boost::system::error_code &ec)> request_handler_function
Handler for status function callback.
Definition: imagerscanengineApi.h:35
boost::function< void(boost::system::error_code &ec, ScannerInfo info)> get_scanner_info_function
Prototype of the handler function for getScannerInfo method.
Definition: imagerscanengineApi.h:39
boost::function< void(boost::system::error_code &ec, const std::string &scanned_code)> get_scanned_codes_function
Prototype of the handler function for getScannedCodes method.
Definition: imagerscanengineApi.h:36