nsITaskbarWindowPreview 编辑
widget/public/nsITaskbarWindowPreview.idl
Scriptable This interface is used on Microsoft Windows to represent the preview for a window in the taskbar. 1.0 66 Introduced Gecko 1.9.2 Inherits from: nsITaskbarPreview
Last changed in Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)You can't directly instantiate this interface; instead, call nsIWinTaskbar.getTaskbarWindowPreview()
to get the taskbar preview for a specific window.
Window preview behavior
By default, Windows implements much of the behavior for applications in a standard way. This interface's primary purpose is to let Gecko applications take control over parts of the preview; however, certain parts of the preview are not controlled using this interface. For example, the title and icon for each preview always match the title and icon of the corresponding window.
If the enableCustomDrawing
attribute is true, the controller you implement will start receiving calls to its nsITaskbarPreviewController.drawPreview()
and nsITaskbarPreviewController.drawThumbnail()
methods, as well as reads of its width
, height
, and thumbnailAccessRatio
attributes. By default, however, Windows handles this drawing by itself.
In addition, these previews are visible by default. When made invisible, the window disappears from the list of the application's windows in the taskbar.
If a window has any visible nsITaskbarTabPreview
objects, the nsITaskbarWindowPreview
for the corresponding window is automatically hidden. This is not reflected by the visible
attribute. Note that even while the preview is hidden, its thumbnails and/or previews may still be requested by other parts of the operating system through the nsITaskbarWindowPreview
's controller.
Note: This interface will never invoke the controller's nsITaskbarPreviewController.onClose()
or nsITaskbarPreviewController.onActivate()
methods, since handling them may conflict with other internal Gecko state management. There is existing infrastructure in place to let clients handle those events.
Window preview toolbars
Window previews may have a toolbar with up to seven buttons. The array of buttons may be accessed by calling getButton()
; each button is an nsITaskbarPreviewButton
object. You may customize these buttons using the attributes on that interface. User clicks on the toolbar buttons are reported to your nsITaskbarPreviewController
implementation's nsITaskbarPreviewController.onClick()
method.
Method overview
nsITaskbarPreviewButton getButton(in unsigned long index); |
Attributes
Attribute | Type | Description |
enableCustomDrawing | boolean | If true, the nsITaskbarPreviewController object's nsITaskbarPreviewController.drawPreview() and nsITaskbarPreviewController.drawThumbnail() methods will be called to draw the preview. If false, the operating system draws these for you. |
Constants
Constant | Value | Description |
NUM_TOOLBAR_BUTTONS | 7 | The maximum number of toolbar buttons supported by the Windows Taskbar API. |
Methods
getButton()
Returns the specified button from the preview's toolbar.
Note: By default, all buttons are hidden. You must fetch and configure each button that you want to make visible.nsITaskbarPreviewButton getButton( in unsigned long index );
Parameters
index
- The index into the button array for the
nsITaskbarPreviewButton
to retrieve. This value must be at least 0 (the leftmost button) and less thanNUM_TOOLBAR_BUTTONS
.
Return value
An nsITaskbarPreviewButton
describing the requested button.
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论