Bug 1885565 - Part 1: Add mozac_ic_avatar_circle_24 to ui-icons r=android-reviewers...
[gecko.git] / widget / nsIMacDockSupport.idl
blob04d6dca7741e01950bd7e5c46005b674c0241b6f
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "nsISupports.idl"
7 interface nsIStandaloneNativeMenu;
9 /**
10 * Allow applications to interface with the Mac OS X Dock.
12 * Applications may indicate progress on their Dock icon. Only one such
13 * progress indicator is available to the entire application.
16 [scriptable, uuid(8BE66B0C-5F71-4B74-98CF-6C2551B999B1)]
17 interface nsIMacDockSupport : nsISupports
19 /**
20 * Menu to use for application-specific dock menu items.
22 attribute nsIStandaloneNativeMenu dockMenu;
24 /**
25 * Activate the application. This should be used by an application to
26 * activate itself when a dock menu is selected as selection of a dock menu
27 * item does not automatically activate the application.
29 * @param aIgnoreOtherApplications If false, the application is activated
30 * only if no other application is currently active. If true, the
31 * application activates regardless.
33 void activateApplication(in boolean aIgnoreOtherApplications);
35 /**
36 * Text used to badge the dock tile.
38 attribute AString badgeText;
40 /**
41 * True if this app is in the list of apps that are persisted to the macOS
42 * Dock (as if the user selected "Keep in Dock").
44 readonly attribute bool isAppInDock;
46 /**
47 * Ensure that there is a tile for this app in the list of apps that are
48 * persisted to the macOS Dock (equivalent to the user selected "Keep in
49 * Dock").
51 * The position for the [new] app tile is:
53 * - its current position if it already exists, else
54 * - the position of `aAppToReplacePath` if it exists, else
55 * - directly after the last app with the same .app name, else
56 * - directly after the last known browser app (see `browserAppNames` in
57 * nsMacDockSupport.mm), else
58 * - at the end of the persisted app list.
60 * @param aAppPath [optional] The path of the .app to persist to the Dock
61 * (defaults to the path of the current app).
62 * @param aAppToReplacePath [optional] The path of a .app that should be
63 * replaced if it is in the list of persisted apps. This is useful when we
64 * prompt the user to install the app when the app is being run directly
65 * from a .dmg and the user may have dragged that .app file to the dock.
66 * @return true if the app was already in the list of persisted apps or if it
67 * was successfully added, else returns false.
69 bool ensureAppIsPinnedToDock([optional] in AString aAppPath,
70 [optional] in AString aAppToReplacePath);