1
0

ICalendarProvider.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\DAV\CalDAV\Integration;
  7. /**
  8. * Interface ICalendarProvider
  9. *
  10. * @package OCA\DAV\CalDAV\Integration
  11. * @since 19.0.0
  12. */
  13. interface ICalendarProvider {
  14. /**
  15. * Provides the appId of the plugin
  16. *
  17. * @since 19.0.0
  18. * @return string AppId
  19. */
  20. public function getAppId(): string;
  21. /**
  22. * Fetches all calendars for a given principal uri
  23. *
  24. * @since 19.0.0
  25. * @param string $principalUri E.g. principals/users/user1
  26. * @return ExternalCalendar[] Array of all calendars
  27. */
  28. public function fetchAllForCalendarHome(string $principalUri): array;
  29. /**
  30. * Checks whether plugin has a calendar for a given principalUri and calendarUri
  31. *
  32. * @since 19.0.0
  33. * @param string $principalUri E.g. principals/users/user1
  34. * @param string $calendarUri E.g. personal
  35. * @return bool True if calendar for principalUri and calendarUri exists, false otherwise
  36. */
  37. public function hasCalendarInCalendarHome(string $principalUri, string $calendarUri): bool;
  38. /**
  39. * Fetches a calendar for a given principalUri and calendarUri
  40. * Returns null if calendar does not exist
  41. *
  42. * @since 19.0.0
  43. * @param string $principalUri E.g. principals/users/user1
  44. * @param string $calendarUri E.g. personal
  45. * @return ExternalCalendar|null Calendar if it exists, null otherwise
  46. */
  47. public function getCalendarInCalendarHome(string $principalUri, string $calendarUri): ?ExternalCalendar;
  48. }