isearch.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * ownCloud - App Framework
  4. *
  5. * @author Jörn Dreyer
  6. * @copyright 2014 Jörn Dreyer jfd@owncloud.com
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public
  19. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. namespace OCP;
  23. /**
  24. * Small Interface for Search
  25. */
  26. interface ISearch {
  27. /**
  28. * Search all providers for $query
  29. * @param string $query
  30. * @param string[] $inApps optionally limit results to the given apps
  31. * @return array An array of OCP\Search\Result's
  32. * @deprecated use searchPaged() with page and size
  33. */
  34. public function search($query, array $inApps = array());
  35. /**
  36. * Search all providers for $query
  37. * @param string $query
  38. * @param string[] $inApps optionally limit results to the given apps
  39. * @param int $page pages start at page 1
  40. * @param int $size
  41. * @return array An array of OCP\Search\Result's
  42. */
  43. public function searchPaged($query, array $inApps = array(), $page = 1, $size = 30);
  44. /**
  45. * Register a new search provider to search with
  46. * @param string $class class name of a OCP\Search\Provider
  47. * @param array $options optional
  48. */
  49. public function registerProvider($class, array $options = array());
  50. /**
  51. * Remove one existing search provider
  52. * @param string $provider class name of a OCP\Search\Provider
  53. */
  54. public function removeProvider($provider);
  55. /**
  56. * Remove all registered search providers
  57. */
  58. public function clearProviders();
  59. }