FreeRDP
include/freerdp/client/printer.h
1 
23 #ifndef FREERDP_CHANNEL_PRINTER_CLIENT_PRINTER_H
24 #define FREERDP_CHANNEL_PRINTER_CLIENT_PRINTER_H
25 
26 #include <freerdp/channels/rdpdr.h>
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32 
33  typedef struct rdp_printer_driver rdpPrinterDriver;
34  typedef struct rdp_printer rdpPrinter;
35  typedef struct rdp_print_job rdpPrintJob;
36 
37  typedef void (*pcReferencePrinterDriver)(rdpPrinterDriver* driver);
38  typedef rdpPrinter** (*pcEnumPrinters)(rdpPrinterDriver* driver);
39  typedef void (*pcReleaseEnumPrinters)(rdpPrinter** printers);
40 
41  typedef rdpPrinter* (*pcGetPrinter)(rdpPrinterDriver* driver, const char* name,
42  const char* driverName, BOOL isDefault);
43  typedef void (*pcReferencePrinter)(rdpPrinter* printer);
44 
46  {
47  pcEnumPrinters EnumPrinters;
48  pcReleaseEnumPrinters ReleaseEnumPrinters;
49  pcGetPrinter GetPrinter;
50 
51  pcReferencePrinterDriver AddRef;
52  pcReferencePrinterDriver ReleaseRef;
53  };
54 
55  typedef rdpPrintJob* (*pcCreatePrintJob)(rdpPrinter* printer, UINT32 id);
56  typedef rdpPrintJob* (*pcFindPrintJob)(rdpPrinter* printer, UINT32 id);
57 
58  struct rdp_printer
59  {
60  size_t id;
61  char* name;
62  char* driver;
63  BOOL is_default;
64 
65  size_t references;
66  rdpPrinterDriver* backend;
67  pcCreatePrintJob CreatePrintJob;
68  pcFindPrintJob FindPrintJob;
69  pcReferencePrinter AddRef;
70  pcReferencePrinter ReleaseRef;
71  };
72 
73  typedef UINT (*pcWritePrintJob)(rdpPrintJob* printjob, const BYTE* data, size_t size);
74  typedef void (*pcClosePrintJob)(rdpPrintJob* printjob);
75 
77  {
78  UINT32 id;
79  rdpPrinter* printer;
80 
81  pcWritePrintJob Write;
82  pcClosePrintJob Close;
83  };
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif /* FREERDP_CHANNEL_PRINTER_CLIENT_PRINTER_H */