ILinkAction.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Profile;
  8. use OCP\IUser;
  9. /**
  10. * @since 23.0.0
  11. */
  12. interface ILinkAction {
  13. /**
  14. * Preload the user specific value required by the action
  15. *
  16. * e.g. the email is loaded for the email action and the userId for the Talk action
  17. *
  18. * @since 23.0.0
  19. */
  20. public function preload(IUser $targetUser): void;
  21. /**
  22. * Returns the app ID of the action
  23. *
  24. * e.g. 'spreed'
  25. *
  26. * @since 23.0.0
  27. */
  28. public function getAppId(): string;
  29. /**
  30. * Returns the unique ID of the action
  31. *
  32. * *For account properties this is the constant defined in lib/public/Accounts/IAccountManager.php*
  33. *
  34. * e.g. 'email'
  35. *
  36. * @since 23.0.0
  37. */
  38. public function getId(): string;
  39. /**
  40. * Returns the translated unique display ID of the action
  41. *
  42. * Should be something short and descriptive of the action
  43. * as this is seen by the end-user when configuring actions
  44. *
  45. * e.g. 'Email'
  46. *
  47. * @since 23.0.0
  48. */
  49. public function getDisplayId(): string;
  50. /**
  51. * Returns the translated title
  52. *
  53. * e.g. 'Mail user@domain.com'
  54. *
  55. * Use the L10N service to translate it
  56. *
  57. * @since 23.0.0
  58. */
  59. public function getTitle(): string;
  60. /**
  61. * Returns the priority
  62. *
  63. * *Actions are sorted in ascending order*
  64. *
  65. * e.g. 60
  66. *
  67. * @since 23.0.0
  68. */
  69. public function getPriority(): int;
  70. /**
  71. * Returns the URL link to the 16*16 SVG icon
  72. *
  73. * @since 23.0.0
  74. */
  75. public function getIcon(): string;
  76. /**
  77. * Returns the target of the action,
  78. * if null is returned the action won't be registered
  79. *
  80. * e.g. 'mailto:user@domain.com'
  81. *
  82. * @since 23.0.0
  83. */
  84. public function getTarget(): ?string;
  85. }