diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-04-19 16:29:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-19 16:29:44 +0200 |
commit | fd473f89e8ec31b0d050cc293f698390b2e7e689 (patch) | |
tree | 0f0bd277f7a29d50ca0c83618eceba728a6a9e96 /lib/private/AppFramework | |
parent | f5c4f5557660081a7f4477e1b7dcbe328e49afa2 (diff) | |
parent | ab7b63db84dd2c152ee2b6eb26799bde1a5f5b94 (diff) | |
download | nextcloud-server-fd473f89e8ec31b0d050cc293f698390b2e7e689.tar.gz nextcloud-server-fd473f89e8ec31b0d050cc293f698390b2e7e689.zip |
Merge pull request #37674 from nextcloud/feature/speech-to-text
feat(SpeechToText): Add SpeechToText OCP provider API
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r-- | lib/private/AppFramework/Bootstrap/RegistrationContext.php | 22 |
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 { |