nsIWinTaskbar.idl 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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 "nsISupports.idl"
  8. #include "nsIBaseWindow.idl"
  9. interface nsIDocShell;
  10. interface nsITaskbarTabPreview;
  11. interface nsITaskbarWindowPreview;
  12. interface nsITaskbarPreviewController;
  13. interface nsITaskbarProgress;
  14. interface nsITaskbarOverlayIconController;
  15. interface nsIJumpListBuilder;
  16. interface mozIDOMWindow;
  17. /*
  18. * nsIWinTaskbar
  19. *
  20. * This interface represents a service which exposes the APIs provided by the
  21. * Windows taskbar to applications.
  22. *
  23. * Starting in Windows 7, applications gain some control over their appearance
  24. * in the taskbar. By default, there is one taskbar preview per top level
  25. * window (excluding popups). This preview is represented by an
  26. * nsITaskbarWindowPreview object.
  27. *
  28. * An application can register its own "tab" previews. Such previews will hide
  29. * the corresponding nsITaskbarWindowPreview automatically (though this is not
  30. * reflected in the visible attribute of the nsITaskbarWindowPreview). These
  31. * tab previews do not have to correspond to tabs in the application - they can
  32. * vary in size, shape and location. They do not even need to be actual GUI
  33. * elements on the window. Unlike window previews, tab previews require most of
  34. * the functionality of the nsITaskbarPreviewController to be implemented.
  35. *
  36. * Applications can also show progress on their taskbar icon. This does not
  37. * interact with the taskbar previews except if the nsITaskbarWindowPreview is
  38. * made invisible in which case the progress is naturally not shown on that
  39. * window.
  40. *
  41. * When taskbar icons are combined as is the default in Windows 7, the progress
  42. * for those windows is also combined as defined here:
  43. * http://msdn.microsoft.com/en-us/library/dd391697%28VS.85%29.aspx
  44. *
  45. * Applications may also define custom taskbar jump lists on application shortcuts.
  46. * See nsIJumpListBuilder for more information.
  47. */
  48. [scriptable, uuid(11751471-9246-4c72-a80f-0c7df765d640)]
  49. interface nsIWinTaskbar : nsISupports
  50. {
  51. /**
  52. * Returns true if the operating system supports Win7+ taskbar features.
  53. * This property acts as a replacement for in-place os version checking.
  54. */
  55. readonly attribute boolean available;
  56. /**
  57. * Returns the default application user model identity the application
  58. * registers with the system. This id is used by the taskbar in grouping
  59. * windows and in associating pinned shortcuts with running instances and
  60. * jump lists.
  61. */
  62. readonly attribute AString defaultGroupId;
  63. /**
  64. * Taskbar window and tab preview management
  65. */
  66. /**
  67. * Creates a taskbar preview. The docshell should be a toplevel docshell and
  68. * is used to find the toplevel window. See the documentation for
  69. * nsITaskbarTabPreview for more information.
  70. */
  71. nsITaskbarTabPreview createTaskbarTabPreview(in nsIDocShell shell,
  72. in nsITaskbarPreviewController controller);
  73. /**
  74. * Gets the taskbar preview for a window. The docshell is used to find the
  75. * toplevel window. See the documentation for nsITaskbarTabPreview for more
  76. * information.
  77. *
  78. * Note: to implement custom drawing or buttons, a controller is required.
  79. */
  80. nsITaskbarWindowPreview getTaskbarWindowPreview(in nsIDocShell shell);
  81. /**
  82. * Taskbar icon progress indicator
  83. */
  84. /**
  85. * Gets the taskbar progress for a window. The docshell is used to find the
  86. * toplevel window. See the documentation for nsITaskbarProgress for more
  87. * information.
  88. */
  89. nsITaskbarProgress getTaskbarProgress(in nsIDocShell shell);
  90. /**
  91. * Taskbar icon overlay
  92. */
  93. /**
  94. * Gets the taskbar icon overlay controller for a window. The docshell is used
  95. * to find the toplevel window. See the documentation in
  96. * nsITaskbarOverlayIconController for more details.
  97. */
  98. nsITaskbarOverlayIconController getOverlayIconController(in nsIDocShell shell);
  99. /**
  100. * Taskbar and start menu jump list management
  101. */
  102. /**
  103. * Retrieve a taskbar jump list builder
  104. *
  105. * Fails if a jump list build operation has already been initiated, developers
  106. * should make use of a single instance of nsIJumpListBuilder for building lists
  107. * within an application.
  108. *
  109. * @throw NS_ERROR_ALREADY_INITIALIZED if an nsIJumpListBuilder instance is
  110. * currently building a list.
  111. */
  112. nsIJumpListBuilder createJumpListBuilder();
  113. /**
  114. * Application window taskbar group settings
  115. */
  116. /**
  117. * Set the grouping id for a window.
  118. *
  119. * The runtime sets a default, global grouping id for all windows on startup.
  120. * setGroupIdForWindow allows individual windows to be grouped independently
  121. * on the taskbar. Ids should be unique to the app and window to insure
  122. * conflicts with other pinned applications do no arise.
  123. *
  124. * The default group id is based on application.ini vendor, application, and
  125. * version values, with a format of 'vendor.app.version'. The default can be
  126. * retrieved via defaultGroupId.
  127. *
  128. * Note, when a window changes taskbar window stacks, it is placed at the
  129. * bottom of the new stack.
  130. *
  131. * @throw NS_ERROR_INVALID_ARG if the window is not a valid top level window
  132. * associated with a widget.
  133. * @throw NS_ERROR_FAILURE if the property on the window could not be set.
  134. * @throw NS_ERROR_UNEXPECTED for general failures.
  135. */
  136. void setGroupIdForWindow(in mozIDOMWindow aParent, in AString aIdentifier);
  137. /**
  138. * Notify the taskbar that a window is about to enter full screen mode.
  139. *
  140. * A Windows autohide taskbar will not behave correctly in all cases if
  141. * it is not notified when full screen operations start and end.
  142. *
  143. * @throw NS_ERROR_INVALID_ARG if the window is not a valid top level window
  144. * @throw NS_ERROR_UNEXPECTED for general failures.
  145. * @throw NS_ERROR_NOT_AVAILABLE if the taskbar cannot be obtained.
  146. */
  147. void prepareFullScreen(in mozIDOMWindow aWindow, in boolean aFullScreen);
  148. /**
  149. * Notify the taskbar that a window identified by its HWND is about to enter
  150. * full screen mode.
  151. *
  152. * A Windows autohide taskbar will not behave correctly in all cases if
  153. * it is not notified when full screen operations start and end.
  154. *
  155. * @throw NS_ERROR_INVALID_ARG if the window is not a valid top level window
  156. * @throw NS_ERROR_UNEXPECTED for general failures.
  157. * @throw NS_ERROR_NOT_AVAILABLE if the taskbar cannot be obtained.
  158. */
  159. [noscript] void prepareFullScreenHWND(in voidPtr aWindow, in boolean aFullScreen);
  160. };