SharedParamPhoto.java 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. package com.epson.iprint.shared;
  2. import android.os.Bundle;
  3. import com.epson.mobilephone.common.PrintingLib.define.Constants;
  4. import java.io.Serializable;
  5. import java.util.ArrayList;
  6. import epson.print.CommonDefine;
  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. protected void setParam(Bundle bundle) throws SharedDataException {
  25. this.file_type = bundle.getInt("FILE_TYPE", 2);
  26. int i = this.file_type;
  27. if (i < 0 || i > 4) {
  28. throw new ParametersErrorException("FILE_TYPE errorr");
  29. }
  30. this.folder_name = bundle.getString("FOLDER_NAME");
  31. if (!this.folder_name.equals((Object) null)) {
  32. this.arrayFilePath = bundle.getStringArrayList("FILE_NAME");
  33. if (this.arrayFilePath.size() != 0) {
  34. this.print_mode = bundle.getInt("PRINT_MODE", 0);
  35. int i2 = this.print_mode;
  36. if (i2 < 0 || i2 > 1) {
  37. throw new ParametersErrorException("PRINT_MODE error");
  38. }
  39. this.media_type = bundle.getInt("MEDIA_TYPE", 0);
  40. 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()) {
  41. this.media_size = bundle.getInt("MEDIA_SIZE", 0);
  42. 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()) {
  43. this.color_mode = bundle.getInt("COLOR_MODE", 0);
  44. int i3 = this.color_mode;
  45. if (i3 == 0 || i3 == 1) {
  46. this.layout_type = bundle.getInt("LAYOUT_TYPE", 2);
  47. int i4 = this.layout_type;
  48. if (i4 == 1 || i4 == 2) {
  49. this.package_name = bundle.getString(EpsoniPrintSharedActivity.PARAM_KEY_CALLER_PACKAGE_NAME);
  50. if (!this.package_name.equals((Object) null)) {
  51. setFullPathName();
  52. this.isValid = true;
  53. return;
  54. }
  55. throw new ParametersErrorException("PACKAGE_NAME error");
  56. }
  57. throw new ParametersErrorException("LAYOUT_TYPE error");
  58. }
  59. throw new ParametersErrorException("COLOR_MODE error");
  60. }
  61. throw new ParametersErrorException("MEDIA_SIZE error");
  62. }
  63. throw new ParametersErrorException("MEDIA_TYPE error");
  64. }
  65. throw new ParametersErrorException("FILE_NAME error");
  66. }
  67. throw new ParametersErrorException("FOLDER_NAME error");
  68. }
  69. private void setFullPathName() {
  70. this.arrayFileFullPath = new ArrayList<>();
  71. for (int i = 0; i < this.arrayFilePath.size(); i++) {
  72. ArrayList<String> arrayList = this.arrayFileFullPath;
  73. arrayList.add(this.folder_name + CommonDefine.SLASH + this.arrayFilePath.get(i));
  74. }
  75. }
  76. public int getFile_type() {
  77. return this.file_type;
  78. }
  79. public boolean isTIFF() {
  80. return this.file_type == 4;
  81. }
  82. public boolean isFileTypeValid() {
  83. return this.file_type > 0;
  84. }
  85. public String getFolder_name() {
  86. return this.folder_name;
  87. }
  88. public ArrayList<String> getArrayFilePath() {
  89. return this.arrayFilePath;
  90. }
  91. public ArrayList<String> getArrayFileFullPath() {
  92. return this.arrayFileFullPath;
  93. }
  94. public void setArrayFileFullPath(String str) {
  95. this.arrayFileFullPath.add(str);
  96. }
  97. public void setArrayFileFullPath(int i, String str) {
  98. this.arrayFileFullPath.set(i, str);
  99. }
  100. public void clearArrayFileFullPath() {
  101. this.arrayFileFullPath.clear();
  102. }
  103. public int getPrint_mode() {
  104. return this.print_mode;
  105. }
  106. public int getMedia_type() {
  107. return this.media_type;
  108. }
  109. public int getMedia_size() {
  110. return this.media_size;
  111. }
  112. public int getColor_mode() {
  113. return this.color_mode;
  114. }
  115. public int getLayout_type() {
  116. return this.layout_type;
  117. }
  118. }