import 'package:fis_common/event/event_type.dart';
import 'package:fis_jsonrpc/rpc.dart';

import 'entities/install_printer_driver_state.dart';
import 'entities/print_driver_info.dart';
import 'entities/printer_drive.dart';

abstract class IRemoteMaintenanceManager {
  FEventHandler<PrintDriverInfo> onCheckPrintDriverStateChange =
      FEventHandler<PrintDriverInfo>();
  final FEventHandler<bool> onCancelExtendButtons = FEventHandler<bool>();

  ///壳子中安装打印驱动的状态改变通知
  final onInstallPrinterDriverChange =
      FEventHandler<InstallPrinterDriverState>();
  Future<bool> deletePrinterByCodeAsync(String code);

  ///保存并退出成功通知
  final onSystemSaveAndExit = FEventHandler<bool>();

  Future<PageResult<DevicePrinterDTO>> findDevicePrinterPagesAsync({
    String? keyword,
    int pageIndex = 1,
    int pageSize = 20,
  });

  Future<List<String>> getUninstalledPrinters({String? ip});

  void installPrinterDriver(PrinterDrive printerDrive);

  void closePrinterDriverManager();

  Future<bool> printTestPage(String name);

  Future<bool> chooseLocalDrive();
}

enum CheckPrintDriverState {
  Ready,
  Success,

  ///文件过大
  LargeFile,

  ///打印驱动文件校验失败
  VerificationFailed,
  Failed,
}
