michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: /** michael@0: * Integration with the "Metro"/"Modern" UI environment in Windows 8. michael@0: * michael@0: * Note: browser/metro/base/content/browser.js contains a stub michael@0: * implementation of this interface for non-Windows systems, for testing and michael@0: * development purposes only. michael@0: */ michael@0: [scriptable, uuid(319faae0-82ca-4c2f-8a24-2b2445e5a72a)] michael@0: interface nsIWinMetroUtils : nsISupports michael@0: { michael@0: /** michael@0: * Determine if the current device has the hardware capabilities to run michael@0: * in metro mode. michael@0: */ michael@0: readonly attribute boolean supported; michael@0: michael@0: /** michael@0: * Determine if the current browser is running in the metro immersive michael@0: * environment. michael@0: */ michael@0: readonly attribute boolean immersive; michael@0: michael@0: /** michael@0: * Determine the activation URI michael@0: */ michael@0: readonly attribute AString activationURI; michael@0: michael@0: /** michael@0: * Determine the previous execution state. The possible values of this michael@0: * attribute are exactly those values in the michael@0: * Windows::ApplicationModel::Activation enumeration. michael@0: */ michael@0: readonly attribute long previousExecutionState; michael@0: michael@0: /** michael@0: * Helper for our restart logic up in the about flyout. We set this michael@0: * right before we restart for an update so that MetroAppShell can michael@0: * communicate this to the ceh. michael@0: */ michael@0: attribute boolean updatePending; michael@0: michael@0: /* michael@0: * Determine if metro firefox is running in the foreground. michael@0: */ michael@0: readonly attribute boolean foreground; michael@0: michael@0: /** michael@0: * Show the settings flyout michael@0: */ michael@0: void showSettingsFlyout(); michael@0: michael@0: /** michael@0: * Launches the specified application with the specified arguments and michael@0: * switches to Desktop mode if in metro mode. michael@0: */ michael@0: void launchInDesktop(in AString aPath, in AString aArguments); michael@0: michael@0: /** michael@0: * Displays a native Windows 8 toast. michael@0: * michael@0: * @param aAppId Application ID for current application. michael@0: * If using Metro mode, it can be null string. michael@0: */ michael@0: void showNativeToast(in AString aTitle, in AString aMessage, michael@0: in AString anImage, in AString aCookie, michael@0: [optional] in AString aAppId); michael@0: michael@0: /** michael@0: * Secondary tiles are a Windows 8 specific feature for pinning new tiles michael@0: * to the start screen. Tiles can later be activated whether the browser is michael@0: * already opened or not. michael@0: */ michael@0: michael@0: /** michael@0: * Pins a new tile to the Windows 8 start screen. michael@0: * michael@0: * @param aTileID An ID which can later be used to remove the tile michael@0: * ID must only contain valid filesystem characters michael@0: * @param aShortName A short name for the tile michael@0: * @param aDiplayName The name that will be displayed on the tile michael@0: * @param aActivationArgs The arguments to pass to the browser upon michael@0: * activation of the tile michael@0: * @param aTileImage An image for the normal tile view michael@0: * @param aSmallTileImage An image for the small tile view michael@0: */ michael@0: void pinTileAsync(in AString aTileID, michael@0: in AString aShortName, michael@0: in AString aDisplayName, michael@0: in AString aActivationArgs, michael@0: in AString aTileImage, michael@0: in AString aSmallTileImage); michael@0: michael@0: /** michael@0: * Unpins a tile from the Windows 8 start screen. michael@0: * michael@0: * @param aTileID An existing ID which was previously pinned michael@0: * ID must only contain valid filesystem characters michael@0: */ michael@0: void unpinTileAsync(in AString aTileID); michael@0: michael@0: /** michael@0: * Determines if a tile is pinned to the Windows 8 start screen. michael@0: * michael@0: * @param aTileID An ID which may have been pinned with pinTileAsync michael@0: * ID must only contain valid filesystem characters michael@0: * @return true if the tile is pinned michael@0: */ michael@0: bool isTilePinned(in AString aTileID); michael@0: michael@0: /** michael@0: * Soft keyboard attributes. Used in unison with shown/hidden observer michael@0: * events sent via FrameworkView. michael@0: * michael@0: * keyboardVisible - returns true if the soft keyboard is currently michael@0: * displayed, false otherwise. michael@0: * keyboardX, keyboardY, keyboardWidth, keyboardHeight - occlude rect michael@0: * of the keyboard when displayed in device independent pixels. michael@0: */ michael@0: readonly attribute boolean keyboardVisible; michael@0: readonly attribute unsigned long keyboardX; michael@0: readonly attribute unsigned long keyboardY; michael@0: readonly attribute unsigned long keyboardWidth; michael@0: readonly attribute unsigned long keyboardHeight; michael@0: michael@0: /** michael@0: * Settings panel links. addSettingsPanelEntry adds an entry to michael@0: * the settings flyout panel that the user can invoke. michael@0: * michael@0: * @param aChromePanelId panel id invoked via nsIBrowserDOMWindow's michael@0: * ShowPanel api. Example: 'prefs-container' michael@0: * @return a unique identifier that will be passed as "data" in the michael@0: * "metro-settings-entry-selected" notification when the entry is clicked michael@0: */ michael@0: unsigned long addSettingsPanelEntry(in AString aLabel); michael@0: michael@0: /** michael@0: * Change the value of the "switch primary and secondary buttons" preference. michael@0: * See the Windows SwapMouseButton API docs for details. michael@0: * Included here for use in automated tests (see bug 839460). michael@0: * michael@0: * @param aSwap true to enable the preference, false to disable it. michael@0: * @return original value of the preference. michael@0: */ michael@0: bool swapMouseButton(in bool aSwap); michael@0: };