Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | /** |
michael@0 | 9 | * Integration with the "Metro"/"Modern" UI environment in Windows 8. |
michael@0 | 10 | * |
michael@0 | 11 | * Note: browser/metro/base/content/browser.js contains a stub |
michael@0 | 12 | * implementation of this interface for non-Windows systems, for testing and |
michael@0 | 13 | * development purposes only. |
michael@0 | 14 | */ |
michael@0 | 15 | [scriptable, uuid(319faae0-82ca-4c2f-8a24-2b2445e5a72a)] |
michael@0 | 16 | interface nsIWinMetroUtils : nsISupports |
michael@0 | 17 | { |
michael@0 | 18 | /** |
michael@0 | 19 | * Determine if the current device has the hardware capabilities to run |
michael@0 | 20 | * in metro mode. |
michael@0 | 21 | */ |
michael@0 | 22 | readonly attribute boolean supported; |
michael@0 | 23 | |
michael@0 | 24 | /** |
michael@0 | 25 | * Determine if the current browser is running in the metro immersive |
michael@0 | 26 | * environment. |
michael@0 | 27 | */ |
michael@0 | 28 | readonly attribute boolean immersive; |
michael@0 | 29 | |
michael@0 | 30 | /** |
michael@0 | 31 | * Determine the activation URI |
michael@0 | 32 | */ |
michael@0 | 33 | readonly attribute AString activationURI; |
michael@0 | 34 | |
michael@0 | 35 | /** |
michael@0 | 36 | * Determine the previous execution state. The possible values of this |
michael@0 | 37 | * attribute are exactly those values in the |
michael@0 | 38 | * Windows::ApplicationModel::Activation enumeration. |
michael@0 | 39 | */ |
michael@0 | 40 | readonly attribute long previousExecutionState; |
michael@0 | 41 | |
michael@0 | 42 | /** |
michael@0 | 43 | * Helper for our restart logic up in the about flyout. We set this |
michael@0 | 44 | * right before we restart for an update so that MetroAppShell can |
michael@0 | 45 | * communicate this to the ceh. |
michael@0 | 46 | */ |
michael@0 | 47 | attribute boolean updatePending; |
michael@0 | 48 | |
michael@0 | 49 | /* |
michael@0 | 50 | * Determine if metro firefox is running in the foreground. |
michael@0 | 51 | */ |
michael@0 | 52 | readonly attribute boolean foreground; |
michael@0 | 53 | |
michael@0 | 54 | /** |
michael@0 | 55 | * Show the settings flyout |
michael@0 | 56 | */ |
michael@0 | 57 | void showSettingsFlyout(); |
michael@0 | 58 | |
michael@0 | 59 | /** |
michael@0 | 60 | * Launches the specified application with the specified arguments and |
michael@0 | 61 | * switches to Desktop mode if in metro mode. |
michael@0 | 62 | */ |
michael@0 | 63 | void launchInDesktop(in AString aPath, in AString aArguments); |
michael@0 | 64 | |
michael@0 | 65 | /** |
michael@0 | 66 | * Displays a native Windows 8 toast. |
michael@0 | 67 | * |
michael@0 | 68 | * @param aAppId Application ID for current application. |
michael@0 | 69 | * If using Metro mode, it can be null string. |
michael@0 | 70 | */ |
michael@0 | 71 | void showNativeToast(in AString aTitle, in AString aMessage, |
michael@0 | 72 | in AString anImage, in AString aCookie, |
michael@0 | 73 | [optional] in AString aAppId); |
michael@0 | 74 | |
michael@0 | 75 | /** |
michael@0 | 76 | * Secondary tiles are a Windows 8 specific feature for pinning new tiles |
michael@0 | 77 | * to the start screen. Tiles can later be activated whether the browser is |
michael@0 | 78 | * already opened or not. |
michael@0 | 79 | */ |
michael@0 | 80 | |
michael@0 | 81 | /** |
michael@0 | 82 | * Pins a new tile to the Windows 8 start screen. |
michael@0 | 83 | * |
michael@0 | 84 | * @param aTileID An ID which can later be used to remove the tile |
michael@0 | 85 | * ID must only contain valid filesystem characters |
michael@0 | 86 | * @param aShortName A short name for the tile |
michael@0 | 87 | * @param aDiplayName The name that will be displayed on the tile |
michael@0 | 88 | * @param aActivationArgs The arguments to pass to the browser upon |
michael@0 | 89 | * activation of the tile |
michael@0 | 90 | * @param aTileImage An image for the normal tile view |
michael@0 | 91 | * @param aSmallTileImage An image for the small tile view |
michael@0 | 92 | */ |
michael@0 | 93 | void pinTileAsync(in AString aTileID, |
michael@0 | 94 | in AString aShortName, |
michael@0 | 95 | in AString aDisplayName, |
michael@0 | 96 | in AString aActivationArgs, |
michael@0 | 97 | in AString aTileImage, |
michael@0 | 98 | in AString aSmallTileImage); |
michael@0 | 99 | |
michael@0 | 100 | /** |
michael@0 | 101 | * Unpins a tile from the Windows 8 start screen. |
michael@0 | 102 | * |
michael@0 | 103 | * @param aTileID An existing ID which was previously pinned |
michael@0 | 104 | * ID must only contain valid filesystem characters |
michael@0 | 105 | */ |
michael@0 | 106 | void unpinTileAsync(in AString aTileID); |
michael@0 | 107 | |
michael@0 | 108 | /** |
michael@0 | 109 | * Determines if a tile is pinned to the Windows 8 start screen. |
michael@0 | 110 | * |
michael@0 | 111 | * @param aTileID An ID which may have been pinned with pinTileAsync |
michael@0 | 112 | * ID must only contain valid filesystem characters |
michael@0 | 113 | * @return true if the tile is pinned |
michael@0 | 114 | */ |
michael@0 | 115 | bool isTilePinned(in AString aTileID); |
michael@0 | 116 | |
michael@0 | 117 | /** |
michael@0 | 118 | * Soft keyboard attributes. Used in unison with shown/hidden observer |
michael@0 | 119 | * events sent via FrameworkView. |
michael@0 | 120 | * |
michael@0 | 121 | * keyboardVisible - returns true if the soft keyboard is currently |
michael@0 | 122 | * displayed, false otherwise. |
michael@0 | 123 | * keyboardX, keyboardY, keyboardWidth, keyboardHeight - occlude rect |
michael@0 | 124 | * of the keyboard when displayed in device independent pixels. |
michael@0 | 125 | */ |
michael@0 | 126 | readonly attribute boolean keyboardVisible; |
michael@0 | 127 | readonly attribute unsigned long keyboardX; |
michael@0 | 128 | readonly attribute unsigned long keyboardY; |
michael@0 | 129 | readonly attribute unsigned long keyboardWidth; |
michael@0 | 130 | readonly attribute unsigned long keyboardHeight; |
michael@0 | 131 | |
michael@0 | 132 | /** |
michael@0 | 133 | * Settings panel links. addSettingsPanelEntry adds an entry to |
michael@0 | 134 | * the settings flyout panel that the user can invoke. |
michael@0 | 135 | * |
michael@0 | 136 | * @param aChromePanelId panel id invoked via nsIBrowserDOMWindow's |
michael@0 | 137 | * ShowPanel api. Example: 'prefs-container' |
michael@0 | 138 | * @return a unique identifier that will be passed as "data" in the |
michael@0 | 139 | * "metro-settings-entry-selected" notification when the entry is clicked |
michael@0 | 140 | */ |
michael@0 | 141 | unsigned long addSettingsPanelEntry(in AString aLabel); |
michael@0 | 142 | |
michael@0 | 143 | /** |
michael@0 | 144 | * Change the value of the "switch primary and secondary buttons" preference. |
michael@0 | 145 | * See the Windows SwapMouseButton API docs for details. |
michael@0 | 146 | * Included here for use in automated tests (see bug 839460). |
michael@0 | 147 | * |
michael@0 | 148 | * @param aSwap true to enable the preference, false to disable it. |
michael@0 | 149 | * @return original value of the preference. |
michael@0 | 150 | */ |
michael@0 | 151 | bool swapMouseButton(in bool aSwap); |
michael@0 | 152 | }; |