RegisterDirectEditorEvent.php 741 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCP\DirectEditing;
  7. use OCP\EventDispatcher\Event;
  8. /**
  9. * Event to allow to register the direct editor.
  10. *
  11. * @since 18.0.0
  12. */
  13. class RegisterDirectEditorEvent extends Event {
  14. /**
  15. * @var IManager
  16. */
  17. private $manager;
  18. /**
  19. * RegisterDirectEditorEvent constructor.
  20. *
  21. * @param IManager $manager
  22. * @since 18.0.0
  23. */
  24. public function __construct(IManager $manager) {
  25. parent::__construct();
  26. $this->manager = $manager;
  27. }
  28. /**
  29. * @since 18.0.0
  30. * @param IEditor $editor
  31. */
  32. public function register(IEditor $editor): void {
  33. $this->manager->registerDirectEditor($editor);
  34. }
  35. }