1
0

ICalendarQuery.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright 2021 Anna Larch <anna.larch@gmx.net>
  5. *
  6. * @author Anna Larch <anna.larch@gmx.net>
  7. *
  8. * @license GNU AGPL version 3 or any later version
  9. *
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as
  12. * published by the Free Software Foundation, either version 3 of the
  13. * License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. namespace OCP\Calendar;
  25. use DateTimeImmutable;
  26. /**
  27. * Build a flexible, extendable query to the CalDAV backend
  28. *
  29. * @since 23.0.0
  30. */
  31. interface ICalendarQuery {
  32. /**
  33. * @since 24.0.0
  34. */
  35. public const SEARCH_PROPERTY_CATEGORIES = 'CATEGORIES';
  36. /**
  37. * @since 24.0.0
  38. */
  39. public const SEARCH_PROPERTY_COMMENT = 'COMMENT';
  40. /**
  41. * @since 24.0.0
  42. */
  43. public const SEARCH_PROPERTY_DESCRIPTION = 'DESCRIPTION';
  44. /**
  45. * @since 24.0.0
  46. */
  47. public const SEARCH_PROPERTY_LOCATION = 'LOCATION';
  48. /**
  49. * @since 24.0.0
  50. */
  51. public const SEARCH_PROPERTY_RESOURCES = 'RESOURCES';
  52. /**
  53. * @since 24.0.0
  54. */
  55. public const SEARCH_PROPERTY_STATUS = 'STATUS';
  56. /**
  57. * @since 24.0.0
  58. */
  59. public const SEARCH_PROPERTY_SUMMARY = 'SUMMARY';
  60. /**
  61. * @since 24.0.0
  62. */
  63. public const SEARCH_PROPERTY_ATTENDEE = 'ATTENDEE';
  64. /**
  65. * @since 24.0.0
  66. */
  67. public const SEARCH_PROPERTY_CONTACT = 'CONTACT';
  68. /**
  69. * @since 24.0.0
  70. */
  71. public const SEARCH_PROPERTY_ORGANIZER = 'ORGANIZER';
  72. /**
  73. * Limit the results to the calendar uri(s)
  74. *
  75. * @since 23.0.0
  76. */
  77. public function addSearchCalendar(string $calendarUri): void;
  78. /**
  79. * Search the property values
  80. *
  81. * @since 23.0.0
  82. */
  83. public function setSearchPattern(string $pattern): void;
  84. /**
  85. * Define the property name(s) to search for
  86. *
  87. * Note: Nextcloud only indexes *some* properties. You can not search for
  88. * arbitrary properties.
  89. *
  90. * @param string $value any of the ICalendarQuery::SEARCH_PROPERTY_* values
  91. * @psalm-param ICalendarQuery::SEARCH_PROPERTY_* $value
  92. *
  93. * @since 23.0.0
  94. */
  95. public function addSearchProperty(string $value): void;
  96. /**
  97. * @since 23.0.0
  98. */
  99. public function addType(string $value): void;
  100. /**
  101. * @since 23.0.0
  102. */
  103. public function setTimerangeStart(DateTimeImmutable $startTime): void;
  104. /**
  105. * @since 23.0.0
  106. */
  107. public function setTimerangeEnd(DateTimeImmutable $endTime): void;
  108. /**
  109. * @since 23.0.0
  110. */
  111. public function setLimit(int $limit): void;
  112. /**
  113. * @since 23.0.0
  114. */
  115. public function setOffset(int $offset): void;
  116. }