NotificationSupport.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. declare(strict_types=1);
  3. namespace Sabre\CalDAV\Backend;
  4. use Sabre\CalDAV\Xml\Notification\NotificationInterface;
  5. /**
  6. * Adds caldav notification support to a backend.
  7. *
  8. * Note: This feature is experimental, and may change in between different
  9. * SabreDAV versions.
  10. *
  11. * Notifications are defined at:
  12. * http://svn.calendarserver.org/repository/calendarserver/CalendarServer/trunk/doc/Extensions/caldav-notifications.txt
  13. *
  14. * These notifications are basically a list of server-generated notifications
  15. * displayed to the user. Users can dismiss notifications by deleting them.
  16. *
  17. * The primary usecase is to allow for calendar-sharing.
  18. *
  19. * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
  20. * @author Evert Pot (http://evertpot.com/)
  21. * @license http://sabre.io/license/ Modified BSD License
  22. */
  23. interface NotificationSupport extends BackendInterface
  24. {
  25. /**
  26. * Returns a list of notifications for a given principal url.
  27. *
  28. * @param string $principalUri
  29. *
  30. * @return NotificationInterface[]
  31. */
  32. public function getNotificationsForPrincipal($principalUri);
  33. /**
  34. * This deletes a specific notifcation.
  35. *
  36. * This may be called by a client once it deems a notification handled.
  37. *
  38. * @param string $principalUri
  39. */
  40. public function deleteNotification($principalUri, NotificationInterface $notification);
  41. /**
  42. * This method is called when a user replied to a request to share.
  43. *
  44. * If the user chose to accept the share, this method should return the
  45. * newly created calendar url.
  46. *
  47. * @param string $href The sharee who is replying (often a mailto: address)
  48. * @param int $status One of the SharingPlugin::STATUS_* constants
  49. * @param string $calendarUri The url to the calendar thats being shared
  50. * @param string $inReplyTo The unique id this message is a response to
  51. * @param string $summary A description of the reply
  52. *
  53. * @return string|null
  54. */
  55. public function shareReply($href, $status, $calendarUri, $inReplyTo, $summary = null);
  56. }