PDFViewerInternal.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. using UnityEngine;
  2. using UnityEngine.EventSystems;
  3. using UnityEngine.UI;
  4. #pragma warning disable 649
  5. namespace Paroxe.PdfRenderer.Internal.Viewer
  6. {
  7. public class PDFViewerInternal : UIBehaviour
  8. {
  9. [SerializeField]
  10. private PDFViewer m_PDFViewer;
  11. [SerializeField]
  12. private RectTransform m_DownloadDialog;
  13. [SerializeField]
  14. private Text m_DownloadSourceLabel;
  15. [SerializeField]
  16. private RectTransform m_HorizontalScrollBar;
  17. [SerializeField]
  18. private Image m_InvalidPasswordImage;
  19. [SerializeField]
  20. private PDFViewerLeftPanel m_LeftPanel;
  21. [SerializeField]
  22. private CanvasGroup m_Overlay;
  23. [SerializeField]
  24. private RectTransform m_PageContainer;
  25. [SerializeField]
  26. private Text m_PageCountLabel;
  27. [SerializeField]
  28. private Button m_PageDownButton;
  29. [SerializeField]
  30. private InputField m_PageInputField;
  31. [SerializeField]
  32. private RawImage m_PageSample;
  33. [SerializeField]
  34. private Button m_PageUpButton;
  35. [SerializeField]
  36. private Text m_PageZoomLabel;
  37. [SerializeField]
  38. private RectTransform m_PasswordDialog;
  39. [SerializeField]
  40. private InputField m_PasswordInputField;
  41. [SerializeField]
  42. private Text m_ProgressLabel;
  43. [SerializeField]
  44. private RectTransform m_ProgressRect;
  45. [SerializeField]
  46. private RectTransform m_ScrollCorner;
  47. [SerializeField]
  48. private ScrollRect m_ScrollRect;
  49. [SerializeField]
  50. private RectTransform m_TopPanel;
  51. [SerializeField]
  52. private RectTransform m_VerticalScrollBar;
  53. [SerializeField]
  54. private RectTransform m_Viewport;
  55. [SerializeField]
  56. private RectTransform m_SearchPanel;
  57. public RectTransform DownloadDialog { get { return m_DownloadDialog; } }
  58. public Text DownloadSourceLabel { get { return m_DownloadSourceLabel; } }
  59. public RectTransform HorizontalScrollBar { get { return m_HorizontalScrollBar; } }
  60. public Image InvalidPasswordImage { get { return m_InvalidPasswordImage; } }
  61. public PDFViewerLeftPanel LeftPanel { get { return m_LeftPanel; } }
  62. public CanvasGroup Overlay { get { return m_Overlay; } }
  63. public RectTransform PageContainer { get { return m_PageContainer; } }
  64. public Text PageCountLabel { get { return m_PageCountLabel; } }
  65. public RawImage PageSample { get { return m_PageSample; } }
  66. public Text PageZoomLabel { get { return m_PageZoomLabel; } }
  67. public RectTransform PasswordDialog { get { return m_PasswordDialog; } }
  68. public Text ProgressLabel { get { return m_ProgressLabel; } }
  69. public RectTransform ProgressRect { get { return m_ProgressRect; } }
  70. public RectTransform ScrollCorner { get { return m_ScrollCorner; } }
  71. public ScrollRect ScrollRect { get { return m_ScrollRect; } }
  72. public RectTransform TopPanel { get { return m_TopPanel; } }
  73. public RectTransform VerticalScrollBar { get { return m_VerticalScrollBar; } }
  74. public RectTransform Viewport { get { return m_Viewport; } }
  75. public RectTransform SearchPanel { get { return m_SearchPanel; } }
  76. public InputField PasswordInputField { get { return m_PasswordInputField; } }
  77. public InputField PageInputField { get { return m_PageInputField; } }
  78. public void OnDownloadCancelButtonClicked()
  79. {
  80. m_PDFViewer.CancelDownload();
  81. }
  82. public void OnNextPageButtonClicked()
  83. {
  84. m_PDFViewer.GoToNextPage();
  85. }
  86. public void OnPageIndexEditEnd()
  87. {
  88. m_PDFViewer.OnPageEditEnd();
  89. }
  90. public void OnPasswordDialogCancelButtonClicked()
  91. {
  92. m_PDFViewer.OnPasswordDialogCancelButtonClicked();
  93. }
  94. public void OnPasswordDialogOkButtonClicked()
  95. {
  96. m_PDFViewer.OnPasswordDialogOkButtonClicked();
  97. }
  98. public void OnPreviousPageButtonClicked()
  99. {
  100. m_PDFViewer.GoToPreviousPage();
  101. }
  102. public void OnZoomInButtonClicked()
  103. {
  104. m_PDFViewer.ZoomIn();
  105. }
  106. public void OnZoomOutButtonClicked()
  107. {
  108. m_PDFViewer.ZoomOut();
  109. }
  110. }
  111. }