isearch.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. */
  29. interface ISearch {
  30. /**
  31. * Search all providers for $query
  32. * @param string $query
  33. * @param string[] $inApps optionally limit results to the given apps
  34. * @return array An array of OCP\Search\Result's
  35. * @deprecated use searchPaged() with page and size
  36. */
  37. public function search($query, array $inApps = array());
  38. /**
  39. * Search all providers for $query
  40. * @param string $query
  41. * @param string[] $inApps optionally limit results to the given apps
  42. * @param int $page pages start at page 1
  43. * @param int $size
  44. * @return array An array of OCP\Search\Result's
  45. */
  46. public function searchPaged($query, array $inApps = array(), $page = 1, $size = 30);
  47. /**
  48. * Register a new search provider to search with
  49. * @param string $class class name of a OCP\Search\Provider
  50. * @param array $options optional
  51. */
  52. public function registerProvider($class, array $options = array());
  53. /**
  54. * Remove one existing search provider
  55. * @param string $provider class name of a OCP\Search\Provider
  56. */
  57. public function removeProvider($provider);
  58. /**
  59. * Remove all registered search providers
  60. */
  61. public function clearProviders();
  62. }