convert_bean.dart 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import 'convert_contain_options_bean.dart';
  2. /// convert_bean.dart
  3. ///
  4. /// Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
  5. ///
  6. /// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  7. /// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  8. /// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  9. /// This notice may not be removed from this file.
  10. const convertConverting = 1;
  11. const convertSuccess = 2;
  12. const convertFail = 3;
  13. class ConvertBean {
  14. String tag;
  15. String filePath;
  16. String fileName;
  17. String convertType;
  18. int status;
  19. int progress;
  20. String? outputPath;
  21. ConvertOptionsBean options;
  22. ConvertBean(
  23. {required this.tag,
  24. required this.filePath,
  25. required this.fileName,
  26. required this.convertType,
  27. required this.status,
  28. required this.progress,
  29. this.outputPath,
  30. required this.options});
  31. String getStatusName() {
  32. switch (status) {
  33. case convertConverting:
  34. return "Converting ($progress%)";
  35. case convertSuccess:
  36. return "SUCCESS";
  37. case convertFail:
  38. return "FAIL";
  39. default:
  40. return "";
  41. }
  42. }
  43. Map<String, String> getOptions() {
  44. return options.getOptions(this);
  45. }
  46. }