//
//  S1ESCPrinter.h
//  PrinterSDK
//
//  Created by ldc on 2025/8/21.
//  Copyright © 2025 XiamenHY. All rights reserved.
//

#import <PrinterSDK/S1V1ProtocolPrinter.h>
#import <PrinterSDK/PTCommandESC.h>
#import <PrinterSDK/S1Type.h>
#import <PrinterSDK/S1ESCType.h>

NS_ASSUME_NONNULL_BEGIN

@interface S1ESCPrinter : S1V1ProtocolPrinter

/// 打印机状态监听器
@property (nonatomic, copy, nullable) void (^escPrinterStatusListener)(S1ESCAutoReportPrinterStatus);

/// 使用携带JobId的方式进行打印
/// - Parameters:
///   - command: 指令
///   - timeout: 数据发送完后打印完成超时时间
///   - retryCount: 失败重试次数，默认为0（不重试）
///   - completeHandler: 结果回调
///   - progressBlock: 发送进度
/// - Warning: 该接口仅部分机器支持，不支持打印使用时可能导致打印乱码
- (void)printWithJobId:(PTCommandESC *)command
               timeout:(NSTimeInterval)timeout
            retryCount:(NSInteger)retryCount
              complete:(RYEmptyResultBlock)completeHandler
          sendProgress:(RYProgressBlock _Nullable)progressBlock;

/// 防漏打
/// - Parameters:
///   - command: 指令
///   - timeout: 数据发送完后打印完成超时时间
///   - retryHandler: 打印失败后重复回调
///   - completeHandler: 打印成功回调
///   - progressBlock: 发送进度
/// - Warning: 该接口仅部分机器支持，不支持打印使用时可能导致打印乱码
/// - Note: 该接口只支持LZO位图，且不支持分包
- (void)preventMissedPrintWithJobId:(PTCommandESC *)command
                            timeout:(NSTimeInterval)timeout
                              retry:(RYEmptyResultBlock)retryHandler
                           complete:(RYEmptyResultBlock)completeHandler
                       sendProgress:(RYProgressBlock _Nullable)progressBlock;

@end

NS_ASSUME_NONNULL_END
