2001-01-23 01:01:03 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 15:12:37 +04: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/. */
|
2001-01-23 01:01:03 +03:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2012-10-12 20:11:22 +04:00
|
|
|
interface imgINotificationObserver;
|
2001-02-21 02:27:48 +03:00
|
|
|
interface imgIRequest;
|
2001-02-25 02:45:30 +03:00
|
|
|
|
|
|
|
interface nsIChannel;
|
|
|
|
interface nsILoadGroup;
|
2011-07-14 22:47:32 +04:00
|
|
|
interface nsIPrincipal;
|
2001-02-21 01:43:56 +03:00
|
|
|
interface nsIStreamListener;
|
2001-01-23 01:01:03 +03:00
|
|
|
interface nsIURI;
|
2019-07-25 11:23:32 +03:00
|
|
|
interface nsIReferrerInfo;
|
2001-02-25 02:45:30 +03:00
|
|
|
|
|
|
|
interface nsISimpleEnumerator;
|
2001-01-23 01:01:03 +03:00
|
|
|
|
2020-04-11 00:14:49 +03:00
|
|
|
webidl Document;
|
|
|
|
|
2001-07-17 05:14:40 +04:00
|
|
|
#include "nsIRequest.idl" // for nsLoadFlags
|
2014-08-20 01:49:38 +04:00
|
|
|
#include "nsIContentPolicy.idl" // for nsContentPolicyType
|
2001-07-17 05:14:40 +04:00
|
|
|
|
2001-02-21 01:43:56 +03:00
|
|
|
/**
|
2001-02-21 02:45:51 +03:00
|
|
|
* imgILoader interface
|
2001-02-21 01:43:56 +03:00
|
|
|
*
|
|
|
|
* @author Stuart Parmenter <pavlov@netscape.com>
|
2002-03-23 16:21:33 +03:00
|
|
|
* @version 0.3
|
2001-02-21 01:43:56 +03:00
|
|
|
* @see imagelib2
|
|
|
|
*/
|
2014-11-18 16:46:53 +03:00
|
|
|
[scriptable, builtinclass, uuid(e61377d2-910e-4c65-a64b-428d150e1fd1)]
|
2001-02-21 02:45:51 +03:00
|
|
|
interface imgILoader : nsISupports
|
2001-01-23 01:01:03 +03:00
|
|
|
{
|
2011-07-14 22:47:34 +04: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;
|
|
|
|
|
2001-02-21 01:43:56 +03:00
|
|
|
/**
|
|
|
|
* Start the load and decode of an image.
|
2001-07-17 05:14:40 +04:00
|
|
|
* @param aURI the URI to load
|
2014-12-06 02:12:08 +03:00
|
|
|
* @param aInitialDocumentURI the URI that 'initiated' the load -- used for
|
|
|
|
* 3rd party cookie blocking
|
2019-07-25 11:23:32 +03:00
|
|
|
* @param aReferrerInfo the referrer info to compute sending referrer.
|
2011-07-14 22:47:32 +04:00
|
|
|
* @param aLoadingPrincipal the principal of the loading document
|
2001-07-17 05:14:40 +04:00
|
|
|
* @param aLoadGroup Loadgroup to put the image load into
|
2009-08-12 18:23:38 +04:00
|
|
|
* @param aObserver the observer (may be null)
|
2020-04-11 00:14:49 +03:00
|
|
|
* @param aLoadingDocument loading document
|
2001-07-17 05:14:40 +04:00
|
|
|
* @param aLoadFlags Load flags for the request
|
2001-09-29 21:50:15 +04:00
|
|
|
* @param aCacheKey cache key to use for a load if the original
|
|
|
|
* image came from a request that had post data
|
2014-08-20 01:49:38 +04:00
|
|
|
* @param aContentPolicyType [optional] the nsContentPolicyType to
|
|
|
|
* use for this load. Defaults to
|
|
|
|
* nsIContentPolicy::TYPE_IMAGE
|
2003-03-17 19:09:02 +03:00
|
|
|
|
|
|
|
|
2014-11-14 20:59:00 +03:00
|
|
|
* ImageLib does NOT keep a strong ref to the observer; this prevents
|
2003-03-17 19:09:02 +03:00
|
|
|
* reference cycles. This means that callers of loadImage should
|
|
|
|
* make sure to Cancel() the resulting request before the observer
|
|
|
|
* goes away.
|
2001-02-21 01:43:56 +03:00
|
|
|
*/
|
2012-10-12 16:43:01 +04:00
|
|
|
imgIRequest loadImageXPCOM(in nsIURI aURI,
|
|
|
|
in nsIURI aInitialDocumentURL,
|
2019-07-25 11:23:32 +03:00
|
|
|
in nsIReferrerInfo aReferrerInfo,
|
2012-10-12 16:43:01 +04:00
|
|
|
in nsIPrincipal aLoadingPrincipal,
|
|
|
|
in nsILoadGroup aLoadGroup,
|
|
|
|
in imgINotificationObserver aObserver,
|
2020-04-11 00:14:49 +03:00
|
|
|
in Document aLoadingDocument,
|
2012-10-12 16:43:01 +04:00
|
|
|
in nsLoadFlags aLoadFlags,
|
2014-08-20 01:49:38 +04:00
|
|
|
in nsISupports cacheKey,
|
|
|
|
[optional]
|
|
|
|
in nsContentPolicyType aContentPolicyType);
|
2001-02-21 01:43:56 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Start the load and decode of an image.
|
2006-07-18 23:26:04 +04:00
|
|
|
* @param aChannel the channel to load the image from. This must
|
2019-09-12 12:00:52 +03:00
|
|
|
* already be opened before this method is called, and there
|
2014-08-20 01:49:38 +04:00
|
|
|
* must have been no OnDataAvailable calls for it yet.
|
2009-08-12 18:23:38 +04:00
|
|
|
* @param aObserver the observer (may be null)
|
2020-04-11 00:14:49 +03:00
|
|
|
* @param aLoadingDocument loading document
|
2005-10-12 22:42:02 +04:00
|
|
|
* @param aListener [out]
|
2014-12-06 02:12:08 +03: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.
|
2003-03-17 19:09:02 +03:00
|
|
|
*
|
2014-11-14 20:59:00 +03:00
|
|
|
* ImageLib does NOT keep a strong ref to the observer; this prevents
|
2003-03-17 19:09:02 +03:00
|
|
|
* reference cycles. This means that callers of loadImageWithChannel should
|
|
|
|
* make sure to Cancel() the resulting request before the observer goes away.
|
2001-02-21 01:43:56 +03:00
|
|
|
*/
|
2012-10-12 16:43:01 +04:00
|
|
|
imgIRequest loadImageWithChannelXPCOM(in nsIChannel aChannel,
|
|
|
|
in imgINotificationObserver aObserver,
|
2020-04-11 00:14:49 +03:00
|
|
|
in Document aLoadingDocument,
|
2012-10-12 16:43:01 +04:00
|
|
|
out nsIStreamListener aListener);
|
2001-01-23 01:01:03 +03:00
|
|
|
};
|