You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
3.5 KiB

3 years ago
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright 2018, Maxence Lange <maxence@artificial-owl.com>
  5. *
  6. * @author Julius Härtl <jus@bitgrid.net>
  7. * @author Maxence Lange <maxence@artificial-owl.com>
  8. *
  9. * @license GNU AGPL version 3 or any later version
  10. *
  11. * This program is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License as
  13. * published by the Free Software Foundation, either version 3 of the
  14. * License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  23. *
  24. */
  25. namespace OCP\Dashboard;
  26. use OCP\Dashboard\Exceptions\DashboardAppNotAvailableException;
  27. use OCP\Dashboard\Model\IWidgetConfig;
  28. use OCP\Dashboard\Service\IEventsService;
  29. use OCP\Dashboard\Service\IWidgetsService;
  30. /**
  31. * Interface IDashboardManager
  32. *
  33. * IDashboardManager should be used to manage widget from the backend.
  34. * The call can be done from any Service.
  35. *
  36. * @since 15.0.0
  37. * @deprecated 20.0.0
  38. *
  39. */
  40. interface IDashboardManager {
  41. /**
  42. * Register a IWidgetsService.
  43. *
  44. * @since 15.0.0
  45. * @deprecated 20.0.0
  46. *
  47. * @param IWidgetsService $widgetsService
  48. */
  49. public function registerWidgetsService(IWidgetsService $widgetsService);
  50. /**
  51. * Register a IEventsService.
  52. *
  53. * @since 15.0.0
  54. * @deprecated 20.0.0
  55. *
  56. * @param IEventsService $eventsService
  57. */
  58. public function registerEventsService(IEventsService $eventsService);
  59. /**
  60. * returns the OCP\Dashboard\Model\IWidgetConfig for a widgetId and userId.
  61. *
  62. * @see IWidgetConfig
  63. *
  64. * @since 15.0.0
  65. * @deprecated 20.0.0
  66. *
  67. * @param string $widgetId
  68. * @param string $userId
  69. *
  70. * @throws DashboardAppNotAvailableException
  71. * @return IWidgetConfig
  72. */
  73. public function getWidgetConfig(string $widgetId, string $userId): IWidgetConfig;
  74. /**
  75. * Create push notifications for users.
  76. * $payload is an array that will be send to the Javascript method
  77. * called on push.
  78. * $uniqueId needs to be used if you send the push to multiples users
  79. * and multiples groups so that one user does not have duplicate
  80. * notifications.
  81. *
  82. * Push notifications are created in database and broadcast to user
  83. * that are running dashboard.
  84. *
  85. * @since 15.0.0
  86. * @deprecated 20.0.0
  87. *
  88. * @param string $widgetId
  89. * @param array $users
  90. * @param array $payload
  91. * @param string $uniqueId
  92. * @throws DashboardAppNotAvailableException
  93. */
  94. public function createUsersEvent(string $widgetId, array $users, array $payload, string $uniqueId = '');
  95. /**
  96. * Create push notifications for groups. (ie. createUsersEvent())
  97. *
  98. * @since 15.0.0
  99. * @deprecated 20.0.0
  100. *
  101. * @param string $widgetId
  102. * @param array $groups
  103. * @param array $payload
  104. * @param string $uniqueId
  105. * @throws DashboardAppNotAvailableException
  106. */
  107. public function createGroupsEvent(string $widgetId, array $groups, array $payload, string $uniqueId = '');
  108. /**
  109. * Create push notifications for everyone. (ie. createUsersEvent())
  110. *
  111. * @since 15.0.0
  112. * @deprecated 20.0.0
  113. *
  114. * @param string $widgetId
  115. * @param array $payload
  116. * @param string $uniqueId
  117. * @throws DashboardAppNotAvailableException
  118. */
  119. public function createGlobalEvent(string $widgetId, array $payload, string $uniqueId = '');
  120. }