1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include
"nsISupports.idl"
9 * Integration with the "Metro"/"Modern" UI environment in Windows 8.
11 * Note: browser/metro/base/content/browser-scripts.js contains a stub
12 * implementation of this interface for non-Windows systems, for testing and
13 * development purposes only.
15 [scriptable
, uuid(b2452440
-71c6
-41a7
-8eda
-48004d725001
)]
16 interface nsIWinMetroUtils
: nsISupports
18 /* Fullscreen landscape orientation */
19 const long fullScreenLandscape
= 0;
20 /* Larger snapped state */
21 const long filled
= 1;
22 /* Smaller snapped state */
23 const long snapped
= 2;
24 /* Fullscreen portrait orientation */
25 const long fullScreenPortrait
= 3;
27 /* return constants for the handPreference property */
28 const long handPreferenceLeft
= 0;
29 const long handPreferenceRight
= 1;
32 * Determines the current snapped state.
34 readonly attribute
long snappedState
;
37 * Determine if the current browser is running in the metro immersive
40 readonly attribute
boolean immersive
;
43 * Determine if the user prefers left handed or right handed input.
45 readonly attribute
long handPreference
;
48 * Attempts to unsnap the application from snapped state to filled state
54 * Show the settings flyout
56 void showSettingsFlyout
();
59 * Launches the specified application with the specified arguments and
60 * switches to Desktop mode if in metro mode.
62 void launchInDesktop
(in AString aPath
, in AString aArguments
);
65 * Secondary tiles are a Windows 8 specific feature for pinning new tiles
66 * to the start screen. Tiles can later be activated whether the browser is
67 * already opened or not.
71 * Pins a new tile to the Windows 8 start screen.
73 * @param aTileID An ID which can later be used to remove the tile
74 * @param aShortName A short name for the tile
75 * @param aDiplayName The name that will be displayed on the tile
76 * @param aActivationArgs The arguments to pass to the browser upon
77 * activation of the tile
78 * @param aTileImage An image for the normal tile view
79 * @param aSmallTileImage An image for the small tile view
81 void pinTileAsync
(in AString aTileID
,
82 in AString aShortName
,
83 in AString aDisplayName
,
84 in AString aActivationArgs
,
85 in AString aTileImage
,
86 in AString aSmallTileImage
);
89 * Unpins a tile from the Windows 8 start screen.
91 * @param aTileID An existing ID which was previously pinned
93 void unpinTileAsync
(in AString aTileID
);
96 * Determines if a tile is pinned to the Windows 8 start screen.
98 * @param aTileID An ID which may have been pinned with pinTileAsync
99 * @return true if the tile is pinned
101 bool isTilePinned
(in AString aTileID
);
104 * Soft keyboard attributes. Used in unison with shown/hidden observer
105 * events sent via FrameworkView.
107 * keyboardVisible - returns true if the soft keyboard is currently
108 * displayed, false otherwise.
109 * keyboardX, keyboardY, keyboardWidth, keyboardHeight - occlude rect
110 * of the keyboard when displayed in device independent pixels.
112 readonly attribute
boolean keyboardVisible
;
113 readonly attribute
unsigned long keyboardX
;
114 readonly attribute
unsigned long keyboardY
;
115 readonly attribute
unsigned long keyboardWidth
;
116 readonly attribute
unsigned long keyboardHeight
;
119 * Settings panel links. addSettingsPanelEntry adds an entry to
120 * the settings flyout panel that the user can invoke.
122 * @param aChromePanelId panel id invoked via nsIBrowserDOMWindow's
123 * ShowPanel api. Example: 'prefs-container'
124 * @return a unique identifier that will be passed as "data" in the
125 * "metro-settings-entry-selected" notification when the entry is clicked
127 unsigned long addSettingsPanelEntry
(in AString aLabel
);
130 * Change the value of the "switch primary and secondary buttons" preference.
131 * See the Windows SwapMouseButton API docs for details.
132 * Included here for use in automated tests (see bug 839460).
134 * @param aSwap true to enable the preference, false to disable it.
135 * @return original value of the preference.
137 bool swapMouseButton
(in bool aSwap
);