IManager.php 1.7 KB

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