IProvider.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Joas Schilling <coding@schilljs.com>
  6. * @author Morris Jobke <hey@morrisjobke.de>
  7. * @author Robin Appelman <robin@icewind.nl>
  8. * @author Roeland Jago Douma <roeland@famdouma.nl>
  9. *
  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\Preview;
  26. /**
  27. * Interface IProvider
  28. *
  29. * @since 8.1.0
  30. * @deprecated 17.0.0 use IProviderV2 instead
  31. */
  32. interface IProvider {
  33. /**
  34. * @return string Regex with the mimetypes that are supported by this provider
  35. * @since 8.1.0
  36. */
  37. public function getMimeType();
  38. /**
  39. * Check if a preview can be generated for $path
  40. *
  41. * @param \OCP\Files\FileInfo $file
  42. * @return bool
  43. * @since 8.1.0
  44. */
  45. public function isAvailable(\OCP\Files\FileInfo $file);
  46. /**
  47. * get thumbnail for file at path $path
  48. *
  49. * @param string $path Path of file
  50. * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image
  51. * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image
  52. * @param bool $scalingup Disable/Enable upscaling of previews
  53. * @param \OC\Files\View $fileview fileview object of user folder
  54. * @return bool|\OCP\IImage false if no preview was generated
  55. * @since 8.1.0
  56. */
  57. public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview);
  58. }