IManager.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2016, ownCloud, Inc.
  5. *
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Roeland Jago Douma <roeland@famdouma.nl>
  8. *
  9. * @license AGPL-3.0
  10. *
  11. * This code is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License, version 3,
  13. * as published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License, version 3,
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>
  22. *
  23. */
  24. namespace OCP\Notification;
  25. /**
  26. * Interface IManager
  27. *
  28. * @package OCP\Notification
  29. * @since 9.0.0
  30. */
  31. interface IManager extends IApp, INotifier {
  32. /**
  33. * @param string $appClass The service must implement IApp, otherwise a
  34. * \InvalidArgumentException is thrown later
  35. * @since 17.0.0
  36. */
  37. public function registerApp(string $appClass): void;
  38. /**
  39. * @param \Closure $service The service must implement INotifier, otherwise a
  40. * \InvalidArgumentException is thrown later
  41. * @param \Closure $info An array with the keys 'id' and 'name' containing
  42. * the app id and the app name
  43. * @deprecated 17.0.0 use registerNotifierService instead.
  44. * @since 8.2.0 - Parameter $info was added in 9.0.0
  45. */
  46. public function registerNotifier(\Closure $service, \Closure $info);
  47. /**
  48. * @param string $notifierService The service must implement INotifier, otherwise a
  49. * \InvalidArgumentException is thrown later
  50. * @since 17.0.0
  51. */
  52. public function registerNotifierService(string $notifierService): void;
  53. /**
  54. * @return INotifier[]
  55. * @since 9.0.0
  56. */
  57. public function getNotifiers(): array;
  58. /**
  59. * @return INotification
  60. * @since 9.0.0
  61. */
  62. public function createNotification(): INotification;
  63. /**
  64. * @return bool
  65. * @since 9.0.0
  66. */
  67. public function hasNotifiers(): bool;
  68. /**
  69. * @param bool $preparingPushNotification
  70. * @since 14.0.0
  71. */
  72. public function setPreparingPushNotification(bool $preparingPushNotification): void;
  73. /**
  74. * @return bool
  75. * @since 14.0.0
  76. */
  77. public function isPreparingPushNotification(): bool;
  78. /**
  79. * @since 18.0.0
  80. */
  81. public function dismissNotification(INotification $notification): void;
  82. }