netwerk/streamconv/public/nsIDirIndexListener.idl

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:edd853adc01b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 #include "nsIStreamListener.idl"
7
8 interface nsIDirIndex;
9
10 /**
11 * This interface is used to receive contents of directory index listings
12 * from a protocol. They can then be transformed into an output format
13 * (such as rdf, html, etc)
14 */
15 [scriptable, uuid(fae4e9a8-1dd1-11b2-b53c-8f3aa1bbf8f5)]
16 interface nsIDirIndexListener : nsISupports {
17 /**
18 * Called for each directory entry
19 *
20 * @param request - the request
21 * @param ctxt - opaque parameter
22 * @param index - new index to add
23 */
24 void onIndexAvailable(in nsIRequest aRequest,
25 in nsISupports aCtxt,
26 in nsIDirIndex aIndex);
27
28 /**
29 * Called for each information line
30 *
31 * @param request - the request
32 * @param ctxt - opaque parameter
33 * @param info - new info to add
34 */
35 void onInformationAvailable(in nsIRequest aRequest,
36 in nsISupports aCtxt,
37 in AString aInfo);
38
39 };
40
41 %{C++
42 #define NS_IDIRINDEXLISTENER_KEY "@mozilla.org/dirIndexListener;1"
43 %}
44
45 /**
46 * A parser for application/http-index-format
47 */
48 [scriptable, uuid(38e3066c-1dd2-11b2-9b59-8be515c1ee3f)]
49 interface nsIDirIndexParser : nsIStreamListener {
50 /**
51 * The interface to use as a callback for new entries
52 */
53 attribute nsIDirIndexListener listener;
54
55 /**
56 * The comment given, if any
57 * This result is only valid _after_ OnStopRequest has occurred,
58 * because it can occur anywhere in the datastream
59 */
60 readonly attribute string comment;
61
62 /**
63 * The encoding to use
64 */
65 attribute string encoding;
66 };
67
68 %{C++
69 #define NS_DIRINDEXPARSER_CID \
70 { /* a0d6ad32-1dd1-11b2-aa55-a40187b54036 */ \
71 0xa0d6ad32, \
72 0x1dd1, \
73 0x11b2, \
74 { 0xaa, 0x55, 0xa4, 0x01, 0x87, 0xb5, 0x40, 0x36 } \
75 }
76
77 #define NS_DIRINDEXPARSER_CONTRACTID "@mozilla.org/dirIndexParser;1"
78
79 %}

mercurial