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(45656788-B111
-4317-B054
-FFE881A0737E
)]
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
53 * Launches the specified application with the specified arguments and
54 * switches to Desktop mode if in metro mode.
56 void launchInDesktop
(in AString aPath
, in AString aArguments
);
59 * Secondary tiles are a Windows 8 specific feature for pinning new tiles
60 * to the start screen. Tiles can later be activated whether the browser is
61 * already opened or not.
65 * Pins a new tile to the Windows 8 start screen.
67 * @param aTileID An ID which can later be used to remove the tile
68 * @param aShortName A short name for the tile
69 * @param aDiplayName The name that will be displayed on the tile
70 * @param aActivationArgs The arguments to pass to the browser upon
71 * activation of the tile
72 * @param aTileImage An image for the normal tile view
73 * @param aSmallTileImage An image for the small tile view
75 void pinTileAsync
(in AString aTileID
,
76 in AString aShortName
,
77 in AString aDisplayName
,
78 in AString aActivationArgs
,
79 in AString aTileImage
,
80 in AString aSmallTileImage
);
83 * Unpins a tile from the Windows 8 start screen.
85 * @param aTileID An existing ID which was previously pinned
87 void unpinTileAsync
(in AString aTileID
);
90 * Determines if a tile is pinned to the Windows 8 start screen.
92 * @param aTileID An ID which may have been pinned with pinTileAsync
93 * @return true if the tile is pinned
95 bool isTilePinned
(in AString aTileID
);
98 * Soft keyboard attributes. Used in unison with shown/hidden observer
99 * events sent via FrameworkView.
101 * keyboardVisible - returns true if the soft keyboard is currently
102 * displayed, false otherwise.
103 * keyboardX, keyboardY, keyboardWidth, keyboardHeight - occlude rect
104 * of the keyboard when displayed in device independent pixels.
106 readonly attribute
boolean keyboardVisible
;
107 readonly attribute
unsigned long keyboardX
;
108 readonly attribute
unsigned long keyboardY
;
109 readonly attribute
unsigned long keyboardWidth
;
110 readonly attribute
unsigned long keyboardHeight
;
113 * Settings panel links. addSettingsPanelEntry adds an entry to
114 * the settings flyout panel that the user can invoke.
116 * @param aChromePanelId panel id invoked via nsIBrowserDOMWindow's
117 * ShowPanel api. Example: 'prefs-container'
118 * @param aLabel Localized string label displayed in the settings
119 * flyout panel for this option.
121 void addSettingsPanelEntry
(in AString aChromePanelId
, in AString aLabel
);