ISearch.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. * @param int $page pages start at page 1
  37. * @param int $size
  38. * @return array An array of OCP\Search\Result's
  39. * @since 8.0.0
  40. */
  41. public function searchPaged($query, array $inApps = array(), $page = 1, $size = 30);
  42. /**
  43. * Register a new search provider to search with
  44. * @param string $class class name of a OCP\Search\Provider
  45. * @param array $options optional
  46. * @since 7.0.0
  47. */
  48. public function registerProvider($class, array $options = array());
  49. /**
  50. * Remove one existing search provider
  51. * @param string $provider class name of a OCP\Search\Provider
  52. * @since 7.0.0
  53. */
  54. public function removeProvider($provider);
  55. /**
  56. * Remove all registered search providers
  57. * @since 7.0.0
  58. */
  59. public function clearProviders();
  60. }