IWidget.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Dashboard;
  8. /**
  9. * Interface IWidget
  10. *
  11. * @since 20.0.0
  12. */
  13. interface IWidget {
  14. /**
  15. * @return string Unique id that identifies the widget, e.g. the app id
  16. * @since 20.0.0
  17. */
  18. public function getId(): string;
  19. /**
  20. * @return string User facing title of the widget
  21. * @since 20.0.0
  22. */
  23. public function getTitle(): string;
  24. /**
  25. * @return int Initial order for widget sorting
  26. * @since 20.0.0
  27. */
  28. public function getOrder(): int;
  29. /**
  30. * @return string css class that displays an icon next to the widget title
  31. * @since 20.0.0
  32. */
  33. public function getIconClass(): string;
  34. /**
  35. * @return string|null The absolute url to the apps own view
  36. * @since 20.0.0
  37. */
  38. public function getUrl(): ?string;
  39. /**
  40. * Execute widget bootstrap code like loading scripts and providing initial state
  41. * @since 20.0.0
  42. */
  43. public function load(): void;
  44. }