using System.Collections.Generic;
using ChuPiao.Common.Enums;
using log4net;

namespace ChuPiao.AutoPrint.Machine.Printer
{
    /// <summary>
    /// 打印机接口
    /// </summary>
    public interface IPrinterClient
    {
        /// <summary>
        /// 端口号
        /// </summary>
        string Port { get; set; }
        /// <summary>
        /// 端口波特率
        /// </summary>
        int PortBps { get; set; }
        /// <summary>
        /// 打印机端口类型
        /// </summary>
        PrinterPortType PrinterPortType { get; set; }
        
        /// <summary>
        /// 等待打印的队列
        /// </summary>
        Queue<byte[]> WaitPrintQueue { get; set; }

        /// <summary>
        /// 日志记录器
        /// </summary>
        ILog Log { get; set; }

        /// <summary>
        /// 初始化
        /// </summary>
        void Initialize();

        /// <summary>
        /// 启动
        /// </summary>
        void Start();

        /// <summary>
        /// 停止
        /// </summary>
        void Stop();

        /// <summary>
        /// 添加电子票文件
        /// </summary>
        /// <param name="ticketFilePath"></param>
        void AddFile(string ticketFilePath);

        /// <summary>
        /// 添加电子票文件(非加密)
        /// </summary>
        /// <param name="ticketFilePath"></param>
        void AddUnDecryptFile(string ticketFilePath);

        /// <summary>
        /// 添加电子票文本
        /// </summary>
        /// <param name="ticketFileText"></param>
        void AddFileText(string ticketFileText);

        /// <summary>
        /// 添加电子票字节数组
        /// </summary>
        /// <param name="ticketByteArr"></param>
        void AddBytes(byte[] ticketByteArr);
    }
}
