1
0

ICalendarQuery.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Calendar;
  8. use DateTimeImmutable;
  9. /**
  10. * Build a flexible, extendable query to the CalDAV backend
  11. *
  12. * @since 23.0.0
  13. */
  14. interface ICalendarQuery {
  15. /**
  16. * @since 24.0.0
  17. */
  18. public const SEARCH_PROPERTY_CATEGORIES = 'CATEGORIES';
  19. /**
  20. * @since 24.0.0
  21. */
  22. public const SEARCH_PROPERTY_COMMENT = 'COMMENT';
  23. /**
  24. * @since 24.0.0
  25. */
  26. public const SEARCH_PROPERTY_DESCRIPTION = 'DESCRIPTION';
  27. /**
  28. * @since 24.0.0
  29. */
  30. public const SEARCH_PROPERTY_LOCATION = 'LOCATION';
  31. /**
  32. * @since 24.0.0
  33. */
  34. public const SEARCH_PROPERTY_RESOURCES = 'RESOURCES';
  35. /**
  36. * @since 24.0.0
  37. */
  38. public const SEARCH_PROPERTY_STATUS = 'STATUS';
  39. /**
  40. * @since 24.0.0
  41. */
  42. public const SEARCH_PROPERTY_SUMMARY = 'SUMMARY';
  43. /**
  44. * @since 24.0.0
  45. */
  46. public const SEARCH_PROPERTY_ATTENDEE = 'ATTENDEE';
  47. /**
  48. * @since 24.0.0
  49. */
  50. public const SEARCH_PROPERTY_CONTACT = 'CONTACT';
  51. /**
  52. * @since 24.0.0
  53. */
  54. public const SEARCH_PROPERTY_ORGANIZER = 'ORGANIZER';
  55. /**
  56. * Limit the results to the calendar uri(s)
  57. *
  58. * @since 23.0.0
  59. */
  60. public function addSearchCalendar(string $calendarUri): void;
  61. /**
  62. * Search the property values
  63. *
  64. * @since 23.0.0
  65. */
  66. public function setSearchPattern(string $pattern): void;
  67. /**
  68. * Define the property name(s) to search for
  69. *
  70. * Note: Nextcloud only indexes *some* properties. You can not search for
  71. * arbitrary properties.
  72. *
  73. * @param string $value any of the ICalendarQuery::SEARCH_PROPERTY_* values
  74. * @psalm-param ICalendarQuery::SEARCH_PROPERTY_* $value
  75. *
  76. * @since 23.0.0
  77. */
  78. public function addSearchProperty(string $value): void;
  79. /**
  80. * @since 23.0.0
  81. */
  82. public function addType(string $value): void;
  83. /**
  84. * @since 23.0.0
  85. */
  86. public function setTimerangeStart(DateTimeImmutable $startTime): void;
  87. /**
  88. * @since 23.0.0
  89. */
  90. public function setTimerangeEnd(DateTimeImmutable $endTime): void;
  91. /**
  92. * @since 23.0.0
  93. */
  94. public function setLimit(int $limit): void;
  95. /**
  96. * @since 23.0.0
  97. */
  98. public function setOffset(int $offset): void;
  99. }