aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-04-11 14:59:57 +0200
committerMarcel Klehr <mklehr@gmx.net>2023-04-11 14:59:57 +0200
commit317521b607e3a14364f5d486630cf1e5181053e4 (patch)
tree17fa3479a7169e92739232fb7c594c7f9e3cce56 /lib/private/AppFramework
parentc6645cbc46291d2621992b7f0bb087f115e849eb (diff)
downloadnextcloud-server-317521b607e3a14364f5d486630cf1e5181053e4.tar.gz
nextcloud-server-317521b607e3a14364f5d486630cf1e5181053e4.zip
feat(SpeechToText): Add SpeechToText provider API
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r--lib/private/AppFramework/Bootstrap/RegistrationContext.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
index 9a6c298419a..8fcafab2d87 100644
--- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php
+++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
@@ -33,6 +33,7 @@ use Closure;
use OCP\Calendar\Resource\IBackend as IResourceBackend;
use OCP\Calendar\Room\IBackend as IRoomBackend;
use OCP\Collaboration\Reference\IReferenceProvider;
+use OCP\SpeechToText\ISpeechToTextProvider;
use OCP\Talk\ITalkBackend;
use OCP\Translation\ITranslationProvider;
use RuntimeException;
@@ -111,6 +112,9 @@ class RegistrationContext {
/** @var ServiceRegistration<IHandler>[] */
private $wellKnownHandlers = [];
+ /** @var ServiceRegistration<ISpeechToTextProvider>[] */
+ private $speechToTextProviders = [];
+
/** @var ServiceRegistration<ICustomTemplateProvider>[] */
private $templateProviders = [];
@@ -252,6 +256,13 @@ class RegistrationContext {
);
}
+ public function registerSpeechToTextProvider(string $providerClass): void {
+ $this->context->registerSpeechToTextProvider(
+ $this->appId,
+ $providerClass
+ );
+ }
+
public function registerTemplateProvider(string $providerClass): void {
$this->context->registerTemplateProvider(
$this->appId,
@@ -414,6 +425,10 @@ class RegistrationContext {
$this->wellKnownHandlers[] = new ServiceRegistration($appId, $class);
}
+ public function registerSpeechToTextProvider(string $appId, string $class): void {
+ $this->speechToTextProviders[] = new ServiceRegistration($appId, $class);
+ }
+
public function registerTemplateProvider(string $appId, string $class): void {
$this->templateProviders[] = new ServiceRegistration($appId, $class);
}
@@ -686,6 +701,13 @@ class RegistrationContext {
}
/**
+ * @return ServiceRegistration<ISpeechToTextProvider>[]
+ */
+ public function getSpeechToTextProviders(): array {
+ return $this->speechToTextProviders;
+ }
+
+ /**
* @return ServiceRegistration<ICustomTemplateProvider>[]
*/
public function getTemplateProviders(): array {