widget/nsITouchBarInput.idl
author Brindusan Cristian <cbrindusan@mozilla.com>
Tue, 05 Mar 2019 22:42:15 +0200
changeset 520316 be4b780a7783cdf7d3ead37c98917dc0d2e94a1d
parent 511967 099f631b90046b102aa1868455f03b7f9942eaba
permissions -rw-r--r--
Backed out 5 changesets (bug 1508976, bug 1522581) for android geckoview bustages at /usr/bin/python2.7. CLOSED TREE Backed out changeset 7a6be593b0be (bug 1522581) Backed out changeset c47b37ac1775 (bug 1522581) Backed out changeset 91c31d2a7706 (bug 1508976) Backed out changeset da57df805c56 (bug 1508976) Backed out changeset 4e5d97c93515 (bug 1508976)

/* 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 "nsIArray.idl"
#include "nsISupports.idl"

[scriptable, function, uuid(001ab07c-1b3a-4dbf-a657-fada0065ff55)]
interface nsITouchBarInputCallback : nsISupports
{
  void onCommand();
};

/**
 * Implements an input to be registered on the Mac Touch Bar.
 */

[scriptable, uuid(77441d17-f29c-49d7-982f-f20a5ab5a900)]
interface nsITouchBarInput : nsISupports
{
  readonly attribute AString key;

  /**
   * The lookup key for the button's localized text title.
   */
  attribute AString title;

  /**
   * The name of a icon file added to
   * /widget/cocoa/touchbar.
   */
  attribute AString image;

  /**
   * The type of the input.
   * Takes one of:
   *   `button`: A standard button.
   *             If an image is available, only the image is displayed.
   *   `mainButton`: An extra-wide button. Displays both the image and title.
   *   `scrubber`: A Scrubber element. Not yet implemented, except in the
   *               case of Apple's pre-built Share scrubber.
   */
  attribute AString type;

  /**
   * A callback function to be invoked when an element is touched.
   */
  attribute nsITouchBarInputCallback callback;

  /**
   * A hexadecimal uint32_t specifying the input's
   * background color. If omitted, the default background color is used.
   */
  attribute uint32_t color;

  /**
   * If `true`, the Touch Bar input is greyed out and inoperable.
   */
  attribute boolean disabled;
};