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]
pub fn coerce<T: imgIRequestCoerce>(&self) -> &T
[src]
Cast this imgIRequest
to one of its base interfaces.
impl imgIRequest
[src]
pub const STATUS_NONE: i64
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.
*/
pub const STATUS_SIZE_AVAILABLE: i64
STATUS_SIZE_AVAILABLE: i64 = 1
pub const STATUS_LOAD_COMPLETE: i64
STATUS_LOAD_COMPLETE: i64 = 2
pub const STATUS_ERROR: i64
STATUS_ERROR: i64 = 4
pub const STATUS_FRAME_COMPLETE: i64
STATUS_FRAME_COMPLETE: i64 = 8
pub const STATUS_DECODE_COMPLETE: i64
STATUS_DECODE_COMPLETE: i64 = 16
pub const STATUS_IS_ANIMATED: i64
STATUS_IS_ANIMATED: i64 = 32
pub const STATUS_HAS_TRANSPARENCY: i64
STATUS_HAS_TRANSPARENCY: i64 = 64
pub const CORS_NONE: i64
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.
*/
pub const CORS_ANONYMOUS: i64
CORS_ANONYMOUS: i64 = 2
pub const CORS_USE_CREDENTIALS: i64
CORS_USE_CREDENTIALS: i64 = 3
pub const CATEGORY_FRAME_INIT: i64
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.
*/
pub const CATEGORY_SIZE_QUERY: i64
CATEGORY_SIZE_QUERY: i64 = 2
pub const CATEGORY_DISPLAY: i64
CATEGORY_DISPLAY: i64 = 4
pub unsafe fn GetImage(&self, aImage: *mut *const imgIContainer) -> nsresult
[src]
/**
* the image container...
* @return the image object associated with the request.
* @attention NEED DOCS
*/
readonly attribute imgIContainer image;
pub unsafe fn GetImageStatus(&self, aImageStatus: *mut uint32_t) -> nsresult
[src]
/**
* Status flags of the STATUS_* variety.
*/
readonly attribute unsigned long imageStatus;
pub unsafe fn GetImageErrorCode(
&self,
aImageErrorCode: *mut nsresult
) -> nsresult
[src]
&self,
aImageErrorCode: *mut nsresult
) -> nsresult
[noscript] readonly attribute nsresult imageErrorCode;
pub unsafe fn GetURI(&self, aURI: *mut *const nsIURI) -> nsresult
[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;
pub unsafe fn GetFinalURI(&self, aFinalURI: *mut *const nsIURI) -> nsresult
[src]
/**
* The URI of the resource we ended up loading after all redirects, etc.
*/
readonly attribute nsIURI finalURI;
pub unsafe fn GetNotificationObserver(
&self,
aNotificationObserver: *mut *const imgINotificationObserver
) -> nsresult
[src]
&self,
aNotificationObserver: *mut *const imgINotificationObserver
) -> nsresult
readonly attribute imgINotificationObserver notificationObserver;
pub unsafe fn GetMimeType(&self, aMimeType: *mut *const c_char) -> nsresult
[src]
readonly attribute string mimeType;
pub unsafe fn Clone(
&self,
aObserver: *const imgINotificationObserver,
_retval: *mut *const imgIRequest
) -> nsresult
[src]
&self,
aObserver: *const imgINotificationObserver,
_retval: *mut *const imgIRequest
) -> nsresult
/**
* 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);
pub unsafe fn GetImagePrincipal(
&self,
aImagePrincipal: *mut *const nsIPrincipal
) -> nsresult
[src]
&self,
aImagePrincipal: *mut *const nsIPrincipal
) -> nsresult
/**
* The principal gotten from the channel the image was loaded from.
*/
readonly attribute nsIPrincipal imagePrincipal;
pub unsafe fn GetMultipart(&self, aMultipart: *mut bool) -> nsresult
[src]
/**
* Whether the request is multipart (ie, multipart/x-mixed-replace)
*/
readonly attribute bool multipart;
pub unsafe fn GetCORSMode(&self, aCORSMode: *mut int32_t) -> nsresult
[src]
/**
* The CORS mode that this image was loaded with.
*/
readonly attribute long CORSMode;
pub unsafe fn CancelAndForgetObserver(&self, aStatus: nsresult) -> nsresult
[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);
pub unsafe fn StartDecoding(&self, aFlags: uint32_t) -> nsresult
[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);
pub unsafe fn StartDecodingWithResult(&self, aFlags: uint32_t) -> bool
[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);
pub unsafe fn LockImage(&self) -> nsresult
[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 ();
pub unsafe fn UnlockImage(&self) -> nsresult
[src]
/**
* Unlocks an image.
*
* @see imgIContainer::unlockImage for documentation of the underlying call.
*/
void unlockImage ();
pub unsafe fn RequestDiscard(&self) -> nsresult
[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 ();
pub unsafe fn GetStaticRequest(
&self,
_retval: *mut *const imgIRequest
) -> nsresult
[src]
&self,
_retval: *mut *const imgIRequest
) -> nsresult
/**
* 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 ();
pub unsafe fn IncrementAnimationConsumers(&self) -> nsresult
[src]
/**
* Requests that the image animate (if it has an animation).
*
* @see Image::IncrementAnimationConsumers for documentation of the
* underlying call.
*/
void incrementAnimationConsumers ();
pub unsafe fn DecrementAnimationConsumers(&self) -> nsresult
[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 ();
pub unsafe fn BoostPriority(&self, aCategory: uint32_t) -> nsresult
[src]
void boostPriority (in uint32_t aCategory);
Methods from Deref<Target = nsIRequest>
pub fn coerce<T: nsIRequestCoerce>(&self) -> &T
[src]
Cast this nsIRequest
to one of its base interfaces.
pub const LOAD_REQUESTMASK: i64
pub const LOAD_NORMAL: i64
pub const LOAD_BACKGROUND: i64
pub const LOAD_HTML_OBJECT_DATA: i64
pub const LOAD_DOCUMENT_NEEDS_COOKIE: i64
pub const INHIBIT_CACHING: i64
pub const INHIBIT_PERSISTENT_CACHING: i64
pub const LOAD_BYPASS_CACHE: i64
pub const LOAD_FROM_CACHE: i64
pub const VALIDATE_ALWAYS: i64
pub const VALIDATE_NEVER: i64
pub const VALIDATE_ONCE_PER_SESSION: i64
pub const LOAD_ANONYMOUS: i64
pub const LOAD_FRESH_CONNECTION: i64
pub unsafe fn GetName(&self, aName: &mut nsACString) -> nsresult
[src]
/**
* The name of the request. Often this is the URI of the request.
*/
readonly attribute AUTF8String name;
pub unsafe fn IsPending(&self, _retval: *mut bool) -> nsresult
[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 ();
pub unsafe fn GetStatus(&self, aStatus: *mut nsresult) -> nsresult
[src]
/**
* The error status associated with the request.
*/
readonly attribute nsresult status;
pub unsafe fn Cancel(&self, aStatus: nsresult) -> nsresult
[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);
pub unsafe fn Suspend(&self) -> nsresult
[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 ();
pub unsafe fn Resume(&self) -> nsresult
[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 ();
pub unsafe fn GetLoadGroup(
&self,
aLoadGroup: *mut *const nsILoadGroup
) -> nsresult
[src]
&self,
aLoadGroup: *mut *const nsILoadGroup
) -> nsresult
/**
* 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;
pub unsafe fn SetLoadGroup(&self, aLoadGroup: *const nsILoadGroup) -> nsresult
[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;
pub unsafe fn GetLoadFlags(&self, aLoadFlags: *mut nsLoadFlags) -> nsresult
[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;
pub unsafe fn SetLoadFlags(&self, aLoadFlags: nsLoadFlags) -> nsresult
[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]
const IID: nsIID
IID: nsIID = nsID(3674903644, 14467, 16970, [152, 208, 46, 224, 82, 59, 2, 85])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[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]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for imgIRequest
[src]
type Target = nsIRequest
The resulting type after dereferencing.
fn deref(&self) -> &nsIRequest
[src]
Dereferences the value.