@@ -35,6 +35,7 @@ import { _SoftButtonManager } from './_SoftButtonManager.js';
3535import { _TextAndGraphicManager } from './_TextAndGraphicManager.js' ;
3636import { _VoiceCommandManager } from './_VoiceCommandManager.js' ;
3737import { _SubscribeButtonManager } from './_SubscribeButtonManager' ;
38+ import { _ChoiceSetManagerBase } from './choiceset/_ChoiceSetManagerBase' ;
3839
3940class _ScreenManagerBase extends _SubManagerBase {
4041 /**
@@ -51,6 +52,7 @@ class _ScreenManagerBase extends _SubManagerBase {
5152 if ( this . _fileManager !== null ) {
5253 this . _softButtonManager = new _SoftButtonManager ( lifecycleManager , this . _fileManager ) ;
5354 this . _textAndGraphicManager = new _TextAndGraphicManager ( lifecycleManager , this . _fileManager , this . _softButtonManager ) ;
55+ this . _choiceSetManagerBase = new _ChoiceSetManagerBase ( lifecycleManager , this . _fileManager ) ;
5456 }
5557 this . _voiceCommandManager = new _VoiceCommandManager ( lifecycleManager ) ;
5658 this . _subscribeButtonManager = new _SubscribeButtonManager ( lifecycleManager ) ;
@@ -66,6 +68,7 @@ class _ScreenManagerBase extends _SubManagerBase {
6668 this . _textAndGraphicManager . start ( ) ,
6769 this . _voiceCommandManager . start ( ) ,
6870 this . _subscribeButtonManager . start ( ) ,
71+ this . _choiceSetManagerBase . start ( ) ,
6972 ] ) ;
7073 this . _transitionToState ( _SubManagerBase . READY ) ;
7174 await super . start ( ) ;
@@ -79,6 +82,7 @@ class _ScreenManagerBase extends _SubManagerBase {
7982 this . _textAndGraphicManager . dispose ( ) ;
8083 this . _voiceCommandManager . dispose ( ) ;
8184 this . _subscribeButtonManager . dispose ( ) ;
85+ this . _choiceSetManagerBase . dispose ( ) ;
8286 super . dispose ( ) ;
8387 }
8488
@@ -442,6 +446,78 @@ class _ScreenManagerBase extends _SubManagerBase {
442446 return this . _voiceCommandManager . setVoiceCommands ( voiceCommands ) ;
443447 }
444448
449+ /**
450+ * Deletes choices that were sent previously
451+ * @param {ChoiceCell[] } choices - A list of ChoiceCell objects
452+ * @returns {Promise } - A promise that resolves to a Boolean of whether the operation is a success
453+ */
454+ async deleteChoices ( choices ) {
455+ return this . _choiceSetManagerBase . deleteChoices ( choices ) ;
456+ }
457+
458+ /**
459+ * Preload choices to improve performance while presenting a choice set at a later time
460+ * @param {ChoiceCell[] } choices - a list of ChoiceCell objects that will be part of a choice set later
461+ * @returns {Promise } - A promise.
462+ */
463+ async preloadChoices ( choices ) {
464+ return this . _choiceSetManagerBase . preloadChoices ( choices ) ;
465+ }
466+
467+ /**
468+ * Presents a searchable choice set
469+ * @param {ChoiceSet } choiceSet - The choice set to be presented. This can include Choice Cells that were preloaded or not
470+ * @param {InteractionMode } mode - The intended interaction mode
471+ * @param {KeyboardListener } keyboardListener - A keyboard listener to capture user input
472+ */
473+ presentSearchableChoiceSet ( choiceSet , mode , keyboardListener ) {
474+ this . _choiceSetManagerBase . presentChoiceSet ( choiceSet , mode , keyboardListener ) ;
475+ }
476+
477+ /**
478+ * Presents a choice set
479+ * @param {ChoiceSet } choiceSet - The choice set to be presented. This can include Choice Cells that were preloaded or not
480+ * @param {InteractionMode } mode - The intended interaction mode
481+ */
482+ presentChoiceSet ( choiceSet , mode ) {
483+ this . _choiceSetManagerBase . presentChoiceSet ( choiceSet , mode , null ) ;
484+ }
485+
486+ /**
487+ * Presents a keyboard on the Head unit to capture user input
488+ * @param {String } initialText - The initial text that is used as a placeholder text. It might not work on some head units.
489+ * @param {KeyboardProperties } customKeyboardProperties - the custom keyboard configuration to be used when the keyboard is displayed
490+ * @param {KeyboardListener } keyboardListener - A keyboard listener to capture user input
491+ * @returns {Number|null } - A unique cancel ID that can be used to cancel this keyboard. If `null`, no keyboard was created.
492+ */
493+ presentKeyboard ( initialText , customKeyboardProperties , keyboardListener ) {
494+ return this . _choiceSetManagerBase . presentKeyboard ( initialText , customKeyboardProperties , keyboardListener ) ;
495+ }
496+
497+ /**
498+ * Set a custom keyboard configuration for this session. If set to null, it will reset to default keyboard configuration.
499+ * @param {KeyboardProperties } keyboardConfiguration - the custom keyboard configuration to be used when the keyboard is displayed
500+ */
501+ setKeyboardConfiguration ( keyboardConfiguration ) {
502+ this . _choiceSetManagerBase . setKeyboardConfiguration ( keyboardConfiguration ) ;
503+ }
504+
505+ /**
506+ * Get the preloaded choices
507+ * @returns {ChoiceCell[] } - A set of choice cells that have been preloaded to the head unit
508+ */
509+ getPreloadedChoices ( ) {
510+ return this . _choiceSetManagerBase . getPreloadedChoices ( ) ;
511+ }
512+
513+ /**
514+ * Dismisses a currently presented keyboard with the associated ID. Canceling a keyboard only works when connected to SDL Core v.6.0+. When connected to older versions of SDL Core the keyboard will not be dismissed.
515+ * @param {Number } cancelId - The unique ID assigned to the keyboard
516+ */
517+ dismissKeyboard ( cancelId ) {
518+ this . _choiceSetManagerBase . dismissKeyboard ( cancelId ) ;
519+ }
520+
445521 /**
446522 * Begin a multiple updates transaction. The updates will be applied when commit() is called. Note: if we don't use beginTransaction & commit, every update will be sent individually.
447523 */
0 commit comments