2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 04:12:37 -07:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2012-10-11 18:58:24 -07:00
|
|
|
interface imgIDecoderObserver;
|
2007-03-22 10:30:00 -07:00
|
|
|
interface imgIRequest;
|
|
|
|
|
|
|
|
interface nsIChannel;
|
|
|
|
interface nsILoadGroup;
|
2011-07-14 11:47:32 -07:00
|
|
|
interface nsIPrincipal;
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsIStreamListener;
|
|
|
|
interface nsIURI;
|
|
|
|
|
|
|
|
interface nsISimpleEnumerator;
|
2010-05-20 13:08:02 -07:00
|
|
|
interface nsIChannelPolicy;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsIRequest.idl" // for nsLoadFlags
|
|
|
|
|
|
|
|
/**
|
|
|
|
* imgILoader interface
|
|
|
|
*
|
|
|
|
* @author Stuart Parmenter <pavlov@netscape.com>
|
|
|
|
* @version 0.3
|
|
|
|
* @see imagelib2
|
|
|
|
*/
|
2012-10-03 13:17:40 -07:00
|
|
|
[scriptable, uuid(f5a7c016-8caf-460a-b1a1-3fe5534d5c9e)]
|
2007-03-22 10:30:00 -07:00
|
|
|
interface imgILoader : nsISupports
|
|
|
|
{
|
2011-07-14 11:47:34 -07:00
|
|
|
// Extra flags to pass to loadImage if you want a load to use CORS
|
|
|
|
// validation.
|
|
|
|
const unsigned long LOAD_CORS_ANONYMOUS = 1 << 16;
|
|
|
|
const unsigned long LOAD_CORS_USE_CREDENTIALS = 1 << 17;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/**
|
|
|
|
* Start the load and decode of an image.
|
|
|
|
* @param aURI the URI to load
|
|
|
|
* @param aInitialDocumentURI the URI that 'initiated' the load -- used for 3rd party cookie blocking
|
|
|
|
* @param aReferrerURI the 'referring' URI
|
2011-07-14 11:47:32 -07:00
|
|
|
* @param aLoadingPrincipal the principal of the loading document
|
2007-03-22 10:30:00 -07:00
|
|
|
* @param aLoadGroup Loadgroup to put the image load into
|
2009-08-12 07:23:38 -07:00
|
|
|
* @param aObserver the observer (may be null)
|
2007-03-22 10:30:00 -07:00
|
|
|
* @param aCX some random data
|
|
|
|
* @param aLoadFlags Load flags for the request
|
|
|
|
* @param aCacheKey cache key to use for a load if the original
|
|
|
|
* image came from a request that had post data
|
|
|
|
* @param aRequest A newly created, unused imgIRequest object or NULL for one to
|
|
|
|
be created for you.
|
|
|
|
|
|
|
|
|
|
|
|
* libpr0n does NOT keep a strong ref to the observer; this prevents
|
|
|
|
* reference cycles. This means that callers of loadImage should
|
|
|
|
* make sure to Cancel() the resulting request before the observer
|
|
|
|
* goes away.
|
|
|
|
*/
|
2010-07-28 14:52:50 -07:00
|
|
|
imgIRequest loadImage(in nsIURI aURI,
|
2007-03-22 10:30:00 -07:00
|
|
|
in nsIURI aInitialDocumentURL,
|
|
|
|
in nsIURI aReferrerURI,
|
2011-07-14 11:47:32 -07:00
|
|
|
in nsIPrincipal aLoadingPrincipal,
|
2007-03-22 10:30:00 -07:00
|
|
|
in nsILoadGroup aLoadGroup,
|
2012-10-11 18:58:24 -07:00
|
|
|
in imgIDecoderObserver aObserver,
|
2007-03-22 10:30:00 -07:00
|
|
|
in nsISupports aCX,
|
|
|
|
in nsLoadFlags aLoadFlags,
|
|
|
|
in nsISupports cacheKey,
|
2010-05-20 13:08:02 -07:00
|
|
|
in imgIRequest aRequest,
|
|
|
|
in nsIChannelPolicy channelPolicy);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Start the load and decode of an image.
|
|
|
|
* @param aChannel the channel to load the image from. This must
|
|
|
|
* already be opened before ths method is called, and there
|
|
|
|
* must have been no OnDataAvailable calls for it yet.
|
2009-08-12 07:23:38 -07:00
|
|
|
* @param aObserver the observer (may be null)
|
2007-03-22 10:30:00 -07:00
|
|
|
* @param cx some random data
|
|
|
|
* @param aListener [out]
|
2010-07-28 14:52:50 -07:00
|
|
|
* A listener that you must send the channel's notifications and data to.
|
|
|
|
* Can be null, in which case imagelib has found a cached image and is
|
|
|
|
* not interested in the data. @aChannel will be canceled for you in
|
|
|
|
* this case.
|
2007-03-22 10:30:00 -07:00
|
|
|
*
|
|
|
|
* libpr0n does NOT keep a strong ref to the observer; this prevents
|
|
|
|
* reference cycles. This means that callers of loadImageWithChannel should
|
|
|
|
* make sure to Cancel() the resulting request before the observer goes away.
|
|
|
|
*/
|
2010-07-28 14:52:50 -07:00
|
|
|
imgIRequest loadImageWithChannel(in nsIChannel aChannel,
|
2012-10-11 18:58:24 -07:00
|
|
|
in imgIDecoderObserver aObserver,
|
2007-08-22 03:59:40 -07:00
|
|
|
in nsISupports cx,
|
|
|
|
out nsIStreamListener aListener);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|