widget/nsITaskbarTabPreview.idl
author Timothy Guan-tin Chien <timdream@gmail.com>
Mon, 28 Jan 2019 18:24:08 +0000
changeset 513567 c1032d34b5e0e525820446f713e4ad6288ebcb56
parent 494867 31941d904a7c3df53ed5b4c9ecdc40025d865dfb
child 532610 54a4320c7206d6a478b23a6a52b1f51b00dcec53
permissions -rw-r--r--
Bug 1518932 - Convert menulist to custom element r=paolo This custom element replaces XBL <content> usage by directly prepend the two needed child nodes when the element is connected. This is doable because - There isn't any direct access of child nodes under <menulist>. Everyone seems to access via .menupopup, which is usually the only child. - We don't need to move the children under <menulist>. If we need to and if the child is a <xbl:children> (which could happen if <menulist> is inside an XBL <content> that just get cloned to the document), the layout will get very confused and crash (see finding in bug 1514926) Differential Revision: https://phabricator.services.mozilla.com/D16149

/* vim: se cin sw=2 ts=2 et : */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 *
 * 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 "nsITaskbarPreview.idl"
interface imgIContainer;

/*
 * nsITaskbarTabPreview
 *
 * This interface controls tab preview-specific behavior. Creating an
 * nsITaskbarTabPreview for a window will hide that window's
 * nsITaskbarWindowPreview in the taskbar - the native API performs this
 * unconditionally. When there are no more tab previews for a window, the
 * nsITaskbarWindowPreview will automatically become visible again.
 *
 * An application may have as many tab previews per window as memory allows.
 *
 */
[scriptable, uuid(11E4C8BD-5C2D-4E1A-A9A1-79DD5B0FE544)]
interface nsITaskbarTabPreview : nsITaskbarPreview
{
  /**
   * The title displayed above the thumbnail
   *
   * Default: an empty string
   */
  attribute AString title;

  /**
   * The icon displayed next to the title in the preview
   *
   * Default: null
   */
  attribute imgIContainer icon;

  /**
   * Rearranges the preview relative to another tab preview from the same window
   * @param aNext The preview to the right of this one. A value of null
   *              indicates that the preview is the rightmost one.
   */
  void move(in nsITaskbarTabPreview aNext);

  /**
   * Used internally to grab the handle to the proxy window.
   */
  [notxpcom]
  nativeWindow GetHWND();

  /**
   * Used internally to ensure that the taskbar knows about this preview. If a
   * preview is not registered, then the API call to set its sibling (via move)
   * will silently fail.
   *
   * This method is only invoked when it is safe to make taskbar API calls.
   */
  [notxpcom]
  void EnsureRegistration();
};