All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.smartdevicelink.proxy.rpc.SubtleAlert Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 5.7.0
Show newest version
/*
 * Copyright (c) 2020 Livio, 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 Livio 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 java.util.Hashtable;
import java.util.List;

/**
 * Shows an alert which typically consists of text-to-speech message and text on the display.
 * At least either alertText1, alertText2 or ttsChunks need to be provided.
 *
 * 

Parameter List

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Param NameTypeDescriptionRequiredNotesVersion Available
alertText1StringThe first line of the alert text fieldNMax Value: 500
alertText2StringThe second line of the alert text fieldNMax Value: 500
alertIconImageImage to be displayed for the corresponding alert. See Image. If omitted on supported displays, no (or the default if applicable) icon should be displayed.N
ttsChunksListAn array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.NMin Value: 1; Max Value: 100
durationIntegerTimeout in milliseconds. Typical timeouts are 3-5 seconds. If omitted, timeout is set to5s.NMin Value: 3000; Max Value: 10000; Default Value: 5000
softButtonsListApp defined SoftButtons. If omitted on supported displays, the displayed alert shall not have any SoftButtons.NMin Value: 0; Max Value: 2
cancelIDIntegerAn ID for this specific alert to allow cancellation through the `CancelInteraction` RPC.N
* * @since SmartDeviceLink 7.0.0 */ public class SubtleAlert extends RPCRequest { public static final String KEY_ALERT_TEXT_1 = "alertText1"; public static final String KEY_ALERT_TEXT_2 = "alertText2"; public static final String KEY_ALERT_ICON = "alertIcon"; public static final String KEY_TTS_CHUNKS = "ttsChunks"; public static final String KEY_DURATION = "duration"; public static final String KEY_SOFT_BUTTONS = "softButtons"; public static final String KEY_CANCEL_ID = "cancelID"; /** * Constructs a new SubtleAlert object */ public SubtleAlert() { super(FunctionID.SUBTLE_ALERT.toString()); } /** * Constructs a new SubtleAlert object indicated by the Hashtable parameter * * @param hash The Hashtable to use */ public SubtleAlert(Hashtable hash) { super(hash); } /** * Sets the alertText1. * * @param alertText1 The first line of the alert text field */ public SubtleAlert setAlertText1(String alertText1) { setParameters(KEY_ALERT_TEXT_1, alertText1); return this; } /** * Gets the alertText1. * * @return String The first line of the alert text field */ public String getAlertText1() { return getString(KEY_ALERT_TEXT_1); } /** * Sets the alertText2. * * @param alertText2 The second line of the alert text field */ public SubtleAlert setAlertText2(String alertText2) { setParameters(KEY_ALERT_TEXT_2, alertText2); return this; } /** * Gets the alertText2. * * @return String The second line of the alert text field */ public String getAlertText2() { return getString(KEY_ALERT_TEXT_2); } /** * Sets the alertIcon. * * @param alertIcon Image to be displayed for the corresponding alert. See Image. If omitted on supported * displays, no (or the default if applicable) icon should be displayed. */ public SubtleAlert setAlertIcon(Image alertIcon) { setParameters(KEY_ALERT_ICON, alertIcon); return this; } /** * Gets the alertIcon. * * @return Image Image to be displayed for the corresponding alert. See Image. If omitted on supported * displays, no (or the default if applicable) icon should be displayed. */ public Image getAlertIcon() { return (Image) getObject(Image.class, KEY_ALERT_ICON); } /** * Sets the ttsChunks. * * @param ttsChunks An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one * item. */ public SubtleAlert setTtsChunks(List ttsChunks) { setParameters(KEY_TTS_CHUNKS, ttsChunks); return this; } /** * Gets the ttsChunks. * * @return List An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one * item. */ @SuppressWarnings("unchecked") public List getTtsChunks() { return (List) getObject(TTSChunk.class, KEY_TTS_CHUNKS); } /** * Sets the duration. * * @param duration Timeout in milliseconds. Typical timeouts are 3-5 seconds. If omitted, timeout is set to * 5s. */ public SubtleAlert setDuration(Integer duration) { setParameters(KEY_DURATION, duration); return this; } /** * Gets the duration. * * @return Integer Timeout in milliseconds. Typical timeouts are 3-5 seconds. If omitted, timeout is set to * 5s. */ public Integer getDuration() { return getInteger(KEY_DURATION); } /** * Sets the softButtons. * * @param softButtons App defined SoftButtons. If omitted on supported displays, the displayed alert shall not * have any SoftButtons. */ public SubtleAlert setSoftButtons(List softButtons) { setParameters(KEY_SOFT_BUTTONS, softButtons); return this; } /** * Gets the softButtons. * * @return List App defined SoftButtons. If omitted on supported displays, the displayed alert shall not * have any SoftButtons. */ @SuppressWarnings("unchecked") public List getSoftButtons() { return (List) getObject(SoftButton.class, KEY_SOFT_BUTTONS); } /** * Sets the cancelID. * * @param cancelID An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC. */ public SubtleAlert setCancelID(Integer cancelID) { setParameters(KEY_CANCEL_ID, cancelID); return this; } /** * Gets the cancelID. * * @return Integer An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC. */ public Integer getCancelID() { return getInteger(KEY_CANCEL_ID); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy