aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-09-07 12:37:09 +0200
committerMarcel Klehr <mklehr@gmx.net>2023-10-18 13:21:50 +0200
commitc8cab9d2fd347975d3d5b4e1d7d9b549e5db6e25 (patch)
treed7d5bac2d10a2af4c4703d95bb74aef1a287a804 /lib/private/AppFramework
parent9bdf98f699e8c484d19fd6210c50765f36bd08ee (diff)
downloadnextcloud-server-c8cab9d2fd347975d3d5b4e1d7d9b549e5db6e25.tar.gz
nextcloud-server-c8cab9d2fd347975d3d5b4e1d7d9b549e5db6e25.zip
Implement TextToImage OCP API
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r--lib/private/AppFramework/Bootstrap/RegistrationContext.php24
1 files changed, 24 insertions, 0 deletions
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<IReferenceProvider>[] */
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);
}
@@ -723,6 +740,13 @@ class RegistrationContext {
}
/**
+ * @return ServiceRegistration<\OCP\TextToImage\IProvider>[]
+ */
+ public function getTextToImageProviders(): array {
+ return $this->textToImageProviders;
+ }
+
+ /**
* @return ServiceRegistration<ICustomTemplateProvider>[]
*/
public function getTemplateProviders(): array {