aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-10-04 14:41:08 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2021-10-21 10:35:18 +0200
commit8bc25e33243a914a44e86ef4ba060ab6a8bd3237 (patch)
tree299537ccec1a02f20e7de6119a0d2325865ab79f /lib/public
parent732a05716719dfcb866ba14863500cfb357fe543 (diff)
downloadnextcloud-server-8bc25e33243a914a44e86ef4ba060ab6a8bd3237.tar.gz
nextcloud-server-8bc25e33243a914a44e86ef4ba060ab6a8bd3237.zip
Move preview provider registration to bootstrap
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/AppFramework/Bootstrap/IRegistrationContext.php13
-rw-r--r--lib/public/IPreview.php3
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
index f75cdb18cfb..de391050ec1 100644
--- a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
+++ b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
@@ -36,6 +36,7 @@ use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Template\ICustomTemplateProvider;
use OCP\IContainer;
use OCP\Notification\INotifier;
+use OCP\Preview\IProviderV2;
/**
* The context object passed to IBootstrap::register
@@ -232,6 +233,18 @@ interface IRegistrationContext {
public function registerTwoFactorProvider(string $twoFactorProviderClass): void;
/**
+ * Register a preview provider
+ *
+ * It is allowed to register more than one provider per app.
+ *
+ * @param string $previewProviderClass
+ * @param string $mimeTypeRegex
+ * @psalm-param class-string<IProviderV2> $previewProviderClass
+ * @since 23.0.0
+ */
+ public function registerPreviewProvider(string $previewProviderClass, string $mimeTypeRegex): void;
+
+ /**
* Register a calendar provider
*
* @param string $class
diff --git a/lib/public/IPreview.php b/lib/public/IPreview.php
index c4e3c557012..a8a798a526c 100644
--- a/lib/public/IPreview.php
+++ b/lib/public/IPreview.php
@@ -58,6 +58,9 @@ interface IPreview {
* @param \Closure $callable
* @return void
* @since 8.1.0
+ * @see \OCP\AppFramework\Bootstrap\IRegistrationContext::registerPreviewProvider
+ *
+ * @deprecated 23.0.0 Register your provider via the IRegistrationContext when booting the app
*/
public function registerProvider($mimeTypeRegex, \Closure $callable);