isearch.php 2.2 KB

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