nsISupports
Last changed in Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)Clients should provide their own implementation of this interface. Depending on whether the controller is connected to an nsITaskbarTabPreview
or nsITaskbarWindowPreview
, only certain methods and attributes need to be implemented.
boolean drawPreview(in nsIDOMCanvasRenderingContext2D ctx); |
boolean drawThumbnail(in nsIDOMCanvasRenderingContext2D ctx, in unsigned long width, in unsigned long height); |
boolean onActivate(); |
void onClick(in nsITaskbarPreviewButton button); |
void onClose(); |
Attribute | Type | Description |
height |
unsigned long |
The height in pixels of the preview image. This value may change at any time. See drawPreview() for more information. Read only. |
thumbnailAspectRatio |
float |
The thumbnail's aspect ratio. This doesn't need to match the preview's aspect ratio, and is allowed to be changed at any time. See drawThumbnail() for more information. Read only. |
width |
unsigned long |
The width in pixels of the preview image. This value may change at any time. See drawPreview() for more information. Read only. |
nsITaskbarPreviewController
cannot alter these values. The controller and its supporting code, however, may change this values at any time.Invoked by nsITaskbarPreview
when it needs to render the preview. The specified context is attached to a surface with the controller's width and height, the values of which are obtained immediately prior to calling this method.
boolean drawPreview( in nsIDOMCanvasRenderingContext2D ctx );
ctx
nsIDOMCanvasRenderingContext2D
object representing the drawing context into which the preview is to be rendered. Note that this context is not actually attached to a canvas element.true
if you want a frame drawn around the preview, otherwise false
.
Invoked by the taskbar preview when it needs to draw the thumbnail in the taskbar's application preview window.
boolean drawThumbnail( in nsIDOMCanvasRenderingContext2D ctx, in unsigned long width, in unsigned long height );
ctx
nsIDOMCanvasRenderingContext2D
object representing the drawing context into which the thumbnail is to be rendered. Note that this context is not actually attached to a canvas element.width
height
width
÷ height
will equal the thumbnailAspectRatio
, within the margin of rounding errors.true
if you want a frame drawn around the thumbnail, otherwise false
.
Invoked when the user clicks on the tab preview.
boolean onActivate();
None.
true
if the top level window corresponding to the preview should be activated, false
if activation is not accepted.
Invoked when one of the buttons on the window preview's toolbar is clicked by the user.
void onClick( in nsITaskbarPreviewButton button );
button
nsITaskbarPreviewButton
object representing the button that was pressed. This can be compared to the buttons returned by the nsITaskbarWindowPreview.getButton()
.Invoked when the user presses the close button on the tab preview.
void onClose();
None.