From c8cab9d2fd347975d3d5b4e1d7d9b549e5db6e25 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 7 Sep 2023 12:37:09 +0200 Subject: Implement TextToImage OCP API Signed-off-by: Marcel Klehr --- .../AppFramework/Bootstrap/RegistrationContext.php | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lib/private/AppFramework/Bootstrap') diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php index b3ef3ee65fb..462b7bb237f 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -137,6 +137,12 @@ class RegistrationContext { /** @var ServiceRegistration[] */ private array $referenceProviders = []; + /** @var ServiceRegistration<\OCP\TextToImage\IProvider>[] */ + private $textToImageProviders = []; + + + + /** @var ParameterRegistration[] */ private $sensitiveMethods = []; @@ -270,6 +276,13 @@ class RegistrationContext { ); } + public function registerTextToImageProvider(string $providerClass): void { + $this->context->registerTextToImageProvider( + $this->appId, + $providerClass + ); + } + public function registerTemplateProvider(string $providerClass): void { $this->context->registerTemplateProvider( $this->appId, @@ -440,6 +453,10 @@ class RegistrationContext { $this->textProcessingProviders[] = new ServiceRegistration($appId, $class); } + public function registerTextToImageProvider(string $appId, string $class): void { + $this->textToImageProviders[] = new ServiceRegistration($appId, $class); + } + public function registerTemplateProvider(string $appId, string $class): void { $this->templateProviders[] = new ServiceRegistration($appId, $class); } @@ -722,6 +739,13 @@ class RegistrationContext { return $this->textProcessingProviders; } + /** + * @return ServiceRegistration<\OCP\TextToImage\IProvider>[] + */ + public function getTextToImageProviders(): array { + return $this->textToImageProviders; + } + /** * @return ServiceRegistration[] */ -- cgit v1.2.3