SharedParamPhoto.java 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. package com.epson.iprint.shared;
  2. import android.os.Bundle;
  3. import com.epson.mobilephone.common.PrintingLib.define.Constants;
  4. import epson.print.CommonDefine;
  5. import java.io.Serializable;
  6. import java.util.ArrayList;
  7. public class SharedParamPhoto extends SharedParam implements Serializable {
  8. private static final long serialVersionUID = 1;
  9. private ArrayList<String> arrayFileFullPath = null;
  10. private ArrayList<String> arrayFilePath = null;
  11. private int color_mode = 0;
  12. private int file_type = 0;
  13. private String folder_name = null;
  14. private int layout_type = 2;
  15. private int media_size = 0;
  16. private int media_type = 0;
  17. private int print_mode = 0;
  18. public /* bridge */ /* synthetic */ String getPackage_name() {
  19. return super.getPackage_name();
  20. }
  21. public /* bridge */ /* synthetic */ boolean isAvailable() {
  22. return super.isAvailable();
  23. }
  24. /* access modifiers changed from: protected */
  25. public void setParam(Bundle bundle) throws SharedDataException {
  26. this.file_type = bundle.getInt("FILE_TYPE", 2);
  27. int i = this.file_type;
  28. if (i < 0 || i > 4) {
  29. throw new ParametersErrorException("FILE_TYPE errorr");
  30. }
  31. this.folder_name = bundle.getString("FOLDER_NAME");
  32. if (!this.folder_name.equals((Object) null)) {
  33. this.arrayFilePath = bundle.getStringArrayList("FILE_NAME");
  34. if (this.arrayFilePath.size() != 0) {
  35. this.print_mode = bundle.getInt("PRINT_MODE", 0);
  36. int i2 = this.print_mode;
  37. if (i2 < 0 || i2 > 1) {
  38. throw new ParametersErrorException("PRINT_MODE error");
  39. }
  40. this.media_type = bundle.getInt("MEDIA_TYPE", 0);
  41. if (this.media_type == Constants.MediaName.EPS_MTID_PLAIN.getCode() || this.media_type == Constants.MediaName.EPS_MTID_PGPHOTO.getCode() || this.media_type == Constants.MediaName.EPS_MTID_HAGAKIRECL.getCode() || this.media_type == Constants.MediaName.EPS_MTID_HAGAKIINKJET.getCode()) {
  42. this.media_size = bundle.getInt("MEDIA_SIZE", 0);
  43. if (this.media_size == Constants.PaperName.EPS_MSID_A4.getCode() || this.media_size == Constants.PaperName.EPS_MSID_4X6.getCode() || this.media_size == Constants.PaperName.EPS_MSID_L.getCode() || this.media_size == Constants.PaperName.EPS_MSID_POSTCARD.getCode()) {
  44. this.color_mode = bundle.getInt("COLOR_MODE", 0);
  45. int i3 = this.color_mode;
  46. if (i3 == 0 || i3 == 1) {
  47. this.layout_type = bundle.getInt("LAYOUT_TYPE", 2);
  48. int i4 = this.layout_type;
  49. if (i4 == 1 || i4 == 2) {
  50. this.package_name = bundle.getString(EpsoniPrintSharedActivity.PARAM_KEY_CALLER_PACKAGE_NAME);
  51. if (!this.package_name.equals((Object) null)) {
  52. setFullPathName();
  53. this.isValid = true;
  54. return;
  55. }
  56. throw new ParametersErrorException("PACKAGE_NAME error");
  57. }
  58. throw new ParametersErrorException("LAYOUT_TYPE error");
  59. }
  60. throw new ParametersErrorException("COLOR_MODE error");
  61. }
  62. throw new ParametersErrorException("MEDIA_SIZE error");
  63. }
  64. throw new ParametersErrorException("MEDIA_TYPE error");
  65. }
  66. throw new ParametersErrorException("FILE_NAME error");
  67. }
  68. throw new ParametersErrorException("FOLDER_NAME error");
  69. }
  70. private void setFullPathName() {
  71. this.arrayFileFullPath = new ArrayList<>();
  72. for (int i = 0; i < this.arrayFilePath.size(); i++) {
  73. ArrayList<String> arrayList = this.arrayFileFullPath;
  74. arrayList.add(this.folder_name + CommonDefine.SLASH + this.arrayFilePath.get(i));
  75. }
  76. }
  77. public int getFile_type() {
  78. return this.file_type;
  79. }
  80. public boolean isTIFF() {
  81. return this.file_type == 4;
  82. }
  83. public boolean isFileTypeValid() {
  84. return this.file_type > 0;
  85. }
  86. public String getFolder_name() {
  87. return this.folder_name;
  88. }
  89. public ArrayList<String> getArrayFilePath() {
  90. return this.arrayFilePath;
  91. }
  92. public ArrayList<String> getArrayFileFullPath() {
  93. return this.arrayFileFullPath;
  94. }
  95. public void setArrayFileFullPath(String str) {
  96. this.arrayFileFullPath.add(str);
  97. }
  98. public void setArrayFileFullPath(int i, String str) {
  99. this.arrayFileFullPath.set(i, str);
  100. }
  101. public void clearArrayFileFullPath() {
  102. this.arrayFileFullPath.clear();
  103. }
  104. public int getPrint_mode() {
  105. return this.print_mode;
  106. }
  107. public int getMedia_type() {
  108. return this.media_type;
  109. }
  110. public int getMedia_size() {
  111. return this.media_size;
  112. }
  113. public int getColor_mode() {
  114. return this.color_mode;
  115. }
  116. public int getLayout_type() {
  117. return this.layout_type;
  118. }
  119. }