gecko-dev/image/public/imgILoader.idl

88 строки
3.4 KiB
Plaintext
Исходник Обычный вид История

/* -*- 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/. */
#include "nsISupports.idl"
interface imgINotificationObserver;
interface imgIRequest;
2001-02-25 02:45:30 +03:00
interface nsIChannel;
interface nsILoadGroup;
interface nsIPrincipal;
2001-02-21 01:43:56 +03:00
interface nsIStreamListener;
interface nsIURI;
2001-02-25 02:45:30 +03:00
interface nsISimpleEnumerator;
2001-07-17 05:14:40 +04:00
#include "nsIRequest.idl" // for nsLoadFlags
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>
* @version 0.3
2001-02-21 01:43:56 +03:00
* @see imagelib2
*/
[scriptable, builtinclass, uuid(046d5fa6-ac59-489d-b51e-0ffe57e8df59)]
2001-02-21 02:45:51 +03:00
interface imgILoader : nsISupports
{
// 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
* @param aInitialDocumentURI the URI that 'initiated' the load -- used for 3rd party cookie blocking
* @param aReferrerURI the 'referring' URI
* @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
* @param aObserver the observer (may be null)
2001-07-17 05:14:40 +04: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
* 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.
2001-02-21 01:43:56 +03:00
*/
imgIRequest loadImageXPCOM(in nsIURI aURI,
in nsIURI aInitialDocumentURL,
in nsIURI aReferrerURI,
in nsIPrincipal aLoadingPrincipal,
in nsILoadGroup aLoadGroup,
in imgINotificationObserver aObserver,
in nsISupports aCX,
in nsLoadFlags aLoadFlags,
in nsISupports cacheKey);
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
* already be opened before ths method is called, and there
* must have been no OnDataAvailable calls for it yet.
* @param aObserver the observer (may be null)
2001-02-21 01:43:56 +03:00
* @param cx some random data
* @param aListener [out]
* 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.
*
* 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.
2001-02-21 01:43:56 +03:00
*/
imgIRequest loadImageWithChannelXPCOM(in nsIChannel aChannel,
in imgINotificationObserver aObserver,
in nsISupports cx,
out nsIStreamListener aListener);
};