diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-03-11 16:43:00 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-03-16 12:44:11 +0100 |
commit | cae8529359ee4b0733cfbc958ab1405b45f0f2d2 (patch) | |
tree | 55443e59b817f2f3aa8967f2f0f1dcc91c2745a9 /lib/public/ipreview.php | |
parent | 4c4c0fa12066b9dace5d9689836fe4a70141a2d9 (diff) | |
download | nextcloud-server-cae8529359ee4b0733cfbc958ab1405b45f0f2d2.tar.gz nextcloud-server-cae8529359ee4b0733cfbc958ab1405b45f0f2d2.zip |
Register preview providers on the preview manager instead of OC\Preview
Diffstat (limited to 'lib/public/ipreview.php')
-rw-r--r-- | lib/public/ipreview.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/public/ipreview.php b/lib/public/ipreview.php index cc756ef80d3..9ebe2e2d1cf 100644 --- a/lib/public/ipreview.php +++ b/lib/public/ipreview.php @@ -36,8 +36,18 @@ namespace OCP; /** * This class provides functions to render and show thumbnails and previews of files */ -interface IPreview -{ +interface IPreview { + /** + * In order to improve lazy loading a closure can be registered which will be + * called in case preview providers are actually requested + * + * $callable has to return an instance of \OC\Preview\Provider + * + * @param string $mimeTypeRegex Regex with the mime types that are supported by this provider + * @param \Closure $callable + * @return void + */ + public function registerProvider($mimeTypeRegex, \Closure $callable); /** * Return a preview of a file |