printerClient.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include "printerApi.h"
9 #include "printerProto.pb.h"
10 #include "../../../../LIBRARIES/MIDDLEWARE/src/com/dpyMwClient.h"
11 
17 {
18 private:
22  void RegisterCallbacks();
23 
24 public:
31  PrinterClient(std::string& ip, int dport, int sport);
32 
37 
43 
49  void getPrinterInfo(dpyPrinter::printer_info_handler handler, const std::string& printerid);
50 
58  void addPrintJob(dpyPrinter::print_image_handler handler, const std::string& printerid, std::string image_path, std::list<PrintConfig> configs);
59 
67  void addPrintHtmlJob(dpyPrinter::print_html_handler handler, const std::string& printerid, std::string html_path, std::list<PrintConfig> configs);
68 
74  void getJobInfo(dpyPrinter::job_info_handler handler, int jobid);
75 
81  void getAllJobInfo(dpyPrinter::all_job_info_handler handler,const std::string& printerid);
82 
88  void deleteJob(dpyPrinter::result_handler_function handler, int jobid);
89 
96  void setDefaultConfiguration(dpyPrinter::result_handler_function handler, const std::string& printerid, PrintConfig config);
97 
103  void getDefaultConfiguration(dpyPrinter::printerconfig_handler_function handler, const std::string& printerid);
104 
110  void printTestTicket(dpyPrinter::result_handler_function handler, const std::string& printerid);
111 
119  void storeNVImage(dpyPrinter::result_handler_function handler, const std::string& printerid, const std::string &image_path, int slotid);
120 
127  void deleteNVImage(dpyPrinter::result_handler_function handler, const std::string& printerid, int slotid);
128 
134  void getNVImageList(dpyPrinter::printerimagelist_handler_function handler, const std::string& printerid);
135 
143  void printNVImage(dpyPrinter::print_image_handler handler, const std::string& printerid, int slotId, std::list<PrintConfig> configs);
144 
150  void forcePrinterUpgrade(dpyPrinter::result_handler_function handler, const std::string& printerid);
151 
157 
163 
169 
180 
186 
187 };
boost::function< void(boost::system::error_code, std::string printerid, PrinterStatus status)> printer_status_event_handler_function
Prototype of the handler function for subscribing to printer status events.
Definition: printerApi.h:110
void addPrintJob(dpyPrinter::print_image_handler handler, const std::string &printerid, std::string image_path, std::list< PrintConfig > configs)
Method which requests to print an image with a given configuration.
boost::function< void(boost::system::error_code, int jobid)> print_html_handler
Prototype of the handler function for printing from html files.
Definition: printerApi.h:124
~PrinterClient()
Destructor of the class.
boost::function< void(boost::system::error_code, std::vector< dpyPrinter::NVImage > imageslist)> printerimagelist_handler_function
Prototype of the handler function for getting list of images saved in non-volatile memory...
Definition: printerApi.h:131
Represents a configuration for printing.
Definition: printConfig.h:62
boost::function< void(boost::system::error_code, std::list< std::pair< int, dpyPrinter::JobInformation >> jobinfolist)> all_job_info_handler
Prototype of the handler function for getting available printers.
Definition: printerApi.h:70
void printNVImage(dpyPrinter::print_image_handler handler, const std::string &printerid, int slotId, std::list< PrintConfig > configs)
Prints the image stored in the non-volatile memory area of the printer.
void printerJobStatusEvent_S(dpyPrinter::job_status_event_handler_function handler)
Subscribes to job status events.
void setDefaultConfiguration(dpyPrinter::result_handler_function handler, const std::string &printerid, PrintConfig config)
Method to set printer configuration.
void getAllJobInfo(dpyPrinter::all_job_info_handler handler, const std::string &printerid)
Gets all job info.
void deleteNVImage(dpyPrinter::result_handler_function handler, const std::string &printerid, int slotid)
Delete image stored in non-volatile memory.
boost::function< void(boost::system::error_code, int jobid)> print_image_handler
Prototype of the handler function for printing images.
Definition: printerApi.h:117
boost::function< void(boost::system::error_code, std::list< std::string > printers)> print_list_handler
Prototype of the handler function for getting available printers.
Definition: printerApi.h:42
boost::function< void(boost::system::error_code, std::string printerid, PrinterEvent event, bool active)> printer_event_handler_function
Prototype of the handler function for subscribing to printer events.
Definition: printerApi.h:102
boost::function< void(boost::system::error_code, PrinterInfo printerinfo)> printer_info_handler
Prototype of the handler function for getting available printers.
Definition: printerApi.h:56
void deleteJob(dpyPrinter::result_handler_function handler, int jobid)
Deletes a job from the list.
void printTestTicket(dpyPrinter::result_handler_function handler, const std::string &printerid)
Prints a test ticket.
boost::function< void(boost::system::error_code, std::string printerId, PaperLevel level)> paper_level_event_handler_function
Prototype of the handler function for subscribing to paper level events.
Definition: printerApi.h:94
boost::function< void(boost::system::error_code, std::list< PrintConfig > printerconfigs)> printerconfig_handler_function
Prototype of the handler function for getting printer configuration.
Definition: printerApi.h:49
void getDefaultConfiguration(dpyPrinter::printerconfig_handler_function handler, const std::string &printerid)
Gets printer config.
void storeNVImage(dpyPrinter::result_handler_function handler, const std::string &printerid, const std::string &image_path, int slotid)
Store image in non-volatile memory.
PrinterClient(std::string &ip, int dport, int sport)
Constructor of the class.
void getJobInfo(dpyPrinter::job_info_handler handler, int jobid)
Gets job info.
void printerListEvent_S(dpyPrinter::printer_list_event_handler_function handler)
Subscribes to printer list events.
void getNVImageList(dpyPrinter::printerimagelist_handler_function handler, const std::string &printerid)
Gets list of images stored in non-volatile memory.
void addPrintHtmlJob(dpyPrinter::print_html_handler handler, const std::string &printerid, std::string html_path, std::list< PrintConfig > configs)
Method which requests to print an html with a given configuration.
boost::function< void(boost::system::error_code error_code)> result_handler_function
Prototype of the handler function for obtaining a result.
Definition: printerApi.h:35
boost::function< void(boost::system::error_code, std::string printerid, ListEvent event)> printer_list_event_handler_function
Prototype of the handler function for subscribing to list events.
Definition: printerApi.h:78
void paperLevelEvent_S(dpyPrinter::paper_level_event_handler_function handler)
Subscribes to paper level events.
boost::function< void(boost::system::error_code, dpyPrinter::JobInformation jobinfo)> job_info_handler
Prototype of the handler function for getting available printers.
Definition: printerApi.h:63
void printerEvent_S(dpyPrinter::printer_event_handler_function handler)
Subscribes to printer events.
Class with the logic of the client.
Definition: printerClient.h:16
boost::function< void(boost::system::error_code, std::string printerid, ListEvent event, dpyPrinter::NVImage image)> printer_imagelist_event_handler_function
Prototype of the handler function for subscribing to non-volatile memory images events.
Definition: printerApi.h:140
void getPrinters(dpyPrinter::print_list_handler handler)
Method which requests available printers.
Manages dealer and susbriber.
Definition: dpyMwClient.h:59
void forcePrinterUpgrade(dpyPrinter::result_handler_function handler, const std::string &printerid)
Forces upgrade of printer firmware.
void getPrinterInfo(dpyPrinter::printer_info_handler handler, const std::string &printerid)
Gets printer info.
void printerStatusEvent_S(dpyPrinter::printer_status_event_handler_function handler)
Subscribes to printer status events.
boost::function< void(boost::system::error_code, int jobid, JobStatus status)> job_status_event_handler_function
Prototype of the handler function for subscribing to job status events.
Definition: printerApi.h:86
void NVImageListEvent_S(dpyPrinter::printer_imagelist_event_handler_function handler)
Subscribes to non-volatile memory images list events.