Struct xpcom::interfaces::imgIRequest [] [src]

#[repr(C)]
pub struct imgIRequest { /* fields omitted */ }

interface imgIRequest : nsIRequest

/**
 * imgIRequest interface
 *
 * @author Stuart Parmenter <stuart@mozilla.com>
 * @version 0.1
 * @see imagelib2
 */

Methods

impl imgIRequest
[src]

[src]

Cast this imgIRequest to one of its base interfaces.

impl imgIRequest
[src]

STATUS_NONE: i64 = 0
/**
   * Bits set in the return value from imageStatus
   * @name statusflags
   *
   * Meanings:
   *
   * STATUS_NONE: Nothing to report.
   *
   * STATUS_SIZE_AVAILABLE: We received enough image data
   * from the network or filesystem that we know the width
   * and height of the image, and have thus called SetSize()
   * on the container.
   *
   * STATUS_LOAD_COMPLETE: The data has been fully loaded
   * to memory, but not necessarily fully decoded.
   *
   * STATUS_ERROR: An error occurred loading the image.
   *
   * STATUS_FRAME_COMPLETE: The first frame has been
   * completely decoded.
   *
   * STATUS_DECODE_COMPLETE: The whole image has been decoded.
   *
   * STATUS_IS_ANIMATED: The image is animated.
   *
   * STATUS_HAS_TRANSPARENCY: The image is partially or completely transparent.
   */

STATUS_SIZE_AVAILABLE: i64 = 1

STATUS_LOAD_COMPLETE: i64 = 2

STATUS_ERROR: i64 = 4

STATUS_FRAME_COMPLETE: i64 = 8

STATUS_DECODE_COMPLETE: i64 = 16

STATUS_IS_ANIMATED: i64 = 32

STATUS_HAS_TRANSPARENCY: i64 = 64

CORS_NONE: i64 = 1
/**
   * CORS modes images can be loaded with.
   *
   * By default, all images are loaded with CORS_NONE and cannot be used
   * cross-origin in context like WebGL.
   *
   * If an HTML img element has the crossorigin attribute set, the imgIRequest
   * will be validated for cross-origin usage with CORS, and, if successful,
   * will have its CORS mode set to the relevant type.
   */

CORS_ANONYMOUS: i64 = 2

CORS_USE_CREDENTIALS: i64 = 3

CATEGORY_FRAME_INIT: i64 = 1
/**
   * Request loading priority boost to requested category, each category
   * of request increases priority only one time..
   *
   * CATEGORY_FRAME_INIT: increase priority when the imgRequest is associated
   * with an nsImageFrame.
   *
   * CATEGORY_SIZE_QUERY: increase priority when size decoding is necessary to
   * determine the layout size of the associated nsImageFrame.
   *
   * CATEGORY_DISPLAY: increase priority when the image is about to be displayed
   * in the viewport.
   */

CATEGORY_SIZE_QUERY: i64 = 2

CATEGORY_DISPLAY: i64 = 4

[src]

/**
   * the image container...
   * @return the image object associated with the request.
   * @attention NEED DOCS
   */

readonly attribute imgIContainer image;

[src]

/**
   * Status flags of the STATUS_* variety.
   */

readonly attribute unsigned long imageStatus;

[src]

[noscript] readonly attribute nsresult imageErrorCode;

[src]

/**
   * The URI the image load was started with.  Note that this might not be the
   * actual URI for the image (e.g. if HTTP redirects happened during the
   * load).
   */

readonly attribute nsIURI URI;

[src]

/**
   * The URI of the resource we ended up loading after all redirects, etc.
   */

readonly attribute nsIURI finalURI;

[src]

readonly attribute imgINotificationObserver notificationObserver;

[src]

readonly attribute string mimeType;

[src]

/**
   * Clone this request; the returned request will have aObserver as the
   * observer.  aObserver will be notified synchronously (before the clone()
   * call returns) with all the notifications that have already been dispatched
   * for this image load.
   */

imgIRequest clone (in imgINotificationObserver aObserver);

[src]

/**
   * The principal gotten from the channel the image was loaded from.
   */

readonly attribute nsIPrincipal imagePrincipal;

[src]

/**
   * Whether the request is multipart (ie, multipart/x-mixed-replace)
   */

readonly attribute bool multipart;

[src]

/**
   * The CORS mode that this image was loaded with.
   */

readonly attribute long CORSMode;

[src]

/**
   * Cancels this request as in nsIRequest::Cancel(); further, also nulls out
   * decoderObserver so it gets no further notifications from us.
   *
   * NOTE: You should not use this in any new code; instead, use cancel(). Note
   * that cancel() is asynchronous, which means that some time after you call
   * it, the listener/observer will get an OnStopRequest(). This means that, if
   * you're the observer, you can't call cancel() from your destructor.
   */

void cancelAndForgetObserver (in nsresult aStatus);

[src]

/**
   * Requests a synchronous decode for the image.
   *
   * imgIContainer has a startDecoding() method, but callers may want to request
   * a decode before the container has necessarily been instantiated. Calling
   * startDecoding() on the imgIRequest simply forwards along the request if the
   * container already exists, or calls it once the container becomes available
   * if it does not yet exist.
   */

void startDecoding (in uint32_t aFlags);

[src]

/**
   * Exactly like startDecoding above except returns whether the current frame
   * of the image is complete or not.
   */

[noscript,notxpcom] boolean startDecodingWithResult (in uint32_t aFlags);

[src]

/**
   * Locks an image. If the image does not exist yet, locks it once it becomes
   * available. The lock persists for the lifetime of the imgIRequest (until
   * unlockImage is called) even if the underlying image changes.
   *
   * If you don't call unlockImage() by the time this imgIRequest goes away, it
   * will be called for you automatically.
   *
   * @see imgIContainer::lockImage for documentation of the underlying call.
   */

void lockImage ();

[src]

/**
   * Unlocks an image.
   *
   * @see imgIContainer::unlockImage for documentation of the underlying call.
   */

void unlockImage ();

[src]

/**
   * If this image is unlocked, discard the image's decoded data.  If the image
   * is locked or is already discarded, do nothing.
   */

void requestDiscard ();

[src]

/**
   * If this request is for an animated image, the method creates a new
   * request which contains the current frame of the image.
   * Otherwise returns the same request.
   */

imgIRequest getStaticRequest ();

[src]

/**
   * Requests that the image animate (if it has an animation).
   *
   * @see Image::IncrementAnimationConsumers for documentation of the
   * underlying call.
   */

void incrementAnimationConsumers ();

[src]

/**
   * Tell the image it can forget about a request that the image animate.
   *
   * @see Image::DecrementAnimationConsumers for documentation of the
   * underlying call.
   */

void decrementAnimationConsumers ();

[src]

void boostPriority (in uint32_t aCategory);

Methods from Deref<Target = nsIRequest>

[src]

Cast this nsIRequest to one of its base interfaces.

[src]

/**
     * The name of the request.  Often this is the URI of the request.
     */

readonly attribute AUTF8String name;

[src]

/**
     * Indicates whether the request is pending. nsIRequest::isPending is
     * true when there is an outstanding asynchronous event that will make
     * the request no longer be pending.  Requests do not necessarily start
     * out pending; in some cases, requests have to be explicitly initiated
     * (e.g. nsIChannel implementations are only pending once asyncOpen
     * returns successfully).
     *
     * Requests can become pending multiple times during their lifetime.
     *
     * @return TRUE if the request has yet to reach completion.
     * @return FALSE if the request has reached completion (e.g., after
     *   OnStopRequest has fired).
     * @note Suspended requests are still considered pending.
     */

boolean isPending ();

[src]

/**
     * The error status associated with the request.
     */

readonly attribute nsresult status;

[src]

/**
     * Cancels the current request.  This will close any open input or
     * output streams and terminate any async requests.  Users should
     * normally pass NS_BINDING_ABORTED, although other errors may also
     * be passed.  The error passed in will become the value of the
     * status attribute.
     *
     * Implementations must not send any notifications (e.g. via
     * nsIRequestObserver) synchronously from this function. Similarly,
     * removal from the load group (if any) must also happen asynchronously.
     *
     * Requests that use nsIStreamListener must not call onDataAvailable
     * anymore after cancel has been called.
     *
     * @param aStatus the reason for canceling this request.
     *
     * NOTE: most nsIRequest implementations expect aStatus to be a
     * failure code; however, some implementations may allow aStatus to
     * be a success code such as NS_OK.  In general, aStatus should be
     * a failure code.
     */

void cancel (in nsresult aStatus);

[src]

/**
     * Suspends the current request.  This may have the effect of closing
     * any underlying transport (in order to free up resources), although
     * any open streams remain logically opened and will continue delivering
     * data when the transport is resumed.
     *
     * Calling cancel() on a suspended request must not send any
     * notifications (such as onstopRequest) until the request is resumed.
     *
     * NOTE: some implementations are unable to immediately suspend, and
     * may continue to deliver events already posted to an event queue. In
     * general, callers should be capable of handling events even after
     * suspending a request.
     */

void suspend ();

[src]

/**
     * Resumes the current request.  This may have the effect of re-opening
     * any underlying transport and will resume the delivery of data to
     * any open streams.
     */

void resume ();

[src]

/**
     * The load group of this request.  While pending, the request is a
     * member of the load group.  It is the responsibility of the request
     * to implement this policy.
     */

attribute nsILoadGroup loadGroup;

[src]

/**
     * The load group of this request.  While pending, the request is a
     * member of the load group.  It is the responsibility of the request
     * to implement this policy.
     */

attribute nsILoadGroup loadGroup;

[src]

/**
     * The load flags of this request.  Bits 0-15 are reserved.
     *
     * When added to a load group, this request's load flags are merged with
     * the load flags of the load group.
     */

attribute nsLoadFlags loadFlags;

[src]

/**
     * The load flags of this request.  Bits 0-15 are reserved.
     *
     * When added to a load group, this request's load flags are merged with
     * the load flags of the load group.
     */

attribute nsLoadFlags loadFlags;

Trait Implementations

impl XpCom for imgIRequest
[src]

IID: nsIID = nsID(3674903644, 14467, 16970, [152, 208, 46, 224, 82, 59, 2, 85])

[src]

Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more

impl RefCounted for imgIRequest
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for imgIRequest
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.