From 317521b607e3a14364f5d486630cf1e5181053e4 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 11 Apr 2023 14:59:57 +0200 Subject: feat(SpeechToText): Add SpeechToText provider API Signed-off-by: Marcel Klehr --- .../AppFramework/Bootstrap/RegistrationContext.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/private/AppFramework') 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[] */ private $wellKnownHandlers = []; + /** @var ServiceRegistration[] */ + private $speechToTextProviders = []; + /** @var ServiceRegistration[] */ 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); } @@ -685,6 +700,13 @@ class RegistrationContext { return $this->wellKnownHandlers; } + /** + * @return ServiceRegistration[] + */ + public function getSpeechToTextProviders(): array { + return $this->speechToTextProviders; + } + /** * @return ServiceRegistration[] */ -- cgit v1.2.3