IPDFDeviceActionHandler.cs 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. http://www.cgsoso.com/forum-211-1.html
  3. CG搜搜 Unity3d 每日Unity3d插件免费更新 更有VIP资源!
  4. CGSOSO 主打游戏开发,影视设计等CG资源素材。
  5. 插件如若商用,请务必官网购买!
  6. daily assets update for try.
  7. U should buy the asset from home store if u use it in your project!
  8. */
  9. namespace Paroxe.PdfRenderer
  10. {
  11. /// <summary>
  12. /// Implement this class to provide a custom action handling stategy. For example, PDFViewer.BookmarksActionHandler
  13. /// and PDFViewer.LinksActionHandler both refer to a default implementation of this interface.
  14. /// </summary>
  15. public interface IPDFDeviceActionHandler
  16. {
  17. /// <summary>
  18. /// Called when a goto action is triggered.
  19. /// </summary>
  20. /// <param name="device"></param>
  21. /// <param name="pageIndex"></param>
  22. void HandleGotoAction(IPDFDevice device, int pageIndex);
  23. /// <summary>
  24. /// Called when a launch action is triggered.
  25. /// </summary>
  26. /// <param name="device"></param>
  27. /// <param name="filePath"></param>
  28. void HandleLaunchAction(IPDFDevice device, string filePath);
  29. /// <summary>
  30. /// Implement the function if you want to provide password. This method received the resolved path
  31. /// returned by the previous method (HandleRemoteGotoActionPathResolving)
  32. /// </summary>
  33. /// <param name="device"></param>
  34. /// <param name="resolvedFilePath"></param>
  35. /// <returns></returns>
  36. string HandleRemoteGotoActionPasswordResolving(IPDFDevice device, string resolvedFilePath);
  37. /// <summary>
  38. /// Implement the function if you want custom path resolving before PDF Viewer open other pdf file.
  39. /// The method must return the modified filePath or just return the original filePath.
  40. /// See PDFViewerDefaultActionHandler class for the default implementation.
  41. /// </summary>
  42. /// <param name="device"></param>
  43. /// <param name="filePath"></param>
  44. /// <returns></returns>
  45. string HandleRemoteGotoActionPathResolving(IPDFDevice device, string filePath);
  46. /// <summary>
  47. /// This method is called after the new pdf document is loaded but not yet opened in the pdfViewer.
  48. /// See PDFViewerDefaultActionHandler class for the default implementation.
  49. /// </summary>
  50. /// <param name="device"></param>
  51. /// <param name="document"></param>
  52. /// <param name="pageIndex"></param>
  53. void HandleRemoteGotoActionResolved(IPDFDevice device, PDFDocument document, int pageIndex);
  54. /// <summary>
  55. /// This method is called when the pdf pdf file at filePath doesn't exists or is invalid.
  56. /// </summary>
  57. /// <param name="device"></param>
  58. /// <param name="resolvedFilePath"></param>
  59. void HandleRemoteGotoActionUnresolved(IPDFDevice device, string resolvedFilePath);
  60. /// <summary>
  61. /// Called when the action is unsuported
  62. /// </summary>
  63. /// <param name="device"></param>
  64. void HandleUnsuportedAction(IPDFDevice device);
  65. /// <summary>
  66. /// Called for action that point to an Uri (Universal Resource Identifier)
  67. /// </summary>
  68. /// <param name="device"></param>
  69. /// <param name="uri"></param>
  70. void HandleUriAction(IPDFDevice device, string uri);
  71. }
  72. }