001package Torello.Browser.BrowserAPI;
002
003// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
004// Java-HTML Imports
005// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
006
007import Torello.Browser.*;
008import Torello.Browser.helper.*;
009import Torello.Browser.JavaScriptAPI.*;
010import Torello.JSON.*;
011
012import Torello.Java.ReadOnly.ReadOnlyList;
013import Torello.Java.ReadOnly.ReadOnlyArrayList;
014
015import Torello.JavaDoc.Annotations.StaticFunctional;
016import Torello.JavaDoc.Annotations.JDHeaderBackgroundImg;
017
018import Torello.Browser.BrowserAPI.NestedHelpers.Commands.DeviceOrientation$$Commands;
019
020
021// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
022// JDK Imports
023// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
024
025import javax.json.JsonObject;
026import javax.json.JsonValue;
027
028/**
029 * <SPAN CLASS=COPIEDJDK><B><CODE>[No Description Provided by Google]</CODE></B></SPAN>
030 * <EMBED CLASS='external-html' DATA-FILE-ID=CDP.CODE_GEN_NOTE>
031 */
032@StaticFunctional@JDHeaderBackgroundImg(EmbedTagFileID="CDP.WOOD_PLANK_NOTE")
033public class DeviceOrientation
034{
035    // No Pubic Constructors
036    private DeviceOrientation() { }
037
038
039
040
041
042    // ********************************************************************************************
043    // ********************************************************************************************
044    // Commands
045    // ********************************************************************************************
046    // ********************************************************************************************
047
048
049    /**
050     * Clears the overridden Device Orientation.
051     * 
052     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
053     *
054     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
055     * browser receives the invocation-request.
056     *
057     * <BR /><BR /><DIV CLASS=JDHint>
058     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
059     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
060     * the Browser Function has run to completion.
061     * </DIV>
062     */
063    public static Script<Void> clearDeviceOrientationOverride()
064    {
065        // Ultra-Simple Request JSON - Because this method has no parameters
066        final String requestJSON = "{\"method\":\"DeviceOrientation.clearDeviceOrientationOverride\"}";
067
068        return Script.NO_RET(Domains.DeviceOrientation, "clearDeviceOrientationOverride", requestJSON);
069    }
070
071    /**
072     * Overrides the Device Orientation.
073     * 
074     * @param alpha Mock alpha
075     * 
076     * @param beta Mock beta
077     * 
078     * @param gamma Mock gamma
079     * 
080     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
081     *
082     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
083     * browser receives the invocation-request.
084     *
085     * <BR /><BR /><DIV CLASS=JDHint>
086     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
087     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
088     * the Browser Function has run to completion.
089     * </DIV>
090     */
091    public static Script<Void> setDeviceOrientationOverride
092        (Number alpha, Number beta, Number gamma)
093    {
094        // Convert all Method Parameters into a JSON Request-Object (as a String)
095        final String requestJSON = WriteJSON.get(
096            DeviceOrientation$$Commands.setDeviceOrientationOverride$$,
097            "DeviceOrientation.setDeviceOrientationOverride",
098            alpha, beta, gamma
099        );
100
101        return Script.NO_RET(Domains.DeviceOrientation, "setDeviceOrientationOverride", requestJSON);
102    }
103
104
105}