cashumit/plugins/ios/Classes/TscCommand.h

256 lines
7.6 KiB
C
Raw Normal View History

//
// TscCommand.h
// Gprinter
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef NS_ENUM (NSUInteger,Response){
OFF = 0,//关闭自动返回状态功能
ON = 1,//打开自动返回状态功能,每打印完一张返回一次
BATCH = 2,//打开自动返回状态功能,打印完毕后返回一次
};
@interface TscCommand : NSObject
/**
*
* @param width
* @param height
*/
-(void) addSize:(int) width :(int) height;
/**
* mm
* @param m
* @param n
*/
-(void) addGapWithM:(int) m withN:(int) n;
/**
*
* @param x
* @param y
*/
-(void) addReference:(int) x :(int)y;
/**
*
* @param speed
*/
-(void) addSpeed:(int) speed;
/**
*
* @param density
*/
-(void) addDensity:(int) density;
/**
*
* @param direction
*/
-(void) addDirection:(int) direction;
/**
*
*/
-(void) addCls;
/**
* :
* @param x
* @param y
* @param font
* @param rotation
* @param xScal
* @param yScal
* @param text
*/
-(void) addTextwithX:(int)x withY:(int)y withFont:(NSString*)font withRotation:(int)rotation withXscal:(int)xScal withYscal:(int)yScal withText:(NSString*) text;
/*
BITMAP X, Y, width, height, mode, bitmap data
x
y
width byte
height (dot)
mode
0 OVERWRITE
1 OR
2 XOR
bitmap data
*/
-(void) addBitmapwithX:(int)x withY:(int) y withWidth:(int) width withHeight:(int) height withMode:(int) mode withData:(NSData*) data;
-(void)addBitmapwithX:(int)x withY:(int)y withMode:(int)mode withWidth:(int)width withImage:(UIImage *)image;
-(void)addBitmapwithX:(int)x withY:(int)y withMode:(int)mode withImage:(UIImage *)image;
/**
* :
* @param x
* @param y
* @param barcodeType
* @param height 40
* @param readable 0: 1:
* @param rotation 09090180180270270
* @param narrow 2 bar (dot)
* @param wide 4 bar (dot)
* @param content
BARCODE X,Y,"code type",height,human readable,rotation,narrow,wide,"code"
BARCODE 100,100,"39",40,1,0,2,4,"1000"
BARCODE 10,10,"128",40,1,0,2,2,"124096ABCDEFZ$%+-./*"
"code type":
EAN13("EAN13"),
EAN8("EAN8"),
UPCA("UPCA"),
ITF14("ITF14"),
CODE39("39"),
CODE128("128"),
*/
-(void) add1DBarcode:(int)x :(int)y :(NSString*)barcodeType :(int)height :(int)readable :(int)rotation :(int)narrow :(int)wide :(NSString*)content;
/**
* :QRCode二维码
* @param x
* @param y
* @param ecclever QRCODE纠错等级,L为7%,M为15%,Q为25%,H为30%
* @param cellwidth 1~104
* @param mode AA为Auto,M为Manual
* @param rotation QRCode二维旋转角度09090180180270270
* @param content
* QRCODE X,Y ,ECC LEVER ,cell width,mode,rotation, "data string"
* QRCODE 20,24,L,4,A,0,"佳博集团网站www.Gprinter.com.cn"
*/
-(void) addQRCode:(int)x :(int)y :(NSString*)ecclever :(int)cellwidth :(NSString*)mode :(int)rotation :(NSString*)content;
/**
*
* @param m
* @param n
*/
-(void) addPrint:(int) m :(int) n;
/**
* :
*/
-(NSData*) getCommand;
/**
*
* @param str
*/
-(void) addStrToCommand:(NSString *) str;
-(void) addNSDataToCommand:(NSData*) data;
/**
* TSC的固定命令cls命令之前发送
*/
-(void) addComonCommand;
/**
* :
*/
-(void) addSelfTest;
/**
* :
*/
-(void) queryPrinterType;
/**
* :
* @param peel ON/OFF
*/
-(void) addPeel:(NSString *) peel;
/**
* :
* @param tear ON/OFF
*/
-(void) addTear:(NSString *) tear;
/**
* :
* @param cutter OFF/pieces (0<=pieces<=127)
*/
-(void) addCutter:(NSString *) cutter;
/**
* :
* @param cutter
*/
-(void) addPartialCutter:(NSString *) cutter;
/**
*
* @param level
* @param interval ms
*/
-(void) addSound:(int) level :(int) interval;
/**
* ,CASHDRAWER m,t1,t2
* @param m m 048 2 149 5
* @param t1 0 t1 255t1和t2设定的钱箱开启脉冲到由m指定的引脚
* @param t2 0 t2 255t1和t2设定的钱箱开启脉冲到由m指定的引脚
*/
-(void) addCashdrawer:(int) m :(int) t1 :(int) t2;
/**
* :线
* @param x
* @param y
* @param width 线(dot)
* @param height 线(dot)
*/
-(void) addBar:(int) x :(int) y :(int) width :(int) height;
/**
* :
* @param xStart
* @param yStart
* @param xEnd
* @param yEnd
* @param lineThickness 线(dot)
*/
-(void) addBox:(int) xStart :(int) yStart :(int) xEnd :(int) yEnd :(int) lineThickness;
/**
* :<ESC>!?
*<ESC> (ASCII 27=0x1B, escape字符).!(ASCII 33=0x21),?(ASCII 63=0x3F)
*使 RS-232 byte 0
*
*/
-(void) queryPrinterStatus;
/**
* :
* @param xStart
* @param yStart
* @param xWidth X坐标方向宽度dot为单位
* @param yHeight Y坐标方向高度dot为单位
*/
-(void) addReverse:(int) xStart :(int) yStart :(int) xWidth :(int) yHeight;
/**
* :
* @param response <a>@see Response</a>
* OFF
* ON
* BATCH
*/
-(void)addQueryPrinterStatus:(Response)response;
/**
* :
* <p>: 3132 ()33 ()35 ()</p>
*
*/
-(void)queryElectricity;
@end