@@ -38,6 +38,7 @@ import { _SubscribeButtonManager } from './_SubscribeButtonManager';
3838import { Enum } from '../../util/Enum' ;
3939import { _AlertManager } from './_AlertManager.js' ;
4040import { _ChoiceSetManagerBase } from './choiceset/_ChoiceSetManagerBase' ;
41+ import { _MenuManagerBase } from './menu/_MenuManagerBase' ;
4142
4243class _ScreenManagerBase extends _SubManagerBase {
4344 /**
@@ -56,6 +57,7 @@ class _ScreenManagerBase extends _SubManagerBase {
5657 this . _textAndGraphicManager = new _TextAndGraphicManager ( lifecycleManager , this . _fileManager , this . _softButtonManager ) ;
5758 this . _alertManager = new _AlertManager ( lifecycleManager , this . _fileManager ) ;
5859 this . _choiceSetManagerBase = new _ChoiceSetManagerBase ( lifecycleManager , this . _fileManager ) ;
60+ this . _menuManagerBase = new _MenuManagerBase ( lifecycleManager , this . _fileManager ) ;
5961 }
6062 this . _voiceCommandManager = new _VoiceCommandManager ( lifecycleManager ) ;
6163 this . _subscribeButtonManager = new _SubscribeButtonManager ( lifecycleManager ) ;
@@ -73,6 +75,7 @@ class _ScreenManagerBase extends _SubManagerBase {
7375 this . _subscribeButtonManager . start ( ) ,
7476 this . _alertManager . start ( ) ,
7577 this . _choiceSetManagerBase . start ( ) ,
78+ this . _menuManagerBase . start ( ) ,
7679 ] ) ;
7780 this . _transitionToState ( _SubManagerBase . READY ) ;
7881 await super . start ( ) ;
@@ -91,6 +94,7 @@ class _ScreenManagerBase extends _SubManagerBase {
9194 _ScreenManagerBase . _softButtonIDBySoftButtonManager = null ;
9295 _ScreenManagerBase . _softButtonIDByAlertManager = null ;
9396 this . _choiceSetManagerBase . dispose ( ) ;
97+ this . _menuManagerBase . dispose ( ) ;
9498 super . dispose ( ) ;
9599 }
96100
@@ -648,6 +652,74 @@ class _ScreenManagerBase extends _SubManagerBase {
648652 }
649653 return true ;
650654 }
655+
656+ /**
657+ * The list of currently set menu cells
658+ * @returns {MenuCell[] } - An array of the currently set menu cells
659+ */
660+ getMenu ( ) {
661+ return this . _menuManagerBase . _getMenuCells ( ) ;
662+ }
663+
664+ /**
665+ * Creates and sends all associated Menu RPCs
666+ * Note: the manager will store a deep copy the menuCells internally to be able to handle future updates correctly
667+ * @param {MenuCell[] } menuCells - The menu cells that are to be sent to the head unit, including their sub-cells.
668+ */
669+ setMenu ( menuCells ) {
670+ this . _menuManagerBase . _setMenuCells ( menuCells ) ;
671+ }
672+
673+ /**
674+ * Sets the behavior of how menus are updated. For explanations of the differences, see {@link DynamicMenuUpdatesMode}
675+ * @param {DynamicMenuUpdatesMode } value - The update mode
676+ */
677+ setDynamicMenuUpdatesMode ( value ) {
678+ this . _menuManagerBase . _setDynamicMenuUpdatesMode ( value ) ;
679+ }
680+
681+ /**
682+ * Gets the dynamic menu update mode
683+ * @returns {DynamicMenuUpdatesMode } - The currently set DynamicMenuUpdatesMode. It defaults to ON_WITH_COMPAT_MODE if not set.
684+ */
685+ getDynamicMenuUpdatesMode ( ) {
686+ return this . _menuManagerBase . _getDynamicMenuUpdatesMode ( ) ;
687+ }
688+
689+ /**
690+ * Requires SDL RPC Version 6.0.0 or greater
691+ * Opens the Main Menu.
692+ * @returns {Boolean } - Whether the request was able to be sent
693+ */
694+ openMenu ( ) {
695+ return this . _menuManagerBase . _openMenu ( ) ;
696+ }
697+
698+ /**
699+ * Requires SDL RPC Version 6.0.0 or greater
700+ * Opens a subMenu. The cell you pass in must be constructed with submenu cells
701+ * @param {MenuCell } cell - A submenu cell whose sub menu you wish to open
702+ * @returns {Boolean } - Whether the request was able to be sent
703+ */
704+ openSubMenu ( cell ) {
705+ return this . _menuManagerBase . _openSubMenu ( cell ) ;
706+ }
707+
708+ /**
709+ * The main menu layout. See available menu layouts on WindowCapability.menuLayoutsAvailable.
710+ * @param {MenuConfiguration } menuConfiguration - The default menuConfiguration
711+ */
712+ setMenuConfiguration ( menuConfiguration ) {
713+ this . _menuManagerBase . _setMenuConfiguration ( menuConfiguration ) ;
714+ }
715+
716+ /**
717+ * The main menu layout. See available menu layouts on WindowCapability.menuLayoutsAvailable.
718+ * @returns {MenuConfiguration } - The currently set MenuConfiguration
719+ */
720+ getMenuConfiguration ( ) {
721+ return this . _menuManagerBase . _getMenuConfiguration ( ) ;
722+ }
651723}
652724
653725class _ManagerLocation extends Enum {
0 commit comments