File: nsIMacDockSupport.idl

package info (click to toggle)
firefox 147.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,683,320 kB
  • sloc: cpp: 7,607,359; javascript: 6,533,295; ansic: 3,775,223; python: 1,415,500; xml: 634,561; asm: 438,949; java: 186,241; sh: 62,752; makefile: 18,079; objc: 13,092; perl: 12,808; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (98 lines) | stat: -rw-r--r-- 3,764 bytes parent folder | download | duplicates (11)
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
/* 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"

interface nsIStandaloneNativeMenu;
interface nsISVGPaintContext;
interface imgIContainer;
interface nsIFile;

[scriptable, uuid(2cbde069-b80d-4e63-b7c7-c4dfe4617028)]
interface nsIAppBundleLaunchOptions : nsISupports {
  /**
   * A Boolean value indicating whether to add the app or documents to the
   * Recent Items menu.
   */
  readonly attribute boolean addsToRecentItems;
};

/**
 * Allow applications to interface with the Mac OS X Dock.
 *
 * Applications may indicate progress on their Dock icon. Only one such
 * progress indicator is available to the entire application.
 */

[scriptable, uuid(8BE66B0C-5F71-4B74-98CF-6C2551B999B1)]
interface nsIMacDockSupport : nsISupports
{
  /**
   * Menu to use for application-specific dock menu items.
   */
  attribute nsIStandaloneNativeMenu dockMenu;

  /**
   * Activate the application. This should be used by an application to
   * activate itself when a dock menu is selected as selection of a dock menu
   * item does not automatically activate the application.
   *
   * @param aIgnoreOtherApplications If false, the application is activated
   *        only if no other application is currently active. If true, the
   *        application activates regardless.
   */
  void activateApplication(in boolean aIgnoreOtherApplications);

  /**
   * Text used to badge the dock tile. Setting this will remove any badge image.
   */
  attribute AString badgeText;

  /**
   * An image to add to the dock icon as a badge. Setting this will remove any
   * badgeText. If an SVG image is passed the given paint context is used to
   * set the stroke and fill properties.
   */
  void setBadgeImage(in imgIContainer aBadgeImage, [optional] in nsISVGPaintContext aPaintContext);

  /**
   * True if this app is in the list of apps that are persisted to the macOS
   * Dock (as if the user selected "Keep in Dock").
   */
  readonly attribute boolean isAppInDock;

  /**
   * Ensure that there is a tile for this app in the list of apps that are
   * persisted to the macOS Dock (equivalent to the user selected "Keep in
   * Dock").
   *
   * The position for the [new] app tile is:
   *
   * - its current position if it already exists, else
   * - the position of `aAppToReplacePath` if it exists, else
   * - directly after the last app with the same .app name, else
   * - directly after the last known browser app (see `browserAppNames` in
   *   nsMacDockSupport.mm), else
   * - at the end of the persisted app list.
   *
   * @param aAppPath [optional] The path of the .app to persist to the Dock
   *   (defaults to the path of the current app).
   * @param aAppToReplacePath [optional] The path of a .app that should be
   *   replaced if it is in the list of persisted apps.  This is useful when we
   *   prompt the user to install the app when the app is being run directly
   *   from a .dmg and the user may have dragged that .app file to the dock.
   * @return true if the app was already in the list of persisted apps or if it
   *   was successfully added, else returns false.
   */
  boolean ensureAppIsPinnedToDock([optional] in AString aAppPath,
                                  [optional] in AString aAppToReplacePath);

  /**
   * Launches an application bundle passing the given command line arguments.
   * The `aLaunchOptions` parameter can control aspects of how the bundle is
   * launched.
   */
  void launchAppBundle(in nsIFile aAppBundle, in Array<AString> aArgs,
                       [optional] in nsIAppBundleLaunchOptions aLaunchOptions);
};