ipreview.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * ownCloud
  4. *
  5. * @author Frank Karlitschek
  6. * @author Georg Ehrke
  7. * @copyright 2013 Frank Karlitschek frank@owncloud.org
  8. * @copyright 2013 Georg Ehrke georg@owncloud.com
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  12. * License as published by the Free Software Foundation; either
  13. * version 3 of the License, or any later version.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public
  21. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. /**
  25. * Public interface of ownCloud for apps to use.
  26. * Preview interface
  27. *
  28. */
  29. // use OCP namespace for all classes that are considered public.
  30. // This means that they should be used by apps instead of the internal ownCloud classes
  31. namespace OCP;
  32. /**
  33. * This class provides functions to render and show thumbnails and previews of files
  34. */
  35. interface IPreview
  36. {
  37. /**
  38. * Return a preview of a file
  39. * @param string $file The path to the file where you want a thumbnail from
  40. * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image
  41. * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image
  42. * @param boolean $scaleUp Scale smaller images up to the thumbnail size or not. Might look ugly
  43. * @return \OCP\Image
  44. */
  45. function createPreview($file, $maxX = 100, $maxY = 75, $scaleUp = false);
  46. /**
  47. * Returns true if the passed mime type is supported
  48. * @param string $mimeType
  49. * @return boolean
  50. */
  51. function isMimeSupported($mimeType = '*');
  52. }