image/public/imgILoader.idl

changeset 2
7e26c7da4463
equal deleted inserted replaced
-1:000000000000 0:8762aa53338a
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 #include "nsISupports.idl"
8
9 interface imgINotificationObserver;
10 interface imgIRequest;
11
12 interface nsIChannel;
13 interface nsILoadGroup;
14 interface nsIPrincipal;
15 interface nsIStreamListener;
16 interface nsIURI;
17
18 interface nsISimpleEnumerator;
19 interface nsIChannelPolicy;
20
21 #include "nsIRequest.idl" // for nsLoadFlags
22
23 /**
24 * imgILoader interface
25 *
26 * @author Stuart Parmenter <pavlov@netscape.com>
27 * @version 0.3
28 * @see imagelib2
29 */
30 [scriptable, builtinclass, uuid(c8126129-8dac-43cd-b1ba-3896fba2dd01)]
31 interface imgILoader : nsISupports
32 {
33 // Extra flags to pass to loadImage if you want a load to use CORS
34 // validation.
35 const unsigned long LOAD_CORS_ANONYMOUS = 1 << 16;
36 const unsigned long LOAD_CORS_USE_CREDENTIALS = 1 << 17;
37
38 /**
39 * Start the load and decode of an image.
40 * @param aURI the URI to load
41 * @param aFirstPartyIsolationURI the urlbar URI that 'initiated' the load -- used for 3rd party blocking
42 * @param aReferrerURI the 'referring' URI
43 * @param aLoadingPrincipal the principal of the loading document
44 * @param aLoadGroup Loadgroup to put the image load into
45 * @param aObserver the observer (may be null)
46 * @param aCX some random data
47 * @param aLoadFlags Load flags for the request
48 * @param aCacheKey cache key to use for a load if the original
49 * image came from a request that had post data
50
51
52 * libpr0n does NOT keep a strong ref to the observer; this prevents
53 * reference cycles. This means that callers of loadImage should
54 * make sure to Cancel() the resulting request before the observer
55 * goes away.
56 */
57 imgIRequest loadImageXPCOM(in nsIURI aURI,
58 in nsIURI aFirstPartyIsolationURI,
59 in nsIURI aReferrerURI,
60 in nsIPrincipal aLoadingPrincipal,
61 in nsILoadGroup aLoadGroup,
62 in imgINotificationObserver aObserver,
63 in nsISupports aCX,
64 in nsLoadFlags aLoadFlags,
65 in nsISupports cacheKey,
66 in nsIChannelPolicy channelPolicy);
67
68 /**
69 * Start the load and decode of an image.
70 * @param aChannel the channel to load the image from. This must
71 * already be opened before ths method is called, and there
72 * must have been no OnDataAvailable calls for it yet.
73 * @param aObserver the observer (may be null)
74 * @param cx some random data
75 * @param aListener [out]
76 * A listener that you must send the channel's notifications and data to.
77 * Can be null, in which case imagelib has found a cached image and is
78 * not interested in the data. @aChannel will be canceled for you in
79 * this case.
80 *
81 * libpr0n does NOT keep a strong ref to the observer; this prevents
82 * reference cycles. This means that callers of loadImageWithChannel should
83 * make sure to Cancel() the resulting request before the observer goes away.
84 */
85 imgIRequest loadImageWithChannelXPCOM(in nsIChannel aChannel,
86 in imgINotificationObserver aObserver,
87 in nsISupports cx,
88 out nsIStreamListener aListener);
89 };

mercurial