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