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/. */
4
5#include "nsIArray.idl"
6#include "nsIBaseWindow.idl"
7#include "nsISupports.idl"
8#include "nsITouchBarInput.idl"
9
10/**
11 * Front-to-backend communication to keep Touch Bar updated
12 */
13[scriptable, uuid(38f396e2-93c9-4a77-aaf7-2d50b9962186)]
14interface nsITouchBarUpdater : nsISupports
15{
16  /**
17   * Updates an array of nsITouchBarInputs in the specified window.
18   */
19  void updateTouchBarInputs(in nsIBaseWindow aWindow, in Array<nsITouchBarInput> aInputs);
20
21  /**
22   * Enter the native Touch Bar customization window.
23   */
24  void enterCustomizeMode();
25
26  /**
27   * Checks if the user is using a Touch Bar-compatible Mac.
28   */
29  boolean isTouchBarInitialized();
30
31  /**
32   * Sets whether the Touch Bar is initialized.
33   * NOTE: This method is for internal unit tests only! Normally, the system
34   * sets this value after a Touch Bar is initialized on compatible Macs.
35   */
36  void setTouchBarInitialized(in boolean aIsInitialized);
37
38  /**
39   * If aShowing is true, aPopover is shown. Otherwise, it is hidden.
40   */
41  void showPopover(in nsIBaseWindow aWindow, in nsITouchBarInput aPopover, in boolean aShowing);
42};
43