| CustomiOSApi 1.09

/Users/user/Documents/sviluppo/CustomiOSApi/CustomiOSApi/CustomiOSApi/CustomPrinter.h
1//
2// CustomPrinter.h
3// CustomiOSApi
4//
5// Created by CUSTOM on 03/07/13.
6// Copyright (c) 2013 CUSTOM. All rights reserved.
7//
8
9#ifndef CUSTOMPRINTER_H_
10#define CUSTOMPRINTER_H_
11
12#import <Foundation/Foundation.h>
13#import "CustomPrinterStatus.h"
14#import "PrinterFont.h"
15#import <UIKit/UIKit.h>
16
20@interface CustomPrinter : NSObject
21{
22 @public
23
27 enum CommPortType
28 {
32 COMMTYPE_BLUETOOTH = 0,
36 COMMTYPE_WIFI = 1,
40 COMMTYPE_BLE = 2,
44 COMMTYPE_NONE = 0xFF,
45 };
46
47 //************************************************************************************************
48 // IMAGE SCALE
49 //************************************************************************************************
50
54 enum ImageScale
55 {
59 IMAGE_SCALE_NONE = 0,
63 IMAGE_SCALE_TO_FIT = 1,
67 IMAGE_SCALE_TO_WIDTH = 2,
68 };
69
70 //************************************************************************************************
71 // IMAGE ALIGN / JUSTIFICATION
72 //************************************************************************************************
73
77 enum ImageJustification
78 {
82 IMAGE_ALIGN_TO_LEFT = 0,
86 IMAGE_ALIGN_TO_CENTER = -1,
90 IMAGE_ALIGN_TO_RIGHT = -2,
91 };
92
93 //************************************************************************************************
94 // CUT
95 //************************************************************************************************
96
100 enum CutType
101 {
105 CUT_TOTAL = 0,
109 CUT_PARTIAL = 1,
110 };
111
112 //************************************************************************************************
113 // EJECT
114 //************************************************************************************************
115
119 enum EjectType
120 {
124 EJ_EJECT = 0,
128 EJ_RETRACT = 1,
129 };
130
131 //************************************************************************************************
132 // BARCODE TYPE
133 //************************************************************************************************
134
138 enum BarcodeType
139 {
143 BARCODE_TYPE_CODABAR = -1,
147 BARCODE_TYPE_UPCA = -2,
151 BARCODE_TYPE_UPCE = -3,
155 BARCODE_TYPE_EAN13 = -4,
159 BARCODE_TYPE_EAN8 = -5,
163 BARCODE_TYPE_CODE39 = -6,
167 BARCODE_TYPE_ITF = -7,
171 BARCODE_TYPE_CODE93 = -8,
175 BARCODE_TYPE_CODE128 = -9,
179 BARCODE_TYPE_CODE32 = -10,
180 };
181
182 //************************************************************************************************
183 // BARCODE 2D TYPE
184 //************************************************************************************************
185
189 enum Barcode2DType
190 {
194 BARCODE_TYPE_QRCODE = -101,
195
199 BARCODE_TYPE_MICROQRCODE = -102,
200
204 BARCODE_TYPE_DATAMATRIX = -103,
205
209 BARCODE_TYPE_PDF417 = -104,
210
214 BARCODE_TYPE_MICROPDF417 = -105,
215
219 BARCODE_TYPE_AZTEC = -106,
220
221 };
222
223 //************************************************************************************************
224 // BARCODE HRI TYPE
225 //************************************************************************************************
226
230 enum BarcodeHriType
231 {
235 BARCODE_HRI_NONE = 0,
239 BARCODE_HRI_TOP = 1,
243 BARCODE_HRI_BOTTOM = 2,
247 BARCODE_HRI_TOPBOTTOM = 3,
248 };
249
250 //************************************************************************************************
251 // BARCODE ALIGN / JUSTIFICATION
252 //************************************************************************************************
253
257 enum BarcodeJustification
258 {
262 BARCODE_ALIGN_TO_LEFT = 0,
266 BARCODE_ALIGN_TO_CENTER = -1,
270 BARCODE_ALIGN_TO_RIGHT = -2,
271 };
272
273 @protected
274
275 @private
276}
277
278//***********************************************
279// COMMON FUNCTIONS
280//***********************************************
281
287- (Boolean) IsPrinterOnline:(NSError**)error;
288
294- (NSInteger) GetPrinterId:(NSError**)error;
295
301- (NSString*) GetFirmwareVersion:(NSError**)error;
302
307- (NSString*) GetAPIVersion;
308
314- (NSData*) GetPrinterFullStatusBuffer:(NSError**)error;
315
321- (CustomPrinterStatus*) GetPrinterFullStatus:(NSError**)error;
322
327- (NSString*) GetPrinterName;
328
333- (NSInteger) GetPageWidth;
334
340- (NSInteger) GetReadTimeout:(NSError**)error;
341
347- (void) SetReadTimeout:(NSInteger)msecs :(NSError**)error;
348
354- (NSInteger) GetWriteTimeout:(NSError**)error;
355
361- (void) SetWriteTimeout:(NSInteger)msecs :(NSError**)error;
362
367- (void) Close:(NSError**)error;
368
379- (enum CommPortType) GetPortType;
380
385- (void) ClearReadBuffer:(NSError**)error;
386
392- (NSData *) ReadData:(NSError**)error;
393
399- (void) WriteData:(NSData *)data :(NSError**)error;
400
406- (void) Feed:(NSInteger)nFeeds :(NSError**)error;
407
418- (void) Cut:(enum CutType)cutType :(NSError**)error;
419
430- (void) Eject:(enum EjectType)ejectType :(NSError**)error;
431
437- (void) Present:(NSInteger)presentMM :(NSError**)error;
438
439// <summary>
447- (void) PrintText:(NSString*)text :(NSInteger)pixel_la :(NSInteger)pixel_w :(PrinterFont*)font :(NSError**)error;
448
457- (void) PrintTextLF:(NSString*)text :(NSInteger)pixel_la :(NSInteger)pixel_w :(PrinterFont*)font :(NSError**)error;
458
465- (void) PrintText:(NSString*)text :(PrinterFont*)font :(NSError**)error;
466
473- (void) PrintTextLF:(NSString*)text :(PrinterFont*)font :(NSError**)error;
474
481- (void) PrintTextArrayLF:(NSArray*)textarray :(PrinterFont*)font :(NSError**)error;
482
488- (void) PrintText:(NSString*)text :(NSError**)error;
489
495- (void) PrintTextLF:(NSString*)text :(NSError**)error;
496
502- (void) PrintTextArrayLF:(NSArray*)textarray :(NSError**)error;
503
524- (void) PrintImage:(UIImage*)image :(NSInteger)leftAlign :(enum ImageScale)widthOption :(NSInteger)imgWidth :(NSError**)error;
525
531- (void) PrintImage:(UIImage*)image :(NSError**)error;
532
543- (void) PrintBarcodeText:(NSString*)brcText :(enum BarcodeType)brcType :(enum BarcodeHriType)brcHriType :(enum BarcodeJustification)brcJustification :(NSInteger)brcWidth :(NSInteger)brcHeight :(NSError**)error;
544
555- (void) PrintBarcodeData:(NSData*)brcData :(enum BarcodeType)brcType :(enum BarcodeHriType)brcHriType :(enum BarcodeJustification)brcJustification :(NSInteger)brcWidth :(NSInteger)brcHeight :(NSError**)error;
556
565- (void) PrintBarcode2DText:(NSString*)brcText :(enum Barcode2DType)brcType :(enum BarcodeJustification)brcJustification :(NSInteger)brcWidth :(NSError**)error;
566
575- (void) PrintBarcode2DData:(NSData*)brcData :(enum Barcode2DType)brcType :(enum BarcodeJustification)brcJustification :(NSInteger)brcWidth :(NSError**)error;
576
577@end
578
579#endif
CustomPrinterStatus
This the container class to hold the printer status
Definition: CustomPrinterStatus.h:18
CustomPrinter
Class definition for CUSTOM printers. Defines functionality to print text/image, read/write data to p...
Definition: CustomPrinter.h:21
CustomPrinter::ImageJustification
ImageJustification
Print Image Justification / Left Position
Definition: CustomPrinter.h:78
CustomPrinter::IMAGE_ALIGN_TO_CENTER
@ IMAGE_ALIGN_TO_CENTER
Definition: CustomPrinter.h:86
CustomPrinter::IMAGE_ALIGN_TO_LEFT
@ IMAGE_ALIGN_TO_LEFT
Definition: CustomPrinter.h:82
CustomPrinter::IMAGE_ALIGN_TO_RIGHT
@ IMAGE_ALIGN_TO_RIGHT
Definition: CustomPrinter.h:90
CustomPrinter::ImageScale
ImageScale
Print Image Scale
Definition: CustomPrinter.h:55
CustomPrinter::IMAGE_SCALE_TO_FIT
@ IMAGE_SCALE_TO_FIT
Definition: CustomPrinter.h:63
CustomPrinter::IMAGE_SCALE_NONE
@ IMAGE_SCALE_NONE
Definition: CustomPrinter.h:59
CustomPrinter::IMAGE_SCALE_TO_WIDTH
@ IMAGE_SCALE_TO_WIDTH
Definition: CustomPrinter.h:67
-[CustomPrinter GetPortType]
enum CommPortType GetPortType()
Returns the communication port type
Definition: CustomPrinter.m:20
CustomPrinter::EjectType
EjectType
Eject Type
Definition: CustomPrinter.h:120
CustomPrinter::EJ_RETRACT
@ EJ_RETRACT
Definition: CustomPrinter.h:128
CustomPrinter::EJ_EJECT
@ EJ_EJECT
Definition: CustomPrinter.h:124
-[CustomPrinter GetAPIVersion]
NSString * GetAPIVersion()
Returns current API version
Definition: CustomPrinter.m:40
-[CustomPrinter GetPageWidth]
NSInteger GetPageWidth()
Returns the max printable width in pixels / dots
Definition: CustomPrinter.m:59
CustomPrinter::BarcodeJustification
BarcodeJustification
Barcode Print Justification / Left Position
Definition: CustomPrinter.h:258
CustomPrinter::BARCODE_ALIGN_TO_LEFT
@ BARCODE_ALIGN_TO_LEFT
Definition: CustomPrinter.h:262
CustomPrinter::BARCODE_ALIGN_TO_CENTER
@ BARCODE_ALIGN_TO_CENTER
Definition: CustomPrinter.h:266
CustomPrinter::BARCODE_ALIGN_TO_RIGHT
@ BARCODE_ALIGN_TO_RIGHT
Definition: CustomPrinter.h:270
CustomPrinter::BarcodeType
BarcodeType
Barcode Type
Definition: CustomPrinter.h:139
CustomPrinter::BARCODE_TYPE_EAN13
@ BARCODE_TYPE_EAN13
Definition: CustomPrinter.h:155
CustomPrinter::BARCODE_TYPE_EAN8
@ BARCODE_TYPE_EAN8
Definition: CustomPrinter.h:159
CustomPrinter::BARCODE_TYPE_CODE39
@ BARCODE_TYPE_CODE39
Definition: CustomPrinter.h:163
CustomPrinter::BARCODE_TYPE_UPCA
@ BARCODE_TYPE_UPCA
Definition: CustomPrinter.h:147
CustomPrinter::BARCODE_TYPE_CODE32
@ BARCODE_TYPE_CODE32
Definition: CustomPrinter.h:179
CustomPrinter::BARCODE_TYPE_UPCE
@ BARCODE_TYPE_UPCE
Definition: CustomPrinter.h:151
CustomPrinter::BARCODE_TYPE_CODE93
@ BARCODE_TYPE_CODE93
Definition: CustomPrinter.h:171
CustomPrinter::BARCODE_TYPE_CODABAR
@ BARCODE_TYPE_CODABAR
Definition: CustomPrinter.h:143
CustomPrinter::BARCODE_TYPE_CODE128
@ BARCODE_TYPE_CODE128
Definition: CustomPrinter.h:175
CustomPrinter::BARCODE_TYPE_ITF
@ BARCODE_TYPE_ITF
Definition: CustomPrinter.h:167
CustomPrinter::BarcodeHriType
BarcodeHriType
Barcode HRI Type
Definition: CustomPrinter.h:231
CustomPrinter::BARCODE_HRI_TOP
@ BARCODE_HRI_TOP
Definition: CustomPrinter.h:239
CustomPrinter::BARCODE_HRI_NONE
@ BARCODE_HRI_NONE
Definition: CustomPrinter.h:235
CustomPrinter::BARCODE_HRI_BOTTOM
@ BARCODE_HRI_BOTTOM
Definition: CustomPrinter.h:243
CustomPrinter::BARCODE_HRI_TOPBOTTOM
@ BARCODE_HRI_TOPBOTTOM
Definition: CustomPrinter.h:247
CustomPrinter::CutType
CutType
Cut Type
Definition: CustomPrinter.h:101
CustomPrinter::CUT_TOTAL
@ CUT_TOTAL
Definition: CustomPrinter.h:105
CustomPrinter::CUT_PARTIAL
@ CUT_PARTIAL
Definition: CustomPrinter.h:109
CustomPrinter::Barcode2DType
Barcode2DType
Barcode 2D Type
Definition: CustomPrinter.h:190
CustomPrinter::BARCODE_TYPE_PDF417
@ BARCODE_TYPE_PDF417
Definition: CustomPrinter.h:209
CustomPrinter::BARCODE_TYPE_MICROQRCODE
@ BARCODE_TYPE_MICROQRCODE
Definition: CustomPrinter.h:199
CustomPrinter::BARCODE_TYPE_DATAMATRIX
@ BARCODE_TYPE_DATAMATRIX
Definition: CustomPrinter.h:204
CustomPrinter::BARCODE_TYPE_MICROPDF417
@ BARCODE_TYPE_MICROPDF417
Definition: CustomPrinter.h:214
CustomPrinter::BARCODE_TYPE_QRCODE
@ BARCODE_TYPE_QRCODE
Definition: CustomPrinter.h:194
CustomPrinter::BARCODE_TYPE_AZTEC
@ BARCODE_TYPE_AZTEC
Definition: CustomPrinter.h:219
CustomPrinter::CommPortType
CommPortType
Communication Port Type
Definition: CustomPrinter.h:28
CustomPrinter::COMMTYPE_NONE
@ COMMTYPE_NONE
Definition: CustomPrinter.h:44
CustomPrinter::COMMTYPE_BLUETOOTH
@ COMMTYPE_BLUETOOTH
Definition: CustomPrinter.h:32
CustomPrinter::COMMTYPE_BLE
@ COMMTYPE_BLE
Definition: CustomPrinter.h:40
CustomPrinter::COMMTYPE_WIFI
@ COMMTYPE_WIFI
Definition: CustomPrinter.h:36
-[CustomPrinter GetPrinterName]
NSString * GetPrinterName()
Returns name/type of the Printer
Definition: CustomPrinter.m:54
PrinterFont
This the container class to hold various font attributes
Definition: PrinterFont.h:18