Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsIImageLoadingContent Interface Reference

This interface represents a content node that loads images. More...

import "nsIImageLoadingContent.idl";

Inheritance diagram for nsIImageLoadingContent:
Inheritance graph
[legend]
Collaboration diagram for nsIImageLoadingContent:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void addObserver (in imgIDecoderObserver aObserver)
 Used to register an image decoder observer.
void removeObserver (in imgIDecoderObserver aObserver)
 Used to unregister an image decoder observer.
imgIRequest getRequest (in long aRequestType)
 Accessor to get the image requests.
long getRequestType (in imgIRequest aRequest)
 Used to find out what type of request one is dealing with (eg which request got passed through to the imgIDecoderObserver interface of an observer)
nsIStreamListener loadImageWithChannel (in nsIChannel aChannel)
 loadImageWithChannel allows data from an existing channel to be used as the image data for this content node.
void imageURIChanged (in AString aNewURI)
 ImageURIChanged is called when the appropriate attributes (eg 'src' for.
void onStartDecode (in imgIRequest aRequest)
 called as soon as the image begins getting decoded
void onStartContainer (in imgIRequest aRequest, in imgIContainer aContainer)
 called once the image has been inited and therefore has a width and height
void onStartFrame (in imgIRequest aRequest, in gfxIImageFrame aFrame)
 called when each frame is created
void onDataAvailable (in imgIRequest aRequest, in gfxIImageFrame aFrame,[const ] in nsIntRect aRect)
 called when some part of the frame has new data in it
void onStopFrame (in imgIRequest aRequest, in gfxIImageFrame aFrame)
 called when a frame is finished decoding
void onStopContainer (in imgIRequest aRequest, in imgIContainer aContainer)
 probably not needed.
void onStopDecode (in imgIRequest aRequest, in nsresult status, in wstring statusArg)
 called when the decoder is dying off
void frameChanged (in imgIContainer aContainer, in gfxIImageFrame aFrame, in nsIntRect aDirtyRect)

Public Attributes

const long UNKNOWN_REQUEST = -1
 Request types.
const long CURRENT_REQUEST = 0
const long PENDING_REQUEST = 1
attribute boolean loadingEnabled
 loadingEnabled is used to enable and disable loading in situations where loading images is unwanted.
readonly attribute short imageBlockingStatus
 Returns the image blocking status (.
readonly attribute nsIURI currentURI
 Gets the URI of the current request, if available.

Detailed Description

This interface represents a content node that loads images.

The interface exists to allow getting information on the images that the content node loads and to allow registration of observers for the image loads.

Implementors of this interface should handle all the mechanics of actually loading an image -- getting the URI, checking with content policies and the security manager to see whether loading the URI is allowed, performing the load, firing any DOM events as needed.

An implementation of this interface may support the concepts of a "current" image and a "pending" image. If it does, a request to change the currently loaded image will start a "pending" request which will become current only when the image is loaded. It is the responsibility of observers to check which request they are getting notifications for.

Observers added in mid-load will not get any notifications they missed. We should NOT freeze this interface without considering this issue. (It could be that the image status on imgIRequest is sufficient, when combined with the imageBlockingStatus information.)

XXXbz Do not freeze without removing imageURIChanged!

Definition at line 71 of file nsIImageLoadingContent.idl.


Member Function Documentation

Used to register an image decoder observer.

Typically, this will be a proxy for a frame that wants to paint the image. Notifications from ongoing image loads will be passed to all registered observers. Notifications for all request types, current and pending, will be passed through.

Parameters:
aObserverthe observer to register
Exceptions:
NS_ERROR_OUT_OF_MEMORY
void imgIContainerObserver::frameChanged ( in imgIContainer  aContainer,
in gfxIImageFrame  aFrame,
in nsIntRect  aDirtyRect 
) [inherited]

Accessor to get the image requests.

Parameters:
aRequestTypea value saying which request is wanted
Returns:
the imgIRequest object (may be null, even when no error is thrown)
Exceptions:
NS_ERROR_UNEXPECTEDif the request type requested is not known

Used to find out what type of request one is dealing with (eg which request got passed through to the imgIDecoderObserver interface of an observer)

Parameters:
aRequestthe request whose type we want to know
Returns:
an enum value saying what type this request is
Exceptions:
NS_ERROR_UNEXPECTEDif aRequest is not known

ImageURIChanged is called when the appropriate attributes (eg 'src' for.

tags) change. The string passed in is the new uri string.

loadImageWithChannel allows data from an existing channel to be used as the image data for this content node.

Parameters:
aChannelthe channel that will deliver the data
Returns:
a stream listener to pump the image data into
See also:
imgILoader::loadImageWithChannel
Exceptions:
NS_ERROR_NULL_POINTERif aChannel is null
void imgIDecoderObserver::onDataAvailable ( in imgIRequest  aRequest,
in gfxIImageFrame  aFrame,
[const ] in nsIntRect  aRect 
) [inherited]

called when some part of the frame has new data in it

void imgIDecoderObserver::onStartContainer ( in imgIRequest  aRequest,
in imgIContainer  aContainer 
) [inherited]

called once the image has been inited and therefore has a width and height

Here is the caller graph for this function:

called as soon as the image begins getting decoded

Here is the caller graph for this function:

void imgIDecoderObserver::onStartFrame ( in imgIRequest  aRequest,
in gfxIImageFrame  aFrame 
) [inherited]

called when each frame is created

void imgIDecoderObserver::onStopContainer ( in imgIRequest  aRequest,
in imgIContainer  aContainer 
) [inherited]

probably not needed.

called right before onStopDecode

Here is the caller graph for this function:

void imgIDecoderObserver::onStopDecode ( in imgIRequest  aRequest,
in nsresult  status,
in wstring  statusArg 
) [inherited]

called when the decoder is dying off

Here is the caller graph for this function:

void imgIDecoderObserver::onStopFrame ( in imgIRequest  aRequest,
in gfxIImageFrame  aFrame 
) [inherited]

called when a frame is finished decoding

Used to unregister an image decoder observer.

Parameters:
aObserverthe observer to unregister

Member Data Documentation

Definition at line 82 of file nsIImageLoadingContent.idl.

Gets the URI of the current request, if available.

Otherwise, returns the last URI that this content tried to load, or null if there haven't been any such attempts.

Definition at line 151 of file nsIImageLoadingContent.idl.

Returns the image blocking status (.

See also:
nsIContentPolicy). This will always be an nsIContentPolicy REJECT_* status for cases when the image was blocked. This status always refers to the CURRENT_REQUEST load.

Definition at line 98 of file nsIImageLoadingContent.idl.

loadingEnabled is used to enable and disable loading in situations where loading images is unwanted.

Note that enabling loading will not automatically trigger an image load.

Definition at line 90 of file nsIImageLoadingContent.idl.

Definition at line 83 of file nsIImageLoadingContent.idl.

Request types.

Image loading content nodes attempt to do atomic image changes when the image url is changed. This means that when the url changes the new image load will start, but the old image will remain the "current" request until the new image is fully loaded. At that point, the old "current" request will be discarded and the "pending" request will become "current".

Definition at line 81 of file nsIImageLoadingContent.idl.


The documentation for this interface was generated from the following file: