com.smartdevicelink.proxy.rpc.SetGlobalProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdl_java_se Show documentation
Show all versions of sdl_java_se Show documentation
The app library component of SDL is meant to run on the end userâs smart-device from within SDL enabled apps, as an embedded app, or connected to the cloud. App libraries allow the apps to connect to SDL enabled head-units and hardware through bluetooth, USB, and TCP for Android, and cloud and embedded apps can connect through web sockets, Java Beans, and other custom transports. Once the library establishes a connection between the smart device and head-unit through the preferred method of transport, the two components are able to communicate using the SDL defined protocol. The app integrating this library project is then able to expose its functionality to the head-unit through text, media, and other interactive elements.
/*
* Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package com.smartdevicelink.proxy.rpc;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
import com.smartdevicelink.proxy.rpc.enums.MenuLayout;
import java.util.Hashtable;
import java.util.List;
/**
* Sets value(s) for the specified global property(ies)
*
* Function Group: Base
* HMILevel needs to be FULL, LIMITED or BACKGROUND
*
* AudioStreamingState:
* Any
*
* SystemContext:
* Any
*
*
* Parameter List
*
*
*
* Param Name
* Type
* Description
* Req.
* Notes
* Version Available
*
*
* helpPrompt
* TTSChunk
* The help prompt. An array of text chunks of type TTSChunk. See {@linkplain TTSChunk}.The array must have at least one item.
* N
* Array must have at least one element.Only optional it timeoutPrompt has been specified.
minsize:1; maxsize: 100
* SmartDeviceLink 1.0
*
*
* timeoutPrompt
* TTSChunk
* Array of one or more TTSChunk elements specifying the help prompt used in an interaction started by PTT.
* N
* Array must have at least one element. Only optional it helpPrompt has been specified minsize: 1; maxsize: 100
* SmartDeviceLink 1.0
*
*
* vrHelpTitle
* string
* Text, which is shown as title of the VR help screen used in an interaction started by PTT.
* N
* If omitted on supported displays, the default SDL help title will be used. If omitted and one or more vrHelp items are provided, the request will be rejected.
maxLength: 500
* SmartDeviceLink 1.0
*
*
* vrHelp
* VrHelp
* Items listed in the VR help screen used in an interaction started by PTT.
* N
* If omitted on supported displays, the default SDL VR help / What Can I Say? screen will be usedIf the list of VR Help Items contains non-sequential positions (e.g. [1,2,4]), the RPC will be rejected.
If omitted and a vrHelpTitle is provided, the request will be rejected.
minsize:1; maxsize: 100
* SmartDeviceLink 1.0
*
*
* menuTitle
*
* Optional text to label an app menu button (for certain touchscreen platforms).
* N
* maxlength: 500
* SmartDeviceLink 1.0
*
*
* menuIcon
* Image
* Optional icon to draw on an app menu button (for certain touchscreen platforms).
* N
*
* SmartDeviceLink 1.0
*
*
* keyboardProperties
* KeyboardProperties
* On-screen keyboard configuration (if available).
* N
*
* SmartDeviceLink 1.0
*
*
* menuLayout
* MenuLayout
* Sets the layout of the main menu screen. If this is sent while a menu is already on-screen, the head unit will change the display to the new layout type.
*
*
* SmartDeviceLink 6.0
*
*
*
*
* Note: Your application shall send a SetGlobalProperties to establish an advanced help prompt before sending any voice commands.
*
* Response
* Indicates whether the requested Global Properties were successfully set.
* Non-default Result Codes:
* SUCCESS
* INVALID_DATA
* OUT_OF_MEMORY
* TOO_MANY_PENDING_REQUESTS
* APPLICATION_NOT_REGISTERED
* GENERIC_ERROR
* REJECTED
* DISALLOWED
*
* @see ResetGlobalProperties
* @since SmartDeviceLink 1.0
*/
public class SetGlobalProperties extends RPCRequest {
public static final String KEY_VR_HELP_TITLE = "vrHelpTitle";
public static final String KEY_MENU_TITLE = "menuTitle";
public static final String KEY_MENU_ICON = "menuIcon";
public static final String KEY_KEYBOARD_PROPERTIES = "keyboardProperties";
public static final String KEY_HELP_PROMPT = "helpPrompt";
public static final String KEY_TIMEOUT_PROMPT = "timeoutPrompt";
public static final String KEY_VR_HELP = "vrHelp";
public static final String KEY_USER_LOCATION = "userLocation";
public static final String KEY_MENU_LAYOUT = "menuLayout";
/**
* Constructs a new SetGlobalProperties object
*/
public SetGlobalProperties() {
super(FunctionID.SET_GLOBAL_PROPERTIES.toString());
}
/**
* Constructs a new SetGlobalProperties object indicated by the Hashtable
* parameter
*
*
* @param hash The Hashtable to use
*/
public SetGlobalProperties(Hashtable hash) {
super(hash);
}
/**
* Gets a List for Help Prompt representing Array of one or more
* TTSChunk elements specifying the help prompt used in an interaction
* started by PTT
*
* @return List -an Array of one or more TTSChunk elements
* specifying the help prompt used in an interaction started by PTT
*/
@SuppressWarnings("unchecked")
public List getHelpPrompt() {
return (List) getObject(TTSChunk.class, KEY_HELP_PROMPT);
}
/**
* Sets a List for Help Prompt that Array of one or more
* TTSChunk elements specifying the help prompt used in an interaction
* started by PTT
*
* @param helpPrompt a List of one or more TTSChunk elements
*
* Notes:
*
* - Array must have at least one element
* - Only optional it timeoutPrompt has been specified
*
*/
public SetGlobalProperties setHelpPrompt(List helpPrompt) {
setParameters(KEY_HELP_PROMPT, helpPrompt);
return this;
}
/**
* Gets a List for Timeout Prompt representing Array of one or
* more TTSChunk elements specifying the help prompt used in an interaction
* started by PTT
*
* @return List -an Array of one or more TTSChunk elements
* specifying the help prompt used in an interaction started by PTT
*/
@SuppressWarnings("unchecked")
public List getTimeoutPrompt() {
return (List) getObject(TTSChunk.class, KEY_TIMEOUT_PROMPT);
}
/**
* Sets a List for Timeout Prompt representing Array of one or
* more TTSChunk elements specifying the help prompt used in an interaction
* started by PTT
*/
public SetGlobalProperties setTimeoutPrompt(List timeoutPrompt) {
setParameters(KEY_TIMEOUT_PROMPT, timeoutPrompt);
return this;
}
/**
* Gets a voice recognition Help Title
*
* @return String - a String value representing the text, which is shown as
* title of the VR help screen used in an interaction started by PTT
* @since SmartDeviceLink 2.0
*/
public String getVrHelpTitle() {
return getString(KEY_VR_HELP_TITLE);
}
/**
* Sets a voice recognition Help Title
*
* @param vrHelpTitle a String value representing a voice recognition Help Title
*
* Notes:
*
* - If omitted on supported displays, the default SDL help
* title will be used
* - If omitted and one or more vrHelp items are provided, the
* request will be rejected.
* - String Maxlength = 500
*
* @since SmartDeviceLink 2.0
*/
public SetGlobalProperties setVrHelpTitle(String vrHelpTitle) {
setParameters(KEY_VR_HELP_TITLE, vrHelpTitle);
return this;
}
/**
* Gets items listed in the VR help screen used in an interaction started by
* PTT
*
* @return List - a List value representing items listed in
* the VR help screen used in an interaction started by PTT
* @since SmartDeviceLink 2.0
*/
@SuppressWarnings("unchecked")
public List getVrHelp() {
return (List) getObject(VrHelpItem.class, KEY_VR_HELP);
}
/**
* Sets the items listed in the VR help screen used in an interaction
* started by PTT
*
* @param vrHelp a List value representing items listed in the VR help screen
* used in an interaction started by PTT
*
* Notes:
*
* - If omitted on supported displays, the default SmartDeviceLink VR
* help / What Can I Say? screen will be used
* - If the list of VR Help Items contains non-sequential
* positions (e.g. [1,2,4]), the RPC will be rejected
* - If omitted and a vrHelpTitle is provided, the request
* will be rejected
* - Array Minsize: = 1
* - Array Maxsize = 100
*
* @since SmartDeviceLink 2.0
*/
public SetGlobalProperties setVrHelp(List vrHelp) {
setParameters(KEY_VR_HELP, vrHelp);
return this;
}
public String getMenuTitle() {
return getString(KEY_MENU_TITLE);
}
public SetGlobalProperties setMenuTitle(String menuTitle) {
setParameters(KEY_MENU_TITLE, menuTitle);
return this;
}
public SetGlobalProperties setMenuIcon(Image menuIcon) {
setParameters(KEY_MENU_ICON, menuIcon);
return this;
}
public Image getMenuIcon() {
return (Image) getObject(Image.class, KEY_MENU_ICON);
}
public SetGlobalProperties setKeyboardProperties(KeyboardProperties keyboardProperties) {
setParameters(KEY_KEYBOARD_PROPERTIES, keyboardProperties);
return this;
}
/**
* Sets the user seat location
*
* @param location the location to be set
*/
public SetGlobalProperties setUserLocation(SeatLocation location) {
setParameters(KEY_USER_LOCATION, location);
return this;
}
/**
* Gets the user seat location
*
* @return the user seat location
*/
public SeatLocation getUserLocation() {
return (SeatLocation) getObject(SeatLocation.class, KEY_USER_LOCATION);
}
public KeyboardProperties getKeyboardProperties() {
return (KeyboardProperties) getObject(KeyboardProperties.class, KEY_KEYBOARD_PROPERTIES);
}
/**
* Sets the layout of the main menu screen. If this is sent while a menu is already on-screen,
* the head unit will change the display to the new layout type.
*
* @param menuLayout - the menuLayout
*/
public SetGlobalProperties setMenuLayout(MenuLayout menuLayout) {
setParameters(KEY_MENU_LAYOUT, menuLayout);
return this;
}
/**
* Sets the layout of the main menu screen. If this is sent while a menu is already on-screen,
* the head unit will change the display to the new layout type.
*
* @return the MenuLayout
*/
public MenuLayout getMenuLayout() {
return (MenuLayout) getObject(MenuLayout.class, KEY_MENU_LAYOUT);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy