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
;
8 interface nsISVGPaintContext
;
9 interface imgIContainer
;
12 * Allow applications to interface with the Mac OS X Dock.
14 * Applications may indicate progress on their Dock icon. Only one such
15 * progress indicator is available to the entire application.
18 [scriptable
, uuid(8BE66B0C
-5F71
-4B74
-98CF
-6C2551B999B1
)]
19 interface nsIMacDockSupport
: nsISupports
22 * Menu to use for application-specific dock menu items.
24 attribute nsIStandaloneNativeMenu dockMenu
;
27 * Activate the application. This should be used by an application to
28 * activate itself when a dock menu is selected as selection of a dock menu
29 * item does not automatically activate the application.
31 * @param aIgnoreOtherApplications If false, the application is activated
32 * only if no other application is currently active. If true, the
33 * application activates regardless.
35 void activateApplication
(in boolean aIgnoreOtherApplications
);
38 * Text used to badge the dock tile. Setting this will remove any badge image.
40 attribute AString badgeText
;
43 * An image to add to the dock icon as a badge. Setting this will remove any
44 * badgeText. If an SVG image is passed the given paint context is used to
45 * set the stroke and fill properties.
47 void setBadgeImage
(in imgIContainer aBadgeImage
, [optional] in nsISVGPaintContext aPaintContext
);
50 * True if this app is in the list of apps that are persisted to the macOS
51 * Dock (as if the user selected "Keep in Dock").
53 readonly attribute
boolean isAppInDock
;
56 * Ensure that there is a tile for this app in the list of apps that are
57 * persisted to the macOS Dock (equivalent to the user selected "Keep in
60 * The position for the [new] app tile is:
62 * - its current position if it already exists, else
63 * - the position of `aAppToReplacePath` if it exists, else
64 * - directly after the last app with the same .app name, else
65 * - directly after the last known browser app (see `browserAppNames` in
66 * nsMacDockSupport.mm), else
67 * - at the end of the persisted app list.
69 * @param aAppPath [optional] The path of the .app to persist to the Dock
70 * (defaults to the path of the current app).
71 * @param aAppToReplacePath [optional] The path of a .app that should be
72 * replaced if it is in the list of persisted apps. This is useful when we
73 * prompt the user to install the app when the app is being run directly
74 * from a .dmg and the user may have dragged that .app file to the dock.
75 * @return true if the app was already in the list of persisted apps or if it
76 * was successfully added, else returns false.
78 boolean ensureAppIsPinnedToDock
([optional] in AString aAppPath
,
79 [optional] in AString aAppToReplacePath
);