IManager.php 2.4 KB

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