task_status.dart 921 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /// task_status.dart
  2. ///
  3. /// Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
  4. ///
  5. /// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  6. /// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  7. /// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  8. /// This notice may not be removed from this file.
  9. enum TaskStatus {
  10. wait,
  11. start,
  12. converting,
  13. success,
  14. fail,
  15. cancel,
  16. }
  17. TaskStatus getConvertStatusByCode(int statusCode) {
  18. switch (statusCode) {
  19. case 0:
  20. return TaskStatus.wait;
  21. case 1:
  22. return TaskStatus.start;
  23. case 2:
  24. return TaskStatus.converting;
  25. case 3:
  26. return TaskStatus.success;
  27. case 4:
  28. return TaskStatus.fail;
  29. case 5:
  30. return TaskStatus.cancel;
  31. default:
  32. return TaskStatus.wait;
  33. }
  34. }