PaperSize.java 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package com.epson.mobilephone.common.escpr;
  2. import com.epson.mobilephone.common.escpr.MediaInfo;
  3. public class PaperSize {
  4. public int mHeight;
  5. MediaInfo.AbstractInfo_size mInfo;
  6. public int mWidth;
  7. public PaperSize() {
  8. mWidth = 0;
  9. mHeight = 0;
  10. }
  11. public PaperSize(int i) {
  12. mInfo = new MediaInfo.PaperSize_constants();
  13. Info_paper stringId = mInfo.getStringId(i);
  14. mWidth = stringId.getPaper_width();
  15. mHeight = stringId.getPaper_height();
  16. mInfo.destructor();
  17. }
  18. public void setPaperSize(int i) {
  19. mInfo = new MediaInfo.PaperSize_constants();
  20. Info_paper stringId = mInfo.getStringId(i);
  21. mWidth = stringId.getPaper_width();
  22. mHeight = stringId.getPaper_height();
  23. mInfo.destructor();
  24. }
  25. public int[] getPaperSizeBoder(int i) {
  26. mInfo = new MediaInfo.PaperSize_constants();
  27. Info_paper stringId = mInfo.getStringId(i);
  28. int[] iArr = {stringId.getPaper_width_boder(), stringId.getPaper_height_boder()};
  29. mInfo.destructor();
  30. return iArr;
  31. }
  32. public int getWidth_boder(int i) {
  33. mInfo = new MediaInfo.PaperSize_constants();
  34. int paper_width_boder = mInfo.getStringId(i).getPaper_width_boder();
  35. mInfo.destructor();
  36. return paper_width_boder;
  37. }
  38. public int getHeight_boder(int i) {
  39. mInfo = new MediaInfo.PaperSize_constants();
  40. int paper_height_boder = mInfo.getStringId(i).getPaper_height_boder();
  41. mInfo.destructor();
  42. return paper_height_boder;
  43. }
  44. public int getWidth_boderLess(int i) {
  45. mInfo = new MediaInfo.PaperSize_constants();
  46. int paper_width_boderless = mInfo.getStringId(i).getPaper_width_boderless();
  47. mInfo.destructor();
  48. return paper_width_boderless;
  49. }
  50. public int getHeight_boderLess(int i) {
  51. mInfo = new MediaInfo.PaperSize_constants();
  52. int paper_height_boderless = mInfo.getStringId(i).getPaper_height_boderless();
  53. mInfo.destructor();
  54. return paper_height_boderless;
  55. }
  56. public int getTopMargin(int i) {
  57. mInfo = new MediaInfo.PaperSize_constants();
  58. int topMargin = mInfo.getStringId(i).getTopMargin();
  59. mInfo.destructor();
  60. return Math.abs(topMargin);
  61. }
  62. public int getLeftMargin(int i) {
  63. mInfo = new MediaInfo.PaperSize_constants();
  64. int leftMargin = mInfo.getStringId(i).getLeftMargin();
  65. mInfo.destructor();
  66. return Math.abs(leftMargin);
  67. }
  68. public int getHeightPaper() {
  69. return mHeight;
  70. }
  71. public int getWidthPaper() {
  72. return mWidth;
  73. }
  74. }