nsITaskbarWindowPreview.idl 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* vim: se cin sw=2 ts=2 et : */
  2. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  3. *
  4. * This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  7. #include "nsITaskbarPreview.idl"
  8. interface nsITaskbarPreviewButton;
  9. /*
  10. * nsITaskbarWindowPreview
  11. *
  12. * This interface represents the preview for a window in the taskbar. By
  13. * default, Windows implements much of the behavior for applications by
  14. * default. The primary purpose of this interface is to allow Gecko
  15. * applications to take control over parts of the preview. Some parts are not
  16. * controlled through this interface: the title and icon of the preview match
  17. * the title and icon of the window always.
  18. *
  19. * By default, Windows takes care of drawing the thumbnail and preview for the
  20. * application however if enableCustomDrawing is set to true, then the
  21. * controller will start to receive drawPreview and drawThumbnail calls as well
  22. * as reads on the thumbnailAspectRatio, width and height properties.
  23. *
  24. * By default, nsITaskbarWindowPreviews are visible. When made invisible, the
  25. * window disappears from the list of windows in the taskbar for the
  26. * application.
  27. *
  28. * If the window has any visible nsITaskbarTabPreviews, then the
  29. * nsITaskbarWindowPreview for the corresponding window is automatically
  30. * hidden. This is not reflected in the visible property. Note that other parts
  31. * of the system (such as alt-tab) may still request thumbnails and/or previews
  32. * through the nsITaskbarWindowPreview's controller.
  33. *
  34. * nsITaskbarWindowPreview will never invoke the controller's onClose or
  35. * onActivate methods since handling them may conflict with other internal
  36. * Gecko state and there is existing infrastructure in place to allow clients
  37. * to handle those events
  38. *
  39. * Window previews may have a toolbar with up to 7 buttons. See
  40. * nsITaskbarPreviewButton for more information about button properties.
  41. */
  42. [scriptable, uuid(EC67CC57-342D-4064-B4C6-74A375E07B10)]
  43. interface nsITaskbarWindowPreview : nsITaskbarPreview
  44. {
  45. /**
  46. * Max 7 buttons per preview per the Windows Taskbar API
  47. */
  48. const long NUM_TOOLBAR_BUTTONS = 7;
  49. /**
  50. * Gets the nth button for the preview image. By default, all of the buttons
  51. * are invisible.
  52. *
  53. * @see nsITaskbarPreviewButton
  54. *
  55. * @param index The index into the button array. Must be >= 0 and <
  56. * MAX_TOOLBAR_BUTTONS.
  57. */
  58. nsITaskbarPreviewButton getButton(in unsigned long index);
  59. /**
  60. * Enables/disables custom drawing of thumbnails and previews
  61. *
  62. * Default value: false
  63. */
  64. attribute boolean enableCustomDrawing;
  65. };