PrinterManager Class Reference

Allows to interact with Printer Service.

#include <printerApi.h>

Public Member Functions

 PrinterManager (std::string ip="127.0.0.1")
 Constructor of the class. More...
 
 ~PrinterManager ()
 Destructor of the class.
 
bool isAlive ()
 Method to check if Printer Service is alive. More...
 
void monitorServiceAvailability_S (dpyPrinter::service_availability_handler handler)
 
void monitorServiceAvailability_U ()
 
void asyncGetPrinters (dpyPrinter::print_list_handler handler)
 Method which requests available printers. More...
 
void asyncGetPrinterInfo (dpyPrinter::printer_info_handler handler, const std::string &printerid)
 Gets printer info. More...
 
void asyncPrintImage (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. If sucessful, this will add a job to the job list. More...
 
void asyncPrintHtml (dpyPrinter::print_html_handler handler, const std::string &printerid, std::string html_path, std::list< PrintConfig > configs)
 Method which requests to print from a html with a given configuration. If sucessful, this will add a job to the job list. More...
 
void asyncGetJobInfo (dpyPrinter::job_info_handler handler, int jobid)
 Gets job information. More...
 
void asyncGetAllJobInfo (dpyPrinter::all_job_info_handler handler, const std::string &printerid)
 Gets every job information. More...
 
void asyncDeleteJob (dpyPrinter::result_handler_function handler, int jobid)
 Deletes a job from the list. More...
 
void asyncForcePrinterUpgrade (dpyPrinter::result_handler_function handler, const std::string &printerid)
 Forces upgrade of printer firmware. More...
 
void asyncSetDefaultConfiguration (dpyPrinter::result_handler_function handler, const std::string &printerid, PrintConfig printConfig)
 Modifies a printer config. More...
 
void asyncGetDefaultConfiguration (dpyPrinter::printerconfig_handler_function handler, const std::string &printerid)
 Gets printer config. More...
 
void asyncPrintTestTicket (dpyPrinter::result_handler_function handler, const std::string &printerid)
 Prints a test ticket. More...
 
void asyncStoreNVImage (dpyPrinter::result_handler_function handler, const std::string &printerid, const std::string &image_path, int slotid)
 Stores image in non-volatile memory. More...
 
void asyncDeleteNVImage (dpyPrinter::result_handler_function handler, const std::string &printerid, int slotid)
 Deletes image stored in non-volatile memory. More...
 
void asyncGetNVImageList (dpyPrinter::printerimagelist_handler_function handler, const std::string &printerid)
 Gets list of images stored in non-volatile memory. More...
 
void asyncPrintNVImage (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. More...
 
void printerListEvent_S (dpyPrinter::printer_list_event_handler_function handler)
 Subscribes to printer list events. More...
 
void printerJobStatusEvent_S (dpyPrinter::job_status_event_handler_function handler)
 Subscribes to job status events. More...
 
void printerEvent_S (dpyPrinter::printer_event_handler_function handler)
 Subscribes to printer events. More...
 
void printerStatusEvent_S (dpyPrinter::printer_status_event_handler_function handler)
 Subscribes to printer status events. More...
 
void paperLevelEvent_S (dpyPrinter::paper_level_event_handler_function handler)
 Subscribes to paper events. More...
 
void NVImageListEvent_S (dpyPrinter::printer_imagelist_event_handler_function handler)
 Subscribes to non-volatile memory images list events. More...
 

Constructor & Destructor Documentation

PrinterManager ( std::string  ip = "127.0.0.1")
explicit
Parameters
ipIP address to be binded to the App

Member Function Documentation

void asyncDeleteJob ( dpyPrinter::result_handler_function  handler,
int  jobid 
)
Parameters
handlerHandler to be called when a response comes from the service
jobidjob id
void asyncDeleteNVImage ( dpyPrinter::result_handler_function  handler,
const std::string &  printerid,
int  slotid 
)
Parameters
handlerHandler to be called when a response comes from the service
printeridprinter id
slotidSlot id where the image is stored (0 to 3)
void asyncForcePrinterUpgrade ( dpyPrinter::result_handler_function  handler,
const std::string &  printerid 
)
Parameters
handlerHandler to be called when a response comes from the service
printeridprinter id
void asyncGetAllJobInfo ( dpyPrinter::all_job_info_handler  handler,
const std::string &  printerid 
)
Parameters
handlerHandler to be called when a response comes from the service
printeridprinter id
void asyncGetDefaultConfiguration ( dpyPrinter::printerconfig_handler_function  handler,
const std::string &  printerid 
)
Parameters
handlerHandler to be called when a response comes from the service
printeridprinter id
void asyncGetJobInfo ( dpyPrinter::job_info_handler  handler,
int  jobid 
)
Parameters
handlerHandler to be called when a response comes from the service
jobidjob id
void asyncGetNVImageList ( dpyPrinter::printerimagelist_handler_function  handler,
const std::string &  printerid 
)
Parameters
handlerHandler to be called when a response comes from the service
printeridprinter id
void asyncGetPrinterInfo ( dpyPrinter::printer_info_handler  handler,
const std::string &  printerid 
)
Parameters
handlerHandler to be called when a response comes from the service
printeridprinter id
void asyncGetPrinters ( dpyPrinter::print_list_handler  handler)
Parameters
handlerHandler to be called when a response comes from the service
void asyncPrintHtml ( dpyPrinter::print_html_handler  handler,
const std::string &  printerid,
std::string  html_path,
std::list< PrintConfig configs 
)
Parameters
handlerHandler to be called when a response comes from the service
printeridprinter id
html_pathPath and Name to the html to be printed
configslist of configs for this specific job
void asyncPrintImage ( dpyPrinter::print_image_handler  handler,
const std::string &  printerid,
std::string  image_path,
std::list< PrintConfig configs 
)
Parameters
handlerHandler to be called when a response comes from the service
printeridprinter id
image_pathPath and Name to the image to be printed
configslist of configs for this specific job
void asyncPrintNVImage ( dpyPrinter::print_image_handler  handler,
const std::string &  printerid,
int  slotid,
std::list< PrintConfig configs 
)
Parameters
handlerHandler to be called when a response comes from the service
printeridprinter id
slotidSlot id where the image is stored (0 to 3)
configslist of configs for this specific job
void asyncPrintTestTicket ( dpyPrinter::result_handler_function  handler,
const std::string &  printerid 
)
Parameters
handlerHandler to be called when a response comes from the service
printeridprinter id
void asyncSetDefaultConfiguration ( dpyPrinter::result_handler_function  handler,
const std::string &  printerid,
PrintConfig  printConfig 
)
Parameters
handlerHandler to be called when a response comes from the service
printeridprinter id
printConfigconfig to modify
void asyncStoreNVImage ( dpyPrinter::result_handler_function  handler,
const std::string &  printerid,
const std::string &  image_path,
int  slotid 
)
Parameters
handlerHandler to be called when a response comes from the service
printeridprinter id
image_pathPath and name of the image to be saved
slotidSlot id where the image will be stored (0 to 3)
bool isAlive ( )
Returns
Boolean indicating if Printer is alive
void NVImageListEvent_S ( dpyPrinter::printer_imagelist_event_handler_function  handler)
Parameters
handlerHandler to be called when a new NV memory images list event comes from the service
void paperLevelEvent_S ( dpyPrinter::paper_level_event_handler_function  handler)
Parameters
handlerHandler to be called when a new paper level event comes from the service
void printerEvent_S ( dpyPrinter::printer_event_handler_function  handler)
Parameters
handlerHandler to be called when a new event comes from the service
void printerJobStatusEvent_S ( dpyPrinter::job_status_event_handler_function  handler)
Parameters
handlerHandler to be called when a new job status event comes from the service
void printerListEvent_S ( dpyPrinter::printer_list_event_handler_function  handler)
Parameters
handlerHandler to be called when a new printer list event comes from the service
void printerStatusEvent_S ( dpyPrinter::printer_status_event_handler_function  handler)
Parameters
handlerHandler to be called when a new printer status event comes from the service