diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-16 16:48:11 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-11-03 14:00:33 +0100 |
commit | 5466fbf761bfb810a43b11789b03b2ec54c9ab6e (patch) | |
tree | 273bee9e8a91c6559ba5ff4e1c6514d4ef3e5c22 /lib/public/IPreview.php | |
parent | 8468212386fa577a60df238c10243b8297e962fc (diff) | |
download | nextcloud-server-5466fbf761bfb810a43b11789b03b2ec54c9ab6e.tar.gz nextcloud-server-5466fbf761bfb810a43b11789b03b2ec54c9ab6e.zip |
Move Ipreview to more of DI thingy
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/public/IPreview.php')
-rw-r--r-- | lib/public/IPreview.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/public/IPreview.php b/lib/public/IPreview.php index 071b5b8064c..0942db4784c 100644 --- a/lib/public/IPreview.php +++ b/lib/public/IPreview.php @@ -33,11 +33,19 @@ // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP; +use OCP\Files\File; +use OCP\Files\SimpleFS\ISimpleFile; +use OCP\Files\NotFoundException; + /** * This class provides functions to render and show thumbnails and previews of files * @since 6.0.0 */ interface IPreview { + + const MODE_FILL = 'fill'; + const MODE_COVER = 'cover'; + /** * In order to improve lazy loading a closure can be registered which will be * called in case preview providers are actually requested @@ -73,9 +81,26 @@ interface IPreview { * @param boolean $scaleUp Scale smaller images up to the thumbnail size or not. Might look ugly * @return \OCP\IImage * @since 6.0.0 + * @deprecated 9.2.0 Use getPreview */ public function createPreview($file, $maxX = 100, $maxY = 75, $scaleUp = false); + /** + * Returns a preview of a file + * + * The cache is searched first and if nothing usable was found then a preview is + * generated by one of the providers + * + * @param File $file + * @param int $width + * @param int $height + * @param bool $crop + * @param string $mode + * @return ISimpleFile + * @throws NotFoundException + * @since 9.2.0 + */ + public function getPreview(File $file, $width = -1, $height = -1, $crop = false, $mode = IPreview::MODE_FILL); /** * Returns true if the passed mime type is supported |