widget/nsIWinMetroUtils.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/nsIWinMetroUtils.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,152 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +/**
    1.12 + * Integration with the "Metro"/"Modern" UI environment in Windows 8.
    1.13 + *
    1.14 + * Note: browser/metro/base/content/browser.js contains a stub
    1.15 + * implementation of this interface for non-Windows systems, for testing and
    1.16 + * development purposes only.
    1.17 + */
    1.18 +[scriptable, uuid(319faae0-82ca-4c2f-8a24-2b2445e5a72a)]
    1.19 +interface nsIWinMetroUtils : nsISupports
    1.20 +{
    1.21 +  /**
    1.22 +   * Determine if the current device has the hardware capabilities to run
    1.23 +   * in metro mode.
    1.24 +   */
    1.25 +  readonly attribute boolean supported;
    1.26 +
    1.27 +  /**
    1.28 +   * Determine if the current browser is running in the metro immersive
    1.29 +   * environment.
    1.30 +   */
    1.31 +  readonly attribute boolean immersive;
    1.32 +
    1.33 +  /**
    1.34 +   * Determine the activation URI
    1.35 +   */
    1.36 +  readonly attribute AString activationURI;
    1.37 +
    1.38 +  /**
    1.39 +   * Determine the previous execution state. The possible values of this
    1.40 +   * attribute are exactly those values in the
    1.41 +   * Windows::ApplicationModel::Activation enumeration.
    1.42 +   */
    1.43 +  readonly attribute long previousExecutionState;
    1.44 +
    1.45 +  /**
    1.46 +   * Helper for our restart logic up in the about flyout. We set this
    1.47 +   * right before we restart for an update so that MetroAppShell can
    1.48 +   * communicate this to the ceh.
    1.49 +   */
    1.50 +  attribute boolean updatePending;
    1.51 +
    1.52 +  /*
    1.53 +   * Determine if metro firefox is running in the foreground.
    1.54 +   */
    1.55 +  readonly attribute boolean foreground;
    1.56 +
    1.57 +   /**
    1.58 +    * Show the settings flyout
    1.59 +    */
    1.60 +   void showSettingsFlyout();
    1.61 +
    1.62 +  /**
    1.63 +   * Launches the specified application with the specified arguments and
    1.64 +   * switches to Desktop mode if in metro mode.
    1.65 +   */
    1.66 +   void launchInDesktop(in AString aPath, in AString aArguments); 
    1.67 +
    1.68 +  /**
    1.69 +   * Displays a native Windows 8 toast.
    1.70 +   *
    1.71 +   * @param aAppId  Application ID for current application.
    1.72 +   *                If using Metro mode, it can be null string.
    1.73 +   */
    1.74 +   void showNativeToast(in AString aTitle, in AString aMessage,
    1.75 +                        in AString anImage, in AString aCookie,
    1.76 +                        [optional] in AString aAppId);
    1.77 +
    1.78 +  /**
    1.79 +   * Secondary tiles are a Windows 8 specific feature for pinning new tiles
    1.80 +   * to the start screen.   Tiles can later be activated whether the browser is
    1.81 +   * already opened or not. 
    1.82 +   */
    1.83 +
    1.84 +  /**
    1.85 +   * Pins a new tile to the Windows 8 start screen.
    1.86 +   * 
    1.87 +   * @param aTileID         An ID which can later be used to remove the tile
    1.88 +   *                        ID must only contain valid filesystem characters
    1.89 +   * @param aShortName      A short name for the tile
    1.90 +   * @param aDiplayName     The name that will be displayed on the tile
    1.91 +   * @param aActivationArgs The arguments to pass to the browser upon 
    1.92 +   *                        activation of the tile
    1.93 +   * @param aTileImage An image for the normal tile view
    1.94 +   * @param aSmallTileImage An image for the small tile view
    1.95 +   */
    1.96 +  void pinTileAsync(in AString aTileID,
    1.97 +                    in AString aShortName,
    1.98 +                    in AString aDisplayName,
    1.99 +                    in AString aActivationArgs,
   1.100 +                    in AString aTileImage,
   1.101 +                    in AString aSmallTileImage);
   1.102 +
   1.103 +  /**
   1.104 +   * Unpins a tile from the Windows 8 start screen.
   1.105 +   * 
   1.106 +   * @param aTileID An existing ID which was previously pinned
   1.107 +   *                ID must only contain valid filesystem characters
   1.108 +   */
   1.109 +  void unpinTileAsync(in AString aTileID);
   1.110 +
   1.111 +  /**
   1.112 +   * Determines if a tile is pinned to the Windows 8 start screen.
   1.113 +   * 
   1.114 +   * @param aTileID An ID which may have been pinned with pinTileAsync
   1.115 +   *                ID must only contain valid filesystem characters
   1.116 +   * @return true if the tile is pinned
   1.117 +   */
   1.118 +  bool isTilePinned(in AString aTileID);
   1.119 +
   1.120 +  /**
   1.121 +   * Soft keyboard attributes. Used in unison with shown/hidden observer
   1.122 +   * events sent via FrameworkView.
   1.123 +   *
   1.124 +   * keyboardVisible - returns true if the soft keyboard is currently
   1.125 +   * displayed, false otherwise.
   1.126 +   * keyboardX, keyboardY, keyboardWidth, keyboardHeight - occlude rect
   1.127 +   * of the keyboard when displayed in device independent pixels.
   1.128 +   */
   1.129 +  readonly attribute boolean keyboardVisible;
   1.130 +  readonly attribute unsigned long keyboardX;
   1.131 +  readonly attribute unsigned long keyboardY;
   1.132 +  readonly attribute unsigned long keyboardWidth;
   1.133 +  readonly attribute unsigned long keyboardHeight;
   1.134 +
   1.135 +  /**
   1.136 +   * Settings panel links. addSettingsPanelEntry adds an entry to
   1.137 +   * the settings flyout panel that the user can invoke.
   1.138 +   *
   1.139 +   * @param aChromePanelId panel id invoked via nsIBrowserDOMWindow's
   1.140 +   * ShowPanel api. Example: 'prefs-container'
   1.141 +   * @return a unique identifier that will be passed as "data" in the
   1.142 +   * "metro-settings-entry-selected" notification when the entry is clicked
   1.143 +   */
   1.144 +  unsigned long addSettingsPanelEntry(in AString aLabel);
   1.145 +
   1.146 +  /**
   1.147 +   * Change the value of the "switch primary and secondary buttons" preference.
   1.148 +   * See the Windows SwapMouseButton API docs for details.
   1.149 +   * Included here for use in automated tests (see bug 839460).
   1.150 +   *
   1.151 +   * @param aSwap true to enable the preference, false to disable it.
   1.152 +   * @return original value of the preference.
   1.153 +   */
   1.154 +  bool swapMouseButton(in bool aSwap);
   1.155 +};

mercurial