diff options
5 files changed, 129 insertions, 0 deletions
diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json index a3e8155f44..f2a8093665 100755 --- a/src/appMain/hmi_capabilities.json +++ b/src/appMain/hmi_capabilities.json @@ -147,6 +147,30 @@ "rows": 1 }, { + "name": "menuCommandSecondaryText", + "characterSet": "UTF_8", + "width": 500, + "rows": 1 + }, + { + "name": "menuCommandTertiaryText", + "characterSet": "UTF_8", + "width": 500, + "rows": 1 + }, + { + "name": "menuSubMenuSecondaryText", + "characterSet": "UTF_8", + "width": 500, + "rows": 1 + }, + { + "name": "menuSubMenuTertiaryText", + "characterSet": "UTF_8", + "width": 500, + "rows": 1 + }, + { "name": "timeToDestination", "characterSet": "UTF_8", "width": 500, @@ -201,6 +225,20 @@ } }, { + "name": "menuCommandSecondaryImage", + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "menuSubMenuSecondaryImage", + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { "name": "appIcon", "imageResolution": { "resolutionWidth": 35, diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc index 7460197904..03b0ee20fc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc @@ -107,6 +107,20 @@ void AddCommandRequest::Run() { } } + if ((*message_)[strings::msg_params].keyExists(strings::secondary_image)) { + mobile_apis::Result::eType verification_result = MessageHelper::VerifyImage( + (*message_)[strings::msg_params][strings::secondary_image], + app, + application_manager_); + + if (mobile_apis::Result::INVALID_DATA == verification_result) { + SDL_LOG_ERROR("MessageHelper::VerifyImage return " + << verification_result); + SendResponse(false, verification_result); + return; + } + } + if (!((*message_)[strings::msg_params].keyExists(strings::cmd_id))) { SDL_LOG_ERROR("INVALID_DATA"); SendResponse(false, mobile_apis::Result::INVALID_DATA); @@ -187,6 +201,17 @@ void AddCommandRequest::Run() { (*message_)[strings::msg_params][strings::cmd_icon]; } + if (((*message_)[strings::msg_params].keyExists( + strings::secondary_image)) && + ((*message_)[strings::msg_params][strings::secondary_image].keyExists( + strings::value)) && + (0 < (*message_)[strings::msg_params][strings::secondary_image] + [strings::value] + .length())) { + ui_msg_params[strings::secondary_image] = + (*message_)[strings::msg_params][strings::secondary_image]; + } + send_ui_ = true; } @@ -520,6 +545,16 @@ bool AddCommandRequest::IsWhiteSpaceExist() { return true; } } + + if ((*message_)[strings::msg_params].keyExists(strings::secondary_image)) { + str = (*message_)[strings::msg_params][strings::secondary_image] + [strings::value] + .asCharArray(); + if (!CheckSyntax(str)) { + SDL_LOG_ERROR("Invalid secondaryImage value syntax check failed"); + return true; + } + } return false; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc index efc1a6ee18..309f07e443 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc @@ -86,6 +86,20 @@ void AddSubMenuRequest::Run() { } } + if (received_msg_params.keyExists(strings::secondary_image)) { + verification_result = MessageHelper::VerifyImage( + received_msg_params[strings::secondary_image], + app, + application_manager_); + + if (mobile_apis::Result::INVALID_DATA == verification_result) { + SDL_LOG_ERROR("MessageHelper::VerifyImage return " + << verification_result); + SendResponse(false, verification_result); + return; + } + } + const int32_t menu_id = received_msg_params[strings::menu_id].asInt(); const auto sub_menu = app->FindSubMenu(menu_id); @@ -142,11 +156,23 @@ void AddSubMenuRequest::Run() { if (received_msg_params.keyExists(strings::menu_icon)) { msg_params[strings::menu_icon] = received_msg_params[strings::menu_icon]; } + if (received_msg_params.keyExists(strings::secondary_image)) { + msg_params[strings::secondary_image] = + received_msg_params[strings::secondary_image]; + } msg_params[strings::menu_params][strings::menu_name] = received_msg_params[strings::menu_name]; if (received_msg_params.keyExists(strings::parent_id)) { msg_params[strings::menu_params][strings::parent_id] = parent_id; } + if (received_msg_params.keyExists(strings::secondary_text)) { + msg_params[strings::menu_params][strings::secondary_text] = + received_msg_params[strings::secondary_text]; + } + if (received_msg_params.keyExists(strings::tertiary_text)) { + msg_params[strings::menu_params][strings::tertiary_text] = + received_msg_params[strings::tertiary_text]; + } msg_params[strings::app_id] = app->app_id(); diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 6256cd747b..1f531a786a 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -649,6 +649,18 @@ <element name="subtleAlertSoftButtonText"> <description>A text field in the soft button of a subtle alert; applies to `SubtleAlert` `softButtons`</description> </element> + <element name="menuCommandSecondaryText"> + <description>Secondary text for AddCommand</description> + </element> + <element name="menuCommandTertiaryText"> + <description>Tertiary text for AddCommand</description> + </element> + <element name="menuSubMenuSecondaryText"> + <description>Secondary text for AddSubMenu</description> + </element> + <element name="menuSubMenuTertiaryText"> + <description>Tertiary text for AddSubMenu</description> + </element> </enum> <enum name="MetadataType"> @@ -739,6 +751,12 @@ <element name="subtleAlertIcon"> <description>The image of the subtle alert; applies to `SubtleAlert` `alertIcon`</description> </element> + <element name="menuCommandSecondaryImage"> + <description>The secondary image field for AddCommand</description> + </element> + <element name="menuSubMenuSecondaryImage"> + <description>The secondary image field for AddSubMenu</description> + </element> </enum> <enum name="TextAlignment"> @@ -2946,6 +2964,12 @@ <param name="menuName" type="String" maxlength="500" mandatory="true"> <description>The name of the sub menu/command.</description> </param> + <param name="secondaryText" maxlength="500" type="String" mandatory="false"> + <description>Optional secondary text to display</description> + </param> + <param name="tertiaryText" maxlength="500" type="String" mandatory="false"> + <description>Optional tertiary text to display</description> + </param> </struct> <enum name="MenuLayout"> @@ -5495,6 +5519,9 @@ <description>Image to be displayed for representing the command. See Image.</description> <description>If omitted, no (or the default if applicable) icon should be displayed.</description> </param> + <param name="secondaryImage" type="Common.Image" mandatory="false"> + <description>Optional secondary image struct for menu cell</description> + </param> <param name="appID" type="Integer" mandatory="true"> <description>ID of application that concerns this RPC.</description> </param> @@ -5527,6 +5554,9 @@ <param name="menuIcon" type="Common.Image" mandatory="false"> <description>The image field for AddSubMenu</description> </param> + <param name="secondaryImage" type="Common.Image" mandatory="false"> + <description>Optional secondary image struct for menu cell</description> + </param> <param name="appID" type="Integer" mandatory="true"> <description>ID of application that requested this RPC.</description> </param> diff --git a/tools/rpc_spec b/tools/rpc_spec -Subproject d1401e31ae3cb183a5a344064046ffa55334620 +Subproject 02f592fe191cd4886d6e88b71b834d1ac2f49f0 |