isearch.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Andrew Brown <andrew@casabrown.com>
  6. * @author Bart Visscher <bartv@thisnet.nl>
  7. * @author Jakob Sack <mail@jakobsack.de>
  8. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  9. * @author Morris Jobke <hey@morrisjobke.de>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OCP;
  27. /**
  28. * Small Interface for Search
  29. * @since 7.0.0
  30. */
  31. interface ISearch {
  32. /**
  33. * Search all providers for $query
  34. * @param string $query
  35. * @param string[] $inApps optionally limit results to the given apps
  36. * @return array An array of OCP\Search\Result's
  37. * @deprecated 8.0.0 use searchPaged() with page and size
  38. * @since 7.0.0 - parameter $inApps was added in 8.0.0
  39. */
  40. public function search($query, array $inApps = array());
  41. /**
  42. * Search all providers for $query
  43. * @param string $query
  44. * @param string[] $inApps optionally limit results to the given apps
  45. * @param int $page pages start at page 1
  46. * @param int $size
  47. * @return array An array of OCP\Search\Result's
  48. * @since 8.0.0
  49. */
  50. public function searchPaged($query, array $inApps = array(), $page = 1, $size = 30);
  51. /**
  52. * Register a new search provider to search with
  53. * @param string $class class name of a OCP\Search\Provider
  54. * @param array $options optional
  55. * @since 7.0.0
  56. */
  57. public function registerProvider($class, array $options = array());
  58. /**
  59. * Remove one existing search provider
  60. * @param string $provider class name of a OCP\Search\Provider
  61. * @since 7.0.0
  62. */
  63. public function removeProvider($provider);
  64. /**
  65. * Remove all registered search providers
  66. * @since 7.0.0
  67. */
  68. public function clearProviders();
  69. }