michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsIStreamListener.idl" michael@0: michael@0: interface nsIDirIndex; michael@0: michael@0: /** michael@0: * This interface is used to receive contents of directory index listings michael@0: * from a protocol. They can then be transformed into an output format michael@0: * (such as rdf, html, etc) michael@0: */ michael@0: [scriptable, uuid(fae4e9a8-1dd1-11b2-b53c-8f3aa1bbf8f5)] michael@0: interface nsIDirIndexListener : nsISupports { michael@0: /** michael@0: * Called for each directory entry michael@0: * michael@0: * @param request - the request michael@0: * @param ctxt - opaque parameter michael@0: * @param index - new index to add michael@0: */ michael@0: void onIndexAvailable(in nsIRequest aRequest, michael@0: in nsISupports aCtxt, michael@0: in nsIDirIndex aIndex); michael@0: michael@0: /** michael@0: * Called for each information line michael@0: * michael@0: * @param request - the request michael@0: * @param ctxt - opaque parameter michael@0: * @param info - new info to add michael@0: */ michael@0: void onInformationAvailable(in nsIRequest aRequest, michael@0: in nsISupports aCtxt, michael@0: in AString aInfo); michael@0: michael@0: }; michael@0: michael@0: %{C++ michael@0: #define NS_IDIRINDEXLISTENER_KEY "@mozilla.org/dirIndexListener;1" michael@0: %} michael@0: michael@0: /** michael@0: * A parser for application/http-index-format michael@0: */ michael@0: [scriptable, uuid(38e3066c-1dd2-11b2-9b59-8be515c1ee3f)] michael@0: interface nsIDirIndexParser : nsIStreamListener { michael@0: /** michael@0: * The interface to use as a callback for new entries michael@0: */ michael@0: attribute nsIDirIndexListener listener; michael@0: michael@0: /** michael@0: * The comment given, if any michael@0: * This result is only valid _after_ OnStopRequest has occurred, michael@0: * because it can occur anywhere in the datastream michael@0: */ michael@0: readonly attribute string comment; michael@0: michael@0: /** michael@0: * The encoding to use michael@0: */ michael@0: attribute string encoding; michael@0: }; michael@0: michael@0: %{C++ michael@0: #define NS_DIRINDEXPARSER_CID \ michael@0: { /* a0d6ad32-1dd1-11b2-aa55-a40187b54036 */ \ michael@0: 0xa0d6ad32, \ michael@0: 0x1dd1, \ michael@0: 0x11b2, \ michael@0: { 0xaa, 0x55, 0xa4, 0x01, 0x87, 0xb5, 0x40, 0x36 } \ michael@0: } michael@0: michael@0: #define NS_DIRINDEXPARSER_CONTRACTID "@mozilla.org/dirIndexParser;1" michael@0: michael@0: %}