1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is mozilla.org code.
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1999
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
38
39 /*
40 Because imap protocol connections (which are channels) run through a cache,
41 it isn't always the case that when you want to run a url, you actually get
42 a connection back right away. Often times, the url goes into a queue until
43 a connection becomes available.
44
45 Unfortunately, if we want to be a truly pluggable protocol with necko, necko
46 requires the ability to get a channel back right away when it wants to run
47 a url. It doesn't let you wait until an imap connection becomes available.
48
49 So I've created the notion of a "mock channel". This mock channel is what
50 gets returned to necko (or other callers) when they ask the imap service
51 for a new channel for a url. The mock channel has "mock" implementations
52 of nsIChannel. Eventually, when we actually assign the url to a real
53 channel, we set the real channel on the mock channel. From that point forward,
54 the mock channel forwards channel calls directly to the real channel.
55
56 In short, this class is how I'm solving the problem where necko wants
57 a channel back as soon as they ask for when with the fact that it
58 may be a while until the url is loaded into a connection.
59 */
60
61 #include "nsISupports.idl"
62 #include "nsIChannel.idl"
63
64 interface nsIStreamListener;
65 interface nsIProgressEventSink;
66 interface nsIURI;
67 interface nsIImapProtocol;
68
69 [scriptable, uuid(e0178cd5-d37b-4bde-9ab8-752083536225)]
70
71 interface nsIImapMockChannel : nsIChannel
72 {
73 attribute nsIProgressEventSink progressEventSink;
74 void GetChannelListener(out nsIStreamListener aChannelListener);
75 void GetChannelContext(out nsISupports aChannelContext);
76 void Close();
77 void setImapProtocol(in nsIImapProtocol aProtocol);
78 [noscript] void setSecurityInfo(in nsISupports securityInfo);
79
80 void setURI(in nsIURI uri);
81 };