IPDFDeviceActionHandler.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. 
  2. namespace Paroxe.PdfRenderer
  3. {
  4. /// <summary>
  5. /// Implement this class to provide a custom action handling stategy. For example, PDFViewer.BookmarksActionHandler
  6. /// and PDFViewer.LinksActionHandler both refer to a default implementation of this interface.
  7. /// </summary>
  8. public interface IPDFDeviceActionHandler
  9. {
  10. /// <summary>
  11. /// Called when a goto action is triggered.
  12. /// </summary>
  13. /// <param name="device"></param>
  14. /// <param name="pageIndex"></param>
  15. void HandleGotoAction(IPDFDevice device, int pageIndex);
  16. /// <summary>
  17. /// Called when a launch action is triggered.
  18. /// </summary>
  19. /// <param name="device"></param>
  20. /// <param name="filePath"></param>
  21. void HandleLaunchAction(IPDFDevice device, string filePath);
  22. /// <summary>
  23. /// Implement the function if you want to provide password. This method received the resolved path
  24. /// returned by the previous method (HandleRemoteGotoActionPathResolving)
  25. /// </summary>
  26. /// <param name="device"></param>
  27. /// <param name="resolvedFilePath"></param>
  28. /// <returns></returns>
  29. string HandleRemoteGotoActionPasswordResolving(IPDFDevice device, string resolvedFilePath);
  30. /// <summary>
  31. /// Implement the function if you want custom path resolving before PDF Viewer open other pdf file.
  32. /// The method must return the modified filePath or just return the original filePath.
  33. /// See PDFViewerDefaultActionHandler class for the default implementation.
  34. /// </summary>
  35. /// <param name="device"></param>
  36. /// <param name="filePath"></param>
  37. /// <returns></returns>
  38. string HandleRemoteGotoActionPathResolving(IPDFDevice device, string filePath);
  39. /// <summary>
  40. /// This method is called after the new pdf document is loaded but not yet opened in the pdfViewer.
  41. /// See PDFViewerDefaultActionHandler class for the default implementation.
  42. /// </summary>
  43. /// <param name="device"></param>
  44. /// <param name="document"></param>
  45. /// <param name="pageIndex"></param>
  46. void HandleRemoteGotoActionResolved(IPDFDevice device, PDFDocument document, int pageIndex);
  47. /// <summary>
  48. /// This method is called when the pdf pdf file at filePath doesn't exists or is invalid.
  49. /// </summary>
  50. /// <param name="device"></param>
  51. /// <param name="resolvedFilePath"></param>
  52. void HandleRemoteGotoActionUnresolved(IPDFDevice device, string resolvedFilePath);
  53. /// <summary>
  54. /// Called when the action is unsuported
  55. /// </summary>
  56. /// <param name="device"></param>
  57. void HandleUnsuportedAction(IPDFDevice device);
  58. /// <summary>
  59. /// Called for action that point to an Uri (Universal Resource Identifier)
  60. /// </summary>
  61. /// <param name="device"></param>
  62. /// <param name="uri"></param>
  63. void HandleUriAction(IPDFDevice device, string uri);
  64. }
  65. }